]> git.ozlabs.org Git - ppp.git/blob - NeXT/netbuf.h
more files are now ultrix-specific
[ppp.git] / NeXT / netbuf.h
1 /* 
2  * Copyright (C) 1990 by NeXT, Inc., All Rights Reserved
3  *
4  */
5
6 /* 
7  * Network Buffer API (for kernel use only)
8  *
9  * HISTORY
10  * 09-Apr-90  Bradley Taylor (btaylor) at NeXT, Inc.
11  *      Created. 
12  */
13 #ifndef _NETBUF_
14 #define _NETBUF_
15
16 /*
17  * We know only that the first entry in the structure is a
18  * pointer that isn't used while the netbuf is allocated.
19  * (that is, until an nb_free() or an inet_queue() of course!)
20  */
21 typedef struct netbuf { struct netbuf *m_nextpkt; } *netbuf_t;
22
23 #ifdef KERNEL
24
25 extern char *nb_map(netbuf_t nb);
26 extern netbuf_t nb_alloc(unsigned size);
27 extern netbuf_t nb_alloc_wrapper(void *data, unsigned size,
28                                  void freefunc(void *), void *freefunc_arg);
29
30 extern void nb_free(netbuf_t nb);
31 extern void nb_free_wrapper(netbuf_t nb);
32 extern unsigned nb_size(netbuf_t nb);
33 extern int nb_read(netbuf_t nb, unsigned offset, unsigned size, void *target);
34 extern int nb_write(netbuf_t nb, unsigned offset, unsigned size, void *source);
35 extern int nb_shrink_top(netbuf_t nb, unsigned size);
36 extern int nb_grow_top(netbuf_t nb, unsigned size);
37 extern int nb_shrink_bot(netbuf_t nb, unsigned size);
38 extern int nb_grow_bot(netbuf_t nb, unsigned size);
39
40 #endif /* KERNEL */
41 #endif /* _NETBUF_ */