xref: /freebsd-src/contrib/tcpdump/netdissect-alloc.h (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
1*ee67461eSJoseph Mingrone /*
2*ee67461eSJoseph Mingrone  * Copyright (c) 2018 The TCPDUMP project
3*ee67461eSJoseph Mingrone  * All rights reserved.
4*ee67461eSJoseph Mingrone  *
5*ee67461eSJoseph Mingrone  * Redistribution and use in source and binary forms, with or without
6*ee67461eSJoseph Mingrone  * modification, are permitted provided that: (1) source code
7*ee67461eSJoseph Mingrone  * distributions retain the above copyright notice and this paragraph
8*ee67461eSJoseph Mingrone  * in its entirety, and (2) distributions including binary code include
9*ee67461eSJoseph Mingrone  * the above copyright notice and this paragraph in its entirety in
10*ee67461eSJoseph Mingrone  * the documentation or other materials provided with the distribution.
11*ee67461eSJoseph Mingrone  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
12*ee67461eSJoseph Mingrone  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
13*ee67461eSJoseph Mingrone  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14*ee67461eSJoseph Mingrone  * FOR A PARTICULAR PURPOSE.
15*ee67461eSJoseph Mingrone  */
16*ee67461eSJoseph Mingrone 
17*ee67461eSJoseph Mingrone #ifndef netdissect_alloc_h
18*ee67461eSJoseph Mingrone #define netdissect_alloc_h
19*ee67461eSJoseph Mingrone 
20*ee67461eSJoseph Mingrone #include <stdarg.h>
21*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
22*ee67461eSJoseph Mingrone #include "netdissect.h"
23*ee67461eSJoseph Mingrone 
24*ee67461eSJoseph Mingrone typedef struct nd_mem_chunk {
25*ee67461eSJoseph Mingrone 	void *prev_mem_p;
26*ee67461eSJoseph Mingrone 	/* variable size data */
27*ee67461eSJoseph Mingrone } nd_mem_chunk_t;
28*ee67461eSJoseph Mingrone 
29*ee67461eSJoseph Mingrone void * nd_malloc(netdissect_options *, size_t);
30*ee67461eSJoseph Mingrone void nd_free_all(netdissect_options *);
31*ee67461eSJoseph Mingrone 
32*ee67461eSJoseph Mingrone #endif /* netdissect_alloc_h */
33