aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/epan/falco_bridge/packet-falco-bridge.h
blob: 7cd089ee0b05d4069463f07e46786f877706e981 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* packet-falco-bridge.h
 *
 * By Loris Degioanni
 * Copyright (C) 2021 Sysdig, Inc.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef __PACKET_FALCO_BRIDGE_H__
#define __PACKET_FALCO_BRIDGE_H__

/*
 * API versions of this plugin engine
 */
#define PLUGIN_API_VERSION_MAJOR 0
#define PLUGIN_API_VERSION_MINOR 2
#define PLUGIN_API_VERSION_PATCH 0

/*
 * Return types
 */
#define SCAP_SUCCESS 0
#define SCAP_FAILURE 1
#define SCAP_TIMEOUT -1
#define SCAP_ILLEGAL_INPUT 3
#define SCAP_NOTFOUND 4
#define SCAP_INPUT_TOO_SMALL 5
#define SCAP_EOF 6
#define SCAP_UNEXPECTED_BLOCK 7
#define SCAP_VERSION_MISMATCH 8
#define SCAP_NOT_SUPPORTED 9

#define PROTO_DATA_BRIDGE_HANDLE    0x00
#define PROTO_DATA_CONVINFO_USER_0   10000
#define PROTO_DATA_CONVINFO_USER_1   10001
#define PROTO_DATA_CONVINFO_USER_2   10002
#define PROTO_DATA_CONVINFO_USER_3   10003
#define PROTO_DATA_CONVINFO_USER_4   10004
#define PROTO_DATA_CONVINFO_USER_5   10005
#define PROTO_DATA_CONVINFO_USER_6   10006
#define PROTO_DATA_CONVINFO_USER_7   10007
#define PROTO_DATA_CONVINFO_USER_8   10008
#define PROTO_DATA_CONVINFO_USER_9   10009
#define PROTO_DATA_CONVINFO_USER_10  10010
#define PROTO_DATA_CONVINFO_USER_11  10011
#define PROTO_DATA_CONVINFO_USER_12  10012
#define PROTO_DATA_CONVINFO_USER_13  10013
#define PROTO_DATA_CONVINFO_USER_14  10014
#define PROTO_DATA_CONVINFO_USER_15  10015
#define PROTO_DATA_CONVINFO_USER_BASE PROTO_DATA_CONVINFO_USER_0

typedef enum bridge_field_flags_e {
    BFF_NONE = 0,
    BFF_HIDDEN = 1 << 1, // Unused
    BFF_INFO = 1 << 2,
    BFF_CONVERSATION = 1 << 3
} bridge_field_flags_e;

typedef struct bridge_info {
    sinsp_source_info_t *ssi;
    uint32_t source_id;
    int proto;
    hf_register_info* hf;
    int* hf_ids;
    uint32_t visible_fields;
    uint32_t* field_flags;
    int* field_ids;
} bridge_info;

typedef struct conv_fld_info {
    const char* proto_name;
    hf_register_info* field_info;
    char field_val[4096];
} conv_fld_info;

#endif // __PACKET_FALCO_BRIDGE_H__