2
2
* radsniff.h Structures and defines for the RADIUS sniffer.
4
* Version: $Id: radsniff.h,v 1.3 2006/11/14 21:21:46 fcusack Exp $
6
6
* This program is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU General Public License
24
24
#include <freeradius-devel/ident.h>
25
RCSIDH(radsniff_h, "$Id: radsniff.h,v 1.3 2006/11/14 21:21:46 fcusack Exp $")
25
RCSIDH(radsniff_h, "$Id$")
27
27
#include <sys/types.h>
28
28
#include <netinet/in.h>
36
36
* Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
38
38
struct ethernet_header {
39
u_int8_t ethernet_dhost[ETHER_ADDR_LEN];
40
u_int8_t ethernet_shost[ETHER_ADDR_LEN];
41
u_int16_t ethernet_type;
39
uint8_t ethernet_dhost[ETHER_ADDR_LEN];
40
uint8_t ethernet_shost[ETHER_ADDR_LEN];
41
uint16_t ethernet_type;
53
53
* Structure of an internet header, naked of options.
56
u_int8_t ip_vhl; /* header length, version */
56
uint8_t ip_vhl; /* header length, version */
57
57
#define IP_V(ip) (((ip)->ip_vhl & 0xf0) >> 4)
58
58
#define IP_HL(ip) ((ip)->ip_vhl & 0x0f)
59
u_int8_t ip_tos; /* type of service */
60
u_int16_t ip_len; /* total length */
61
u_int16_t ip_id; /* identification */
62
u_int16_t ip_off; /* fragment offset field */
63
#define IP_DF 0x4000 /* dont fragment flag */
59
uint8_t ip_tos; /* type of service */
60
uint16_t ip_len; /* total length */
61
uint16_t ip_id; /* identification */
62
uint16_t ip_off; /* fragment offset field */
63
#define I_DF 0x4000 /* dont fragment flag */
64
64
#define IP_MF 0x2000 /* more fragments flag */
65
65
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
66
u_int8_t ip_ttl; /* time to live */
67
u_int8_t ip_p; /* protocol */
68
u_int16_t ip_sum; /* checksum */
66
uint8_t ip_ttl; /* time to live */
67
uint8_t ip_p; /* protocol */
68
uint16_t ip_sum; /* checksum */
69
69
struct in_addr ip_src,ip_dst; /* source and dest address */
74
74
* Per RFC 768, September, 1981.
76
76
struct udp_header {
77
u_int16_t udp_sport; /* source port */
78
u_int16_t udp_dport; /* destination port */
79
u_int16_t udp_ulen; /* udp length */
80
u_int16_t udp_sum; /* udp checksum */
77
uint16_t udp_sport; /* source port */
78
uint16_t udp_dport; /* destination port */
79
uint16_t udp_ulen; /* udp length */
80
uint16_t udp_sum; /* udp checksum */