diff options
author | amurai <amurai@FreeBSD.org> | 1995-01-31 06:29:58 +0000 |
---|---|---|
committer | amurai <amurai@FreeBSD.org> | 1995-01-31 06:29:58 +0000 |
commit | 21ef2761fd1e5a4beb483da8bddf767d36540dce (patch) | |
tree | 3aecd1251d1647032ad1455f304eaeeaab4987d0 /usr.sbin/ppp/mbuf.h | |
parent | 0487956fcf018d602bfe99b0e3398c6f4d55680a (diff) | |
download | FreeBSD-src-21ef2761fd1e5a4beb483da8bddf767d36540dce.zip FreeBSD-src-21ef2761fd1e5a4beb483da8bddf767d36540dce.tar.gz |
Diffstat (limited to 'usr.sbin/ppp/mbuf.h')
-rw-r--r-- | usr.sbin/ppp/mbuf.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/usr.sbin/ppp/mbuf.h b/usr.sbin/ppp/mbuf.h new file mode 100644 index 0000000..10cb67e --- /dev/null +++ b/usr.sbin/ppp/mbuf.h @@ -0,0 +1,67 @@ +/* + * Written by Toshiharu OHNO (tony-o@iij.ad.jp) + * + * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the Internet Initiative Japan. The name of the + * IIJ may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id:$ + * + * TODO: + */ + +#ifndef _MBUF_H_ +#define _MBUF_H_ + +struct mbuf { + u_char *base; /* pointer to top of buffer space */ + short size; /* size allocated from base */ + short offset; /* offset to start position */ + short cnt; /* available byte count in buffer */ + short type; + struct mbuf *next; /* link to next mbuf */ + struct mbuf *pnext; /* link to next packet */ +}; + +struct mqueue { + struct mbuf *top; + struct mbuf *last; + int qlen; +}; + +#define NULLBUFF ((struct mbuf *)0) + +#define MBUF_CTOP(bp) (bp->base + bp->offset) + +#define MB_ASYNC 1 +#define MB_FSM 2 +#define MB_HDLCOUT 3 +#define MB_IPIN 4 +#define MB_ECHO 5 +#define MB_LQR 6 +#define MB_MODEM 7 +#define MB_VJCOMP 8 +#define MB_LOG 9 +#define MB_IPQ 10 +#define MB_MAX MB_IPQ + +extern int plength(struct mbuf *bp); +extern struct mbuf *mballoc(int cnt, int type); +extern struct mbuf *mbfree(struct mbuf *bp); +extern void pfree(struct mbuf *bp); +extern void mbwrite(struct mbuf *bp, u_char *ptr, int cnt); +extern struct mbuf *mbread(struct mbuf *bp, u_char *ptr, int cnt); +extern void DumpBp(struct mbuf *bp); +extern void Enqueue(struct mqueue *queue, struct mbuf *bp); +extern struct mbuf *Dequeue(struct mqueue *queue); +#endif |