struct mbuf {
size_t m_size;
u_short m_offset;
size_t m_len;
short m_type;
struct mbuf *m_next;
struct mbuf *m_nextpkt;
unsigned long priv;
};
struct mqueue {
struct mbuf *top;
struct mbuf *last;
size_t len;
};
#define MBUF_CTOP(bp) \
((bp) ? (u_char *)((bp)+1) + (bp)->m_offset : (u_char *)bp)
#define CONST_MBUF_CTOP(bp) \
((bp) ? (const u_char *)((bp)+1) + (bp)->m_offset : (const u_char *)bp)
#define MB_IPIN 0
#define MB_IPOUT 1
#define MB_IPV6IN 2
#define MB_IPV6OUT 3
#define MB_NATIN 4
#define MB_NATOUT 5
#define MB_MPIN 6
#define MB_MPOUT 7
#define MB_VJIN 8
#define MB_VJOUT 9
#define MB_ICOMPDIN 10
#define MB_ICOMPDOUT 11
#define MB_COMPDIN 12
#define MB_COMPDOUT 13
#define MB_LQRIN 14
#define MB_LQROUT 15
#define MB_ECHOIN 16
#define MB_ECHOOUT 17
#define MB_PROTOIN 18
#define MB_PROTOOUT 19
#define MB_ACFIN 20
#define MB_ACFOUT 21
#define MB_SYNCIN 22
#define MB_SYNCOUT 23
#define MB_HDLCIN 24
#define MB_HDLCOUT 25
#define MB_ASYNCIN 26
#define MB_ASYNCOUT 27
#define MB_CBCPIN 28
#define MB_CBCPOUT 29
#define MB_CHAPIN 30
#define MB_CHAPOUT 31
#define MB_PAPIN 32
#define MB_PAPOUT 33
#define MB_CCPIN 34
#define MB_CCPOUT 35
#define MB_IPCPIN 36
#define MB_IPCPOUT 37
#define MB_IPV6CPIN 38
#define MB_IPV6CPOUT 39
#define MB_LCPIN 40
#define MB_LCPOUT 41
#define MB_UNKNOWN 42
#define MB_MAX MB_UNKNOWN
#define M_MAXLEN (4352 - sizeof(struct mbuf))
struct cmdargs;
extern size_t m_length(struct mbuf *);
extern struct mbuf *m_get(size_t, int);
extern struct mbuf *m_free(struct mbuf *);
extern void m_freem(struct mbuf *);
extern void mbuf_Write(struct mbuf *, const void *, size_t);
extern struct mbuf *mbuf_Read(struct mbuf *, void *, size_t);
extern size_t mbuf_View(struct mbuf *, void *, size_t);
extern struct mbuf *m_prepend(struct mbuf *, const void *, size_t, u_short);
extern struct mbuf *m_adj(struct mbuf *, ssize_t);
extern struct mbuf *m_pullup(struct mbuf *);
extern void m_settype(struct mbuf *, int);
extern struct mbuf *m_append(struct mbuf *, const void *, size_t);
extern int mbuf_Show(struct cmdargs const *);
extern void m_enqueue(struct mqueue *, struct mbuf *);
extern struct mbuf *m_dequeue(struct mqueue *);