Deleted Added
full compact
mbuf.h (38174) mbuf.h (38472)
1/*
2 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
3 *
4 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the Internet Initiative Japan. The name of the
12 * IIJ may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
1/*
2 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
3 *
4 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the Internet Initiative Japan. The name of the
12 * IIJ may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * $Id: mbuf.h,v 1.12 1998/05/21 21:46:49 brian Exp $
18 * $Id: mbuf.h,v 1.13 1998/08/07 18:42:50 brian Exp $
19 *
20 * TODO:
21 */
22
23struct mbuf {
19 *
20 * TODO:
21 */
22
23struct mbuf {
24 u_char *base; /* pointer to top of buffer space */
25 short size; /* size allocated from base */
26 short offset; /* offset to start position */
24 short size; /* size allocated (excluding header) */
25 short offset; /* offset from header end to start position */
27 short cnt; /* available byte count in buffer */
26 short cnt; /* available byte count in buffer */
28 short type;
27 short type; /* MB_* below */
29 struct mbuf *next; /* link to next mbuf */
30 struct mbuf *pnext; /* link to next packet */
28 struct mbuf *next; /* link to next mbuf */
29 struct mbuf *pnext; /* link to next packet */
30 /* buffer space is malloc()d directly after the header */
31};
32
33struct mqueue {
34 struct mbuf *top;
35 struct mbuf *last;
36 int qlen;
37};
38
31};
32
33struct mqueue {
34 struct mbuf *top;
35 struct mbuf *last;
36 int qlen;
37};
38
39#define MBUF_CTOP(bp) (bp->base + bp->offset)
39#define MBUF_CTOP(bp) ((u_char *)((bp)+1) + (bp)->offset)
40#define CONST_MBUF_CTOP(bp) ((const u_char *)((bp)+1) + (bp)->offset)
40
41#define MB_ASYNC 1
42#define MB_FSM 2
43#define MB_CBCP 3
44#define MB_HDLCOUT 4
45#define MB_IPIN 5
46#define MB_ECHO 6
47#define MB_LQR 7

--- 18 unchanged lines hidden ---
41
42#define MB_ASYNC 1
43#define MB_FSM 2
44#define MB_CBCP 3
45#define MB_HDLCOUT 4
46#define MB_IPIN 5
47#define MB_ECHO 6
48#define MB_LQR 7

--- 18 unchanged lines hidden ---