Home | History | Annotate | Line # | Download | only in includes
      1 /*	$NetBSD: ctrace.h,v 1.3 2022/04/03 01:10:58 christos Exp $	*/
      2 
      3 /* trace.h
      4 
      5    Definitions for dhcp tracing facility... */
      6 
      7 /*
      8  * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
      9  * Copyright (c) 2001-2003 by Internet Software Consortium
     10  *
     11  * This Source Code Form is subject to the terms of the Mozilla Public
     12  * License, v. 2.0. If a copy of the MPL was not distributed with this
     13  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     14  *
     15  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
     16  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     17  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
     18  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     20  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     21  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     22  *
     23  *   Internet Systems Consortium, Inc.
     24  *   PO Box 360
     25  *   Newmarket, NH 03857 USA
     26  *   <info (at) isc.org>
     27  *   https://www.isc.org/
     28  *
     29  */
     30 
     31 typedef struct {
     32 	struct in_addr primary_address;
     33 	u_int32_t index;
     34 	struct hardware hw_address;
     35 	char name [IFNAMSIZ];
     36 } trace_interface_packet_t;
     37 
     38 typedef struct {
     39 	u_int32_t index;
     40 	struct iaddr from;
     41 	u_int16_t from_port;
     42 	struct hardware hfrom;
     43 	u_int8_t havehfrom;
     44 } trace_inpacket_t;
     45 
     46 typedef struct {
     47 	u_int32_t index;
     48 	struct iaddr from;
     49 	struct iaddr to;
     50 	u_int16_t to_port;
     51 	struct hardware hto;
     52 	u_int8_t havehto;
     53 } trace_outpacket_t;
     54 
     55 void trace_interface_register (trace_type_t *, struct interface_info *);
     56 void trace_interface_input (trace_type_t *, unsigned, char *);
     57 void trace_interface_stop (trace_type_t *);
     58 void trace_inpacket_stash (struct interface_info *,
     59 			   struct dhcp_packet *, unsigned, unsigned int,
     60 			   struct iaddr, struct hardware *);
     61 void trace_inpacket_input (trace_type_t *, unsigned, char *);
     62 void trace_inpacket_stop (trace_type_t *);
     63 void trace_outpacket_input (trace_type_t *, unsigned, char *);
     64 void trace_outpacket_stop (trace_type_t *);
     65 ssize_t trace_packet_send (struct interface_info *,
     66 			   struct packet *, struct dhcp_packet *, size_t,
     67 			   struct in_addr,
     68 			   struct sockaddr_in *, struct hardware *);
     69 void trace_icmp_input_input (trace_type_t *, unsigned, char *);
     70 void trace_icmp_input_stop (trace_type_t *);
     71 void trace_icmp_output_input (trace_type_t *, unsigned, char *);
     72 void trace_icmp_output_stop (trace_type_t *);
     73 void trace_seed_stash (trace_type_t *, unsigned);
     74 void trace_seed_input (trace_type_t *, unsigned, char *);
     75 void trace_seed_stop (trace_type_t *);
     76