use strlcpy, strlcat, slprintf everywhere
[mpls-ppp.git] / NeXT / netbuf.h
blob578ac8f0022a9575ebf36633491ab9f57713b05d
1 /*
2 * Copyright (C) 1990 by NeXT, Inc., All Rights Reserved
4 */
6 /*
7 * Network Buffer API (for kernel use only)
9 * HISTORY
10 * 09-Apr-90 Bradley Taylor (btaylor) at NeXT, Inc.
11 * Created.
13 #ifndef _NETBUF_
14 #define _NETBUF_
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!)
21 typedef struct netbuf { struct netbuf *m_nextpkt; } *netbuf_t;
23 #ifdef KERNEL
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);
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);
40 #endif /* KERNEL */
41 #endif /* _NETBUF_ */