FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
fa_node.h
Go to the documentation of this file.
1 #ifndef _FA_NODE_H_
2 #define _FA_NODE_H_
3 
4 #include <stddef.h>
5 #include "bihash_40_8.h"
6 
7 #define TCP_FLAG_FIN 0x01
8 #define TCP_FLAG_SYN 0x02
9 #define TCP_FLAG_RST 0x04
10 #define TCP_FLAG_PUSH 0x08
11 #define TCP_FLAG_ACK 0x10
12 #define TCP_FLAG_URG 0x20
13 #define TCP_FLAG_ECE 0x40
14 #define TCP_FLAG_CWR 0x80
15 #define TCP_FLAGS_RSTFINACKSYN (TCP_FLAG_RST + TCP_FLAG_FIN + TCP_FLAG_SYN + TCP_FLAG_ACK)
16 #define TCP_FLAGS_ACKSYN (TCP_FLAG_SYN + TCP_FLAG_ACK)
17 
18 #define ACL_FA_CONN_TABLE_DEFAULT_HASH_NUM_BUCKETS (64 * 1024)
19 #define ACL_FA_CONN_TABLE_DEFAULT_HASH_MEMORY_SIZE (1<<30)
20 #define ACL_FA_CONN_TABLE_DEFAULT_MAX_ENTRIES 1000000
21 
22 typedef union {
24  struct {
26  u8 tcp_flags_valid:1;
27  u8 is_input:1;
28  u8 l4_valid:1;
29  u8 is_nonfirst_fragment:1;
30  u8 flags_reserved:4;
31  };
33 
34 typedef union {
36  struct {
37  u16 port[2];
40  };
42 
43 typedef union {
44  struct {
45  ip46_address_t addr[2];
47  /* This field should align with u64 value in bihash_40_8 keyvalue struct */
49  };
51 } fa_5tuple_t;
52 
53 
54 typedef struct {
55  fa_5tuple_t info; /* (5+1)*8 = 48 bytes */
56  u64 last_active_time; /* +8 bytes = 56 */
57  u32 sw_if_index; /* +4 bytes = 60 */
58  union {
59  u8 as_u8[2];
61  } tcp_flags_seen; ; /* +2 bytes = 62 */
62  u8 link_list_id; /* +1 bytes = 63 */
63  u8 reserved1; /* +1 bytes = 64 */
67  u64 reserved2[6];
68 } fa_session_t;
69 
70 
71 /*
72  * A few compile-time constraints on the size and the layout of the union, to ensure
73  * it makes sense both for bihash and for us.
74  */
75 
76 #define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
77 CT_ASSERT_EQUAL(fa_l3_key_size_is_40, offsetof(fa_5tuple_t, pkt), offsetof(clib_bihash_kv_40_8_t, value));
78 CT_ASSERT_EQUAL(fa_l4_key_t_is_8, sizeof(fa_session_l4_key_t), sizeof(u64));
79 CT_ASSERT_EQUAL(fa_packet_info_t_is_8, sizeof(fa_packet_info_t), sizeof(u64));
80 CT_ASSERT_EQUAL(fa_l3_kv_size_is_48, sizeof(fa_5tuple_t), sizeof(clib_bihash_kv_40_8_t));
81 
82 /* Let's try to fit within the cacheline */
83 CT_ASSERT_EQUAL(fa_session_t_size_is_64, sizeof(fa_session_t), 128);
84 #undef CT_ASSERT_EQUAL
85 
86 
87 typedef enum {
91 
92 
93 enum
94 {
98 
99 void acl_fa_enable_disable(u32 sw_if_index, int is_input, int enable_disable);
100 
101 
102 #endif
fa_session_l4_key_t l4
Definition: fa_node.h:46
fa_packet_info_t pkt
Definition: fa_node.h:48
u8 reserved1
Definition: fa_node.h:63
fa_5tuple_t info
Definition: fa_node.h:55
#define CT_ASSERT_EQUAL(name, x, y)
Definition: fa_node.h:76
u8 link_list_id
Definition: fa_node.h:61
u32 link_prev_idx
Definition: fa_node.h:64
enum @242 acl_fa_cleaner_process_event_e
unsigned long u64
Definition: types.h:89
clib_bihash_kv_40_8_t kv
Definition: fa_node.h:50
u64 last_active_time
Definition: fa_node.h:56
void acl_fa_enable_disable(u32 sw_if_index, int is_input, int enable_disable)
Definition: fa_node.c:1284
acl_fa_next_t
Definition: fa_node.h:87
u32 sw_if_index
Definition: fa_node.h:57
unsigned int u32
Definition: types.h:88
u32 link_next_idx
Definition: fa_node.h:65
u16 as_u16
Definition: fa_node.h:60
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56
vhost_vring_addr_t addr
Definition: vhost-user.h:84
u64 link_enqueue_time
Definition: fa_node.h:66