File: ether.h

package info (click to toggle)
iftop 1.0~pre4-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,072 kB
  • sloc: ansic: 5,782; sh: 4,262; makefile: 38
file content (33 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __ETHER_H_
#define __ETHER_H_

#define	ETHERTYPE_PUP		0x0200   
#define	ETHERTYPE_IP		0x0800
#define	ETHERTYPE_ARP		0x0806
#define	ETHERTYPE_REVARP	0x8035

#define	ETHER_ADDR_LEN		6

struct	ether_header {
	u_int8_t	ether_dhost[ETHER_ADDR_LEN];
	u_int8_t	ether_shost[ETHER_ADDR_LEN];
	u_int16_t	ether_type;
} __attribute__((packed));


struct vlan_8021q_header {
	u_int16_t	priority_cfi_vid;
	u_int16_t	ether_type;
};

/*
 * http://www.gsp.com/cgi-bin/man.cgi?section=9&topic=ieee80211_radiotap
 */
struct radiotap_header {
        u_int8_t        it_version;     /* set to 0 */
        u_int8_t        it_pad;
        u_int16_t       it_len;         /* entire length */
        u_int32_t       it_present;     /* fields present */
} __attribute__((packed));

#endif