+__BEGIN_DECLS
+/* Not exported */
+__private_extern__ unsigned int mbuf_default_ncl(int, uint64_t);
+__private_extern__ void mbinit(void);
+__private_extern__ struct mbuf *m_clattach(struct mbuf *, int, caddr_t,
+ void (*)(caddr_t , u_int, caddr_t), u_int, caddr_t, int);
+__private_extern__ caddr_t m_bigalloc(int);
+__private_extern__ void m_bigfree(caddr_t, u_int, caddr_t);
+__private_extern__ struct mbuf *m_mbigget(struct mbuf *, int);
+__private_extern__ caddr_t m_16kalloc(int);
+__private_extern__ void m_16kfree(caddr_t, u_int, caddr_t);
+__private_extern__ struct mbuf *m_m16kget(struct mbuf *, int);
+__private_extern__ void mbuf_growth_aggressive(void);
+__private_extern__ void mbuf_growth_normal(void);
+
+/* Exported */
+struct mbuf *m_copym(struct mbuf *, int, int, int);
+struct mbuf *m_split(struct mbuf *, int, int);
+struct mbuf *m_free(struct mbuf *);
+struct mbuf *m_get(int, int);
+struct mbuf *m_getpacket(void);
+struct mbuf *m_getclr(int, int);
+struct mbuf *m_gethdr(int, int);
+struct mbuf *m_prepend(struct mbuf *, int, int);
+struct mbuf *m_prepend_2(struct mbuf *, int, int);
+struct mbuf *m_pullup(struct mbuf *, int);
+struct mbuf *m_retry(int, int);
+struct mbuf *m_retryhdr(int, int);
+void m_adj(struct mbuf *, int);
+void m_freem(struct mbuf *);
+int m_freem_list(struct mbuf *);
+struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(const void *, void *, size_t));
+char *mcl_to_paddr(char *);
+struct mbuf *m_pulldown(struct mbuf*, int, int, int*);
+
+extern struct mbuf *m_getcl(int, int, int);
+struct mbuf *m_mclget(struct mbuf *, int);
+caddr_t m_mclalloc(int);
+void m_mclfree(caddr_t p);
+int m_mclhasreference(struct mbuf *);
+void m_copy_pkthdr(struct mbuf *, struct mbuf*);
+
+int m_mclref(struct mbuf *);
+int m_mclunref(struct mbuf *);
+
+void * m_mtod(struct mbuf *);
+struct mbuf * m_dtom(void *);
+int m_mtocl(void *);
+union mcluster *m_cltom(int );
+
+int m_trailingspace(struct mbuf *);
+int m_leadingspace(struct mbuf *);
+
+struct mbuf *m_normalize(struct mbuf *m);
+void m_mchtype(struct mbuf *m, int t);
+void m_mcheck(struct mbuf*);
+
+extern void m_copyback(struct mbuf *, int , int , const void *);
+extern struct mbuf *m_copyback_cow(struct mbuf *, int, int, const void *, int);
+extern int m_makewritable(struct mbuf **, int, int, int);
+void m_copydata(struct mbuf *, int , int , void *);
+struct mbuf* m_dup(struct mbuf *m, int how);
+void m_cat(struct mbuf *, struct mbuf *);
+struct mbuf *m_copym_with_hdrs(struct mbuf*, int, int, int, struct mbuf**, int*);
+struct mbuf *m_getpackets(int, int, int);
+struct mbuf * m_getpackethdrs(int , int );
+struct mbuf* m_getpacket_how(int );
+struct mbuf * m_getpackets_internal(unsigned int *, int , int , int , size_t);
+struct mbuf * m_allocpacket_internal(unsigned int * , size_t , unsigned int *, int , int , size_t );
+
+__END_DECLS
+
+/*
+ Packets may have annotations attached by affixing a list of "packet
+ tags" to the pkthdr structure. Packet tags are dynamically allocated
+ semi-opaque data structures that have a fixed header (struct m_tag)
+ that specifies the size of the memory block and an <id,type> pair that
+ identifies it. The id identifies the module and the type identifies the
+ type of data for that module. The id of zero is reserved for the kernel.
+
+ Note that the packet tag returned by m_tag_allocate has the default
+ memory alignment implemented by malloc. To reference private data one
+ can use a construct like:
+
+ struct m_tag *mtag = m_tag_allocate(...);
+ struct foo *p = (struct foo *)(mtag+1);
+
+ if the alignment of struct m_tag is sufficient for referencing members
+ of struct foo. Otherwise it is necessary to embed struct m_tag within
+ the private data structure to insure proper alignment; e.g.
+
+ struct foo {
+ struct m_tag tag;
+ ...
+ };
+ struct foo *p = (struct foo *) m_tag_allocate(...);
+ struct m_tag *mtag = &p->tag;
+ */
+
+#define KERNEL_MODULE_TAG_ID 0
+
+enum {
+ KERNEL_TAG_TYPE_NONE = 0,
+ KERNEL_TAG_TYPE_DUMMYNET = 1,
+ KERNEL_TAG_TYPE_DIVERT = 2,
+ KERNEL_TAG_TYPE_IPFORWARD = 3,
+ KERNEL_TAG_TYPE_IPFILT = 4,
+ KERNEL_TAG_TYPE_MACLABEL = 5,
+ KERNEL_TAG_TYPE_MAC_POLICY_LABEL = 6,
+ KERNEL_TAG_TYPE_ENCAP = 8,
+ KERNEL_TAG_TYPE_INET6 = 9,
+ KERNEL_TAG_TYPE_IPSEC = 10,
+ KERNEL_TAG_TYPE_PF = 11
+};
+
+/*
+ * As a temporary and low impact solution to replace the even uglier
+ * approach used so far in some parts of the network stack (which relies
+ * on global variables), packet tag-like annotations are stored in MT_TAG
+ * mbufs (or lookalikes) prepended to the actual mbuf chain.
+ *
+ * m_type = MT_TAG
+ * m_flags = m_tag_id
+ * m_next = next buffer in chain.
+ *
+ * BE VERY CAREFUL not to pass these blocks to the mbuf handling routines.
+ */
+#define _m_tag_id m_hdr.mh_flags
+
+__BEGIN_DECLS
+
+/* Packet tag routines */
+struct m_tag *m_tag_alloc(u_int32_t id, u_int16_t type, int len, int wait);
+void m_tag_free(struct m_tag *);
+void m_tag_prepend(struct mbuf *, struct m_tag *);
+void m_tag_unlink(struct mbuf *, struct m_tag *);
+void m_tag_delete(struct mbuf *, struct m_tag *);
+void m_tag_delete_chain(struct mbuf *, struct m_tag *);
+struct m_tag *m_tag_locate(struct mbuf *,u_int32_t id, u_int16_t type,
+ struct m_tag *);
+struct m_tag *m_tag_copy(struct m_tag *, int wait);
+int m_tag_copy_chain(struct mbuf *to, struct mbuf *from, int wait);
+void m_tag_init(struct mbuf *);
+struct m_tag *m_tag_first(struct mbuf *);
+struct m_tag *m_tag_next(struct mbuf *, struct m_tag *);
+
+extern void m_prio_init(struct mbuf *);
+extern void m_prio_background(struct mbuf *);
+
+__END_DECLS
+
+#endif /* KERNEL */
+
+#endif /* KERNEL_PRIVATE */
+#ifdef KERNEL
+#include <sys/kpi_mbuf.h>
+#endif /* KERNEL */