Haka: modules/packet/pcap/haka/pcap.h Source File

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

pcap.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifndef HAKA_PCAP_TCP_H
6 #define HAKA_PCAP_TCP_H
7
8 /* snapshot length - a value of 65535 is sufficient to get all
9 * of the packet's data on most networks (from pcap man page)
10 */
11 #define SNAPLEN 65535
12
13 struct pcap_capture {
14 pcap_t *pd;
15 int link_type;
16 FILE *file;
17 size_t file_size;
18 struct time last_progress;
19 };
20
21 /*
22 * Packet headers
23 */
24
25 struct linux_sll_header {
26 uint16 type;
27 uint16 arphdr_type;
28 uint16 link_layer_length;
29 uint64 link_layer_address;
30 uint16 protocol;
31 } PACKED;
32
33 int get_link_type_offset(int link_type);
34 int get_protocol(int link_type, struct vbuffer *data, size_t *data_offset);
35
36 #endif /* HAKA_PCAP_TCP_H */
vbuffer
Definition: vbuffer.h:64
uint64
unsigned HAKA_64BIT_TYPE uint64
Definition: types.h:30
uint16
unsigned HAKA_16BIT_TYPE uint16
Definition: types.h:28
time
Definition: time.h:21