]> git.ozlabs.org Git - ppp.git/blobdiff - NeXT/inlines.h
does better without the includes
[ppp.git] / NeXT / inlines.h
index 46b02991ffaa3aa844993170803000d43d746fdc..88e155a05014e4eaf40891a096632442bedfed2a 100644 (file)
@@ -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 <bpf/bpf.h>
-
-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