Added the new version for dummynet.
[ipfw.git] / dummynet / include / sys / mbuf.h
index ed3d3a1..12837bf 100644 (file)
@@ -107,11 +107,21 @@ m_tag_prepend(struct mbuf *m, struct m_tag *t)
        SLIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link);
 }
 
+/*
+ * Return the next tag in the list of tags associated with an mbuf.
+ */
+static __inline struct m_tag *
+m_tag_next(struct mbuf *m, struct m_tag *t)
+{
+        return (SLIST_NEXT(t, m_tag_link));
+}
+
 /*
  * Create an mtag of the given type
  */
 static __inline struct m_tag *
-m_tag_get(int type, int length, int wait)
+m_tag_alloc(uint32_t cookie, int type, int length, int wait)
 {
        int l = length + sizeof(struct m_tag);
        struct m_tag *m = malloc(l, 0, M_NOWAIT);
@@ -119,10 +129,17 @@ m_tag_get(int type, int length, int wait)
                memset(m, 0, l);
                m->m_tag_id = type;
                m->m_tag_len = length;
+               m->m_tag_cookie = cookie;
        }
        return m;
 };
 
+static __inline struct m_tag *
+m_tag_get(int type, int length, int wait)
+{
+       return m_tag_alloc(MTAG_ABI_COMPAT, type, length, wait);
+}
+
 static __inline struct m_tag *
 m_tag_first(struct mbuf *m)
 {
@@ -140,6 +157,7 @@ m_tag_locate(struct mbuf *m, u_int32_t n, int x, struct m_tag *t)
        return NULL;
 };
 
+#define M_SETFIB(_m, _fib)     /* nothing on linux */
 static __inline void
 m_freem(struct mbuf *m)
 {
@@ -156,7 +174,7 @@ m_freem(struct mbuf *m)
 };
 
 /* we cannot pullup */
-#define m_pullup(__m, __i)     (m)
+//#define m_pullup(__m, __i)   (m)
 
 #define M_GETFIB(_m)   0