2 * Copyright (C) 1990 by NeXT, Inc., All Rights Reserved
7 * Network Buffer API (for kernel use only)
10 * 09-Apr-90 Bradley Taylor (btaylor) at NeXT, Inc.
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
;
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
);