This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xpcapng.h
62 lines (55 loc) · 2.51 KB
/
xpcapng.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* SPDX-License-Identifier: GPL-2.0 */
/*****************************************************************************
* Multiple include protection
*****************************************************************************/
#ifndef __XPCAPNG_H_
#define __XPCAPNG_H_
#include <stdint.h>
#include <stdio.h>
/*****************************************************************************
* Handle
*****************************************************************************/
struct xpcapng_dumper;
/*****************************************************************************
* Flag variables
*****************************************************************************/
enum xpcapng_epb_flags {
PCAPNG_EPB_FLAG_INBOUND = 0x1,
PCAPNG_EPB_FLAG_OUTBOUND = 0x2,
};
/*****************************************************************************
* EPB options structure
*****************************************************************************/
struct xpcapng_epb_options_s {
enum xpcapng_epb_flags flags;
uint64_t dropcount;
uint64_t *packetid;
uint32_t *queue;
int64_t *xdp_verdict;
const char *comment;
uint16_t ppi_linktype;
};
/*****************************************************************************
* APIs
*****************************************************************************/
extern struct xpcapng_dumper *xpcapng_dump_open(FILE *f,
const char *comment,
const char *hardware,
const char *os,
const char *user_application);
extern void xpcapng_dump_close(struct xpcapng_dumper *pd);
extern int xpcapng_dump_add_interface(struct xpcapng_dumper *pd,
uint32_t snap_len,
const char *name, const char *description,
const uint8_t *mac, uint64_t speed,
uint8_t ts_resolution,
const char *hardware,
uint16_t link_type);
extern bool xpcapng_dump_enhanced_pkt(struct xpcapng_dumper *pd, uint32_t ifid,
const uint8_t *pkt, uint32_t len,
uint32_t caplen, uint64_t timestamp,
struct xpcapng_epb_options_s *options);
/*****************************************************************************
* End-of include file
*****************************************************************************/
#endif /* __XPCAPNG_H_ */