X-Git-Url: http://git.onelab.eu/?p=ipfw.git;a=blobdiff_plain;f=dummynet%2Finclude%2Fsys%2Fmbuf.h;h=12837bf19a69a43bea5a28d197d35c7822550d98;hp=ed3d3a1eaa46b2e3a1424ccd8c063b580fb13e03;hb=4e189c94aef3d3e9a4e8edfd2bb989feeb5d5e26;hpb=fd71c20d7328b71ac47493f9f27925de690980ed diff --git a/dummynet/include/sys/mbuf.h b/dummynet/include/sys/mbuf.h index ed3d3a1..12837bf 100644 --- a/dummynet/include/sys/mbuf.h +++ b/dummynet/include/sys/mbuf.h @@ -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