FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
nat_ipfix_logging.h
Go to the documentation of this file.
1 /*
2  * nat_ipfix_logging.h - NAT Events IPFIX logging
3  *
4  * Copyright (c) 2016 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __included_nat_ipfix_logging_h__
18 #define __included_nat_ipfix_logging_h__
19 
20 #include <nat/nat.h>
21 
22 typedef enum {
32 } nat_event_t;
33 
34 typedef enum {
39 
40 typedef struct {
41 
42  /** ipfix buffers under construction */
52 
53  /** frames containing ipfix buffers */
63 
64  /** next record offset */
74 
76 
77 typedef struct {
78  /** NAT plugin IPFIX logging enabled */
80 
81  /** Time reference pair */
84 
85  /* Per thread data */
87 
88  /** template IDs */
98 
99  /** stream index */
101 
102  /** vector of worker vlib mains */
104 
105  /** nat data callbacks call counter */
107 
109 
111 
113 int snat_ipfix_logging_enable_disable (int enable, u32 domain_id, u16 src_port);
115  u32 nat_src_ip,
116  nat_protocol_t nat_proto,
117  u16 src_port, u16 nat_src_port,
118  u32 vrf_id);
120  u32 nat_src_ip,
121  nat_protocol_t nat_proto,
122  u16 src_port, u16 nat_src_port,
123  u32 vrf_id);
124 void snat_ipfix_logging_addresses_exhausted(u32 thread_index, u32 pool_id);
126  u32 limit, u32 src_ip);
127 void nat_ipfix_logging_max_sessions(u32 thread_index, u32 limit);
128 void nat_ipfix_logging_max_bibs(u32 thread_index, u32 limit);
129 void nat_ipfix_logging_nat64_session(u32 thread_index,
130  ip6_address_t * src_ip,
131  ip4_address_t * nat_src_ip, u8 proto,
132  u16 src_port, u16 nat_src_port,
133  ip6_address_t * dst_ip,
134  ip4_address_t * nat_dst_ip,
135  u16 dst_port, u16 nat_dst_port,
136  u32 vrf_id, u8 is_create);
137 void nat_ipfix_logging_nat64_bib(u32 thread_index,
138  ip6_address_t * src_ip,
139  ip4_address_t * nat_src_ip, u8 proto,
140  u16 src_port, u16 nat_src_port,
141  u32 vrf_id, u8 is_create);
142 
143 #endif /* __included_nat_ipfix_logging_h__ */
unsigned long u64
Definition: types.h:89
vl_api_ip_port_and_mask_t dst_port
Definition: flow_types.api:92
vlib_buffer_t * max_frags_ip4_buffer
void snat_ipfix_logging_init(vlib_main_t *vm)
Initialize NAT plugin IPFIX logging.
vlib_buffer_t * addr_exhausted_buffer
vlib_main_t * vm
Definition: in2out_ed.c:1582
u8 enabled
NAT plugin IPFIX logging enabled.
nat_protocol_t
Definition: lib.h:41
snat_ipfix_per_thread_data_t * per_thread_data
unsigned char u8
Definition: types.h:56
void snat_ipfix_logging_max_entries_per_user(u32 thread_index, u32 limit, u32 src_ip)
Generate maximum entries per user exceeded event.
double f64
Definition: types.h:142
unsigned int u32
Definition: types.h:88
snat_ipfix_logging_main_t snat_ipfix_logging_main
quota_exceed_event_t
vlib_main_t ** worker_vms
vector of worker vlib mains
void nat_ipfix_logging_max_sessions(u32 thread_index, u32 limit)
Generate maximum session entries exceeded event.
vl_api_ip_proto_t proto
Definition: acl_types.api:50
void nat_ipfix_logging_max_bibs(u32 thread_index, u32 limit)
Generate maximum BIB entries exceeded event.
unsigned short u16
Definition: types.h:57
vlib_frame_t * max_entries_per_user_frame
u16 call_counter
nat data callbacks call counter
u64 milisecond_time_0
Time reference pair.
void nat_ipfix_logging_nat64_bib(u32 thread_index, ip6_address_t *src_ip, ip4_address_t *nat_src_ip, u8 proto, u16 src_port, u16 nat_src_port, u32 vrf_id, u8 is_create)
Generate NAT64 BIB create and delete events.
vl_api_ip_port_and_mask_t src_port
Definition: flow_types.api:91
vlib_buffer_t * max_entries_per_user_buffer
u16 nat44_session_template_id
template IDs
void nat_ipfix_logging_nat64_session(u32 thread_index, ip6_address_t *src_ip, ip4_address_t *nat_src_ip, u8 proto, u16 src_port, u16 nat_src_port, ip6_address_t *dst_ip, ip4_address_t *nat_dst_ip, u16 dst_port, u16 nat_dst_port, u32 vrf_id, u8 is_create)
Generate NAT64 session create and delete events.
vlib_frame_t * nat44_session_frame
frames containing ipfix buffers
int snat_ipfix_logging_enable_disable(int enable, u32 domain_id, u16 src_port)
Enable/disable NAT plugin IPFIX logging.
vlib_buffer_t * nat44_session_buffer
ipfix buffers under construction
nat_event_t
u32 nat44_session_next_record_offset
next record offset
VLIB buffer representation.
Definition: buffer.h:102
vl_api_address_t src_ip
Definition: wireguard.api:36
vl_api_address_t dst_ip
Definition: udp.api:44
vlib_buffer_t * max_frags_ip6_buffer
u32 vrf_id
Definition: nat.api:944
void snat_ipfix_logging_addresses_exhausted(u32 thread_index, u32 pool_id)
Generate NAT addresses exhausted event.
void snat_ipfix_logging_nat44_ses_delete(u32 thread_index, u32 src_ip, u32 nat_src_ip, nat_protocol_t nat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id)
Generate NAT44 session delete event.
void snat_ipfix_logging_nat44_ses_create(u32 thread_index, u32 src_ip, u32 nat_src_ip, nat_protocol_t nat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id)
Generate NAT44 session create event.