xref: /minix/external/bsd/dhcp/dist/includes/ctrace.h (revision 83ee113e)
1 /*	$NetBSD: ctrace.h,v 1.1.1.3 2014/07/12 11:57:53 spz Exp $	*/
2 /* trace.h
3 
4    Definitions for dhcp tracing facility... */
5 
6 /*
7  * Copyright (c) 2004,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
8  * Copyright (c) 2001-2003 by Internet Software Consortium
9  *
10  * Permission to use, copy, modify, and distribute this software for any
11  * purpose with or without fee is hereby granted, provided that the above
12  * copyright notice and this permission notice appear in all copies.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
15  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
17  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  *   Internet Systems Consortium, Inc.
23  *   950 Charter Street
24  *   Redwood City, CA 94063
25  *   <info@isc.org>
26  *   https://www.isc.org/
27  *
28  */
29 
30 typedef struct {
31 	struct in_addr primary_address;
32 	u_int32_t index;
33 	struct hardware hw_address;
34 	char name [IFNAMSIZ];
35 } trace_interface_packet_t;
36 
37 typedef struct {
38 	u_int32_t index;
39 	struct iaddr from;
40 	u_int16_t from_port;
41 	struct hardware hfrom;
42 	u_int8_t havehfrom;
43 } trace_inpacket_t;
44 
45 typedef struct {
46 	u_int32_t index;
47 	struct iaddr from;
48 	struct iaddr to;
49 	u_int16_t to_port;
50 	struct hardware hto;
51 	u_int8_t havehto;
52 } trace_outpacket_t;
53 
54 void trace_interface_register (trace_type_t *, struct interface_info *);
55 void trace_interface_input (trace_type_t *, unsigned, char *);
56 void trace_interface_stop (trace_type_t *);
57 void trace_inpacket_stash (struct interface_info *,
58 			   struct dhcp_packet *, unsigned, unsigned int,
59 			   struct iaddr, struct hardware *);
60 void trace_inpacket_input (trace_type_t *, unsigned, char *);
61 void trace_inpacket_stop (trace_type_t *);
62 void trace_outpacket_input (trace_type_t *, unsigned, char *);
63 void trace_outpacket_stop (trace_type_t *);
64 ssize_t trace_packet_send (struct interface_info *,
65 			   struct packet *, struct dhcp_packet *, size_t,
66 			   struct in_addr,
67 			   struct sockaddr_in *, struct hardware *);
68 void trace_icmp_input_input (trace_type_t *, unsigned, char *);
69 void trace_icmp_input_stop (trace_type_t *);
70 void trace_icmp_output_input (trace_type_t *, unsigned, char *);
71 void trace_icmp_output_stop (trace_type_t *);
72 void trace_seed_stash (trace_type_t *, unsigned);
73 void trace_seed_input (trace_type_t *, unsigned, char *);
74 void trace_seed_stop (trace_type_t *);
75