X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=NeXT%2Finlines.h;h=88e155a05014e4eaf40891a096632442bedfed2a;hp=46b02991ffaa3aa844993170803000d43d746fdc;hb=8168f3bcad7dd8d72ed57ec1e12b0a784c62fbf6;hpb=7554d5fef3f478ca0f9c8911522d7c1783989eae;ds=sidebyside diff --git a/NeXT/inlines.h b/NeXT/inlines.h index 46b0299..88e155a 100644 --- a/NeXT/inlines.h +++ b/NeXT/inlines.h @@ -68,11 +68,11 @@ nbq_high(struct nb_queue* nbq) return rv; } -static inline netbuf_t +static inline NETBUF_T nbq_peek(struct nb_queue* nbq) { int s; - netbuf_t nb; + NETBUF_T nb; s = splimp(); nb = nbq->head; @@ -80,18 +80,18 @@ nbq_peek(struct nb_queue* nbq) return nb; } -static inline netbuf_t +static inline NETBUF_T nbq_dequeue(struct nb_queue* nbq) { int s; - netbuf_t nb; + NETBUF_T nb; if (!nbq->head) return NULL; s = splimp(); nb = nbq->head; - nb_get_next(nb,&nbq->head); + NB_GET_NEXT(nb,&nbq->head); if (!nbq->head) nbq->tail = NULL; --nbq->len; @@ -118,14 +118,14 @@ nbq_dequeue(struct nb_queue* nbq) */ static inline int -nbq_enqueue(struct nb_queue* nbq, netbuf_t nb) +nbq_enqueue(struct nb_queue* nbq, NETBUF_T nb) { int s; - nb_set_next(nb,NULL); + NB_SET_NEXT(nb,NULL); s = splimp(); if (nbq->tail) - nb_set_next(nbq->tail,nb); + NB_SET_NEXT(nbq->tail,nb); else nbq->head = nb; nbq->tail = nb; @@ -137,15 +137,15 @@ nbq_enqueue(struct nb_queue* nbq, netbuf_t nb) static inline void nbq_flush(struct nb_queue *nbq) { - netbuf_t nb,temp; + NETBUF_T nb,temp; int s; s = splimp(); nb = nbq->head; while(nb) { temp=nb; - nb_get_next(nb,&nb); - nb_free(temp); + NB_GET_NEXT(nb,&nb); + NB_FREE(temp); } nbq->head = nbq->tail = NULL; @@ -185,7 +185,7 @@ nbq_drop(struct nb_queue *nbq) /* * Not very pretty, but it makes for less "diffs"... */ -#define mtod(m,type) ((type) nb_map(m)) +#define mtod(m,type) ((type) NB_MAP(m)) typedef void (*pfv)(void *); @@ -217,27 +217,3 @@ extern struct uthread *uthread_from_thread(thread_t); #define curproc (proc_from_thread(current_thread())) -#ifdef NBPFILTER -#include - -extern struct bpf_fns fnarg; - -static inline void -bpfattach(caddr_t *driverp, netif_t ifp, u_int dlt, u_int hdrlen) -{ - struct bpf_attachargs atarg = {driverp, (caddr_t) ifp, dlt, hdrlen}; - - if (cdevsw[BPF_MAJOR_CHAR].d_ioctl != 0) - { - (*cdevsw[BPF_MAJOR_CHAR].d_ioctl)(0, BIOCATTACH, &atarg, 0); - (*cdevsw[BPF_MAJOR_CHAR].d_ioctl)(0, BIOCGFNS, &fnarg, 0); - } -} - - -static inline void -bpf_tap(caddr_t arg, u_char *pkt, u_int pktlen) -{ - (*fnarg.tapfn)(arg, pkt, pktlen); -} -#endif