Deleted Added
full compact
mbuf.h (46828) mbuf.h (47695)
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.16 1999/05/08 11:07:09 brian Exp $
18 * $Id: mbuf.h,v 1.17 1999/05/09 20:02:25 brian Exp $
19 *
20 * TODO:
21 */
22
23struct mbuf {
24 short size; /* size allocated (excluding header) */
25 short offset; /* offset from header end to start position */
26 short cnt; /* available byte count in buffer */

--- 10 unchanged lines hidden (view full) ---

37};
38
39#define MBUF_CTOP(bp) \
40 ((bp) ? (u_char *)((bp)+1) + (bp)->offset : NULL)
41
42#define CONST_MBUF_CTOP(bp) \
43 ((bp) ? (const u_char *)((bp)+1) + (bp)->offset : NULL)
44
19 *
20 * TODO:
21 */
22
23struct mbuf {
24 short size; /* size allocated (excluding header) */
25 short offset; /* offset from header end to start position */
26 short cnt; /* available byte count in buffer */

--- 10 unchanged lines hidden (view full) ---

37};
38
39#define MBUF_CTOP(bp) \
40 ((bp) ? (u_char *)((bp)+1) + (bp)->offset : NULL)
41
42#define CONST_MBUF_CTOP(bp) \
43 ((bp) ? (const u_char *)((bp)+1) + (bp)->offset : NULL)
44
45#define MB_ASYNC 1
46#define MB_FSM 2
47#define MB_CBCP 3
48#define MB_HDLCOUT 4
49#define MB_IPIN 5
50#define MB_ECHO 6
51#define MB_LQR 7
52#define MB_VJCOMP 8
53#define MB_IPQ 9
54#define MB_MP 10
55#define MB_MAX MB_MP
45#define MB_IPIN 0
46#define MB_IPOUT 1
47#define MB_ALIASIN 2
48#define MB_ALIASOUT 3
49#define MB_MPIN 4
50#define MB_MPOUT 5
51#define MB_VJIN 6
52#define MB_VJOUT 7
53#define MB_ICOMPDIN 8
54#define MB_ICOMPDOUT 9
55#define MB_COMPDIN 10
56#define MB_COMPDOUT 11
57#define MB_LQRIN 12
58#define MB_LQROUT 13
59#define MB_ECHOIN 14
60#define MB_ECHOOUT 15
61#define MB_PROTOIN 16
62#define MB_PROTOOUT 17
63#define MB_ACFIN 18
64#define MB_ACFOUT 19
65#define MB_SYNCIN 20
66#define MB_SYNCOUT 21
67#define MB_HDLCIN 22
68#define MB_HDLCOUT 23
69#define MB_ASYNCIN 24
70#define MB_ASYNCOUT 25
71#define MB_CBCPIN 26
72#define MB_CBCPOUT 27
73#define MB_CHAPIN 28
74#define MB_CHAPOUT 29
75#define MB_PAPIN 30
76#define MB_PAPOUT 31
77#define MB_CCPIN 32
78#define MB_CCPOUT 33
79#define MB_IPCPIN 34
80#define MB_IPCPOUT 35
81#define MB_LCPIN 36
82#define MB_LCPOUT 37
83#define MB_UNKNOWN 38
84#define MB_MAX MB_UNKNOWN
56
57struct cmdargs;
58
59extern int mbuf_Length(struct mbuf *);
60extern struct mbuf *mbuf_Alloc(int, int);
61extern struct mbuf *mbuf_FreeSeg(struct mbuf *);
62extern void mbuf_Free(struct mbuf *);
63extern void mbuf_Write(struct mbuf *, const void *, size_t);
64extern struct mbuf *mbuf_Read(struct mbuf *, void *, size_t);
65extern size_t mbuf_View(struct mbuf *, void *, size_t);
66extern struct mbuf *mbuf_Prepend(struct mbuf *, const void *, size_t, size_t);
67extern struct mbuf *mbuf_Truncate(struct mbuf *, size_t);
85
86struct cmdargs;
87
88extern int mbuf_Length(struct mbuf *);
89extern struct mbuf *mbuf_Alloc(int, int);
90extern struct mbuf *mbuf_FreeSeg(struct mbuf *);
91extern void mbuf_Free(struct mbuf *);
92extern void mbuf_Write(struct mbuf *, const void *, size_t);
93extern struct mbuf *mbuf_Read(struct mbuf *, void *, size_t);
94extern size_t mbuf_View(struct mbuf *, void *, size_t);
95extern struct mbuf *mbuf_Prepend(struct mbuf *, const void *, size_t, size_t);
96extern struct mbuf *mbuf_Truncate(struct mbuf *, size_t);
68extern void mbuf_Log(void);
69extern int mbuf_Show(struct cmdargs const *);
70extern void mbuf_Enqueue(struct mqueue *, struct mbuf *);
71extern struct mbuf *mbuf_Dequeue(struct mqueue *);
72extern struct mbuf *mbuf_Contiguous(struct mbuf *);
97extern int mbuf_Show(struct cmdargs const *);
98extern void mbuf_Enqueue(struct mqueue *, struct mbuf *);
99extern struct mbuf *mbuf_Dequeue(struct mqueue *);
100extern struct mbuf *mbuf_Contiguous(struct mbuf *);
101extern void mbuf_SetType(struct mbuf *, int);