FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
snat_ipfix_logging.c File Reference
+ Include dependency graph for snat_ipfix_logging.c:

Go to the source code of this file.

Data Structures

struct  snat_ipfix_logging_nat44_ses_args_t
 
struct  snat_ipfix_logging_addr_exhausted_args_t
 
struct  snat_ipfix_logging_max_entries_per_user_args_t
 

Macros

#define NAT44_SESSION_CREATE_LEN   26
 
#define NAT_ADDRESSES_EXHAUTED_LEN   13
 
#define MAX_ENTRIES_PER_USER_LEN   17
 
#define NAT44_SESSION_CREATE_FIELD_COUNT   8
 
#define NAT_ADDRESSES_EXHAUTED_FIELD_COUNT   3
 
#define MAX_ENTRIES_PER_USER_FIELD_COUNT   4
 

Functions

static u8snat_template_rewrite (flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port, nat_event_t event, quota_exceed_event_t quota_event)
 Create an IPFIX template packet rewrite string. More...
 
u8snat_template_rewrite_addr_exhausted (flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port)
 
u8snat_template_rewrite_nat44_session (flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port)
 
u8snat_template_rewrite_max_entries_per_usr (flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port)
 
static void snat_ipfix_header_create (flow_report_main_t *frm, vlib_buffer_t *b0, u32 *offset)
 
static void snat_ipfix_send (flow_report_main_t *frm, vlib_frame_t *f, vlib_buffer_t *b0, u16 template_id)
 
static void snat_ipfix_logging_nat44_ses (u8 nat_event, u32 src_ip, u32 nat_src_ip, snat_protocol_t snat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id, int do_flush)
 
static void snat_ipfix_logging_addr_exhausted (u32 pool_id, int do_flush)
 
static void snat_ipfix_logging_max_entries_per_usr (u32 src_ip, int do_flush)
 
static void snat_ipfix_logging_nat44_ses_rpc_cb (snat_ipfix_logging_nat44_ses_args_t *a)
 
void snat_ipfix_logging_nat44_ses_create (u32 src_ip, u32 nat_src_ip, snat_protocol_t snat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id)
 Generate NAT44 session create event. More...
 
void snat_ipfix_logging_nat44_ses_delete (u32 src_ip, u32 nat_src_ip, snat_protocol_t snat_proto, u16 src_port, u16 nat_src_port, u32 vrf_id)
 Generate NAT44 session delete event. More...
 
vlib_frame_tsnat_data_callback_nat44_session (flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
 
static void snat_ipfix_logging_addr_exhausted_rpc_cb (snat_ipfix_logging_addr_exhausted_args_t *a)
 
void snat_ipfix_logging_addresses_exhausted (u32 pool_id)
 Generate NAT addresses exhausted event. More...
 
vlib_frame_tsnat_data_callback_addr_exhausted (flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
 
static void snat_ipfix_logging_max_entries_per_usr_rpc_cb (snat_ipfix_logging_max_entries_per_user_args_t *a)
 
void snat_ipfix_logging_max_entries_per_user (u32 src_ip)
 Generate maximum entries per user exceeded event. More...
 
vlib_frame_tsnat_data_callback_max_entries_per_usr (flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
 
int snat_ipfix_logging_enable_disable (int enable, u32 domain_id, u16 src_port)
 Enable/disable SNAT IPFIX logging. More...
 
void snat_ipfix_logging_init (vlib_main_t *vm)
 Initialize SNAT IPFIX logging. More...
 

Variables

snat_ipfix_logging_main_t snat_ipfix_logging_main
 

Macro Definition Documentation

#define MAX_ENTRIES_PER_USER_FIELD_COUNT   4

Definition at line 31 of file snat_ipfix_logging.c.

#define MAX_ENTRIES_PER_USER_LEN   17

Definition at line 27 of file snat_ipfix_logging.c.

#define NAT44_SESSION_CREATE_FIELD_COUNT   8

Definition at line 29 of file snat_ipfix_logging.c.

#define NAT44_SESSION_CREATE_LEN   26

Definition at line 25 of file snat_ipfix_logging.c.

#define NAT_ADDRESSES_EXHAUTED_FIELD_COUNT   3

Definition at line 30 of file snat_ipfix_logging.c.

#define NAT_ADDRESSES_EXHAUTED_LEN   13

Definition at line 26 of file snat_ipfix_logging.c.

Function Documentation

vlib_frame_t* snat_data_callback_addr_exhausted ( flow_report_main_t frm,
flow_report_t fr,
vlib_frame_t f,
u32 to_next,
u32  node_index 
)

Definition at line 708 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_frame_t* snat_data_callback_max_entries_per_usr ( flow_report_main_t frm,
flow_report_t fr,
vlib_frame_t f,
u32 to_next,
u32  node_index 
)

Definition at line 743 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_frame_t* snat_data_callback_nat44_session ( flow_report_main_t frm,
flow_report_t fr,
vlib_frame_t f,
u32 to_next,
u32  node_index 
)

Definition at line 673 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_header_create ( flow_report_main_t frm,
vlib_buffer_t b0,
u32 offset 
)
inlinestatic

Definition at line 235 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_addr_exhausted ( u32  pool_id,
int  do_flush 
)
static

Definition at line 427 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_addr_exhausted_rpc_cb ( snat_ipfix_logging_addr_exhausted_args_t a)
static

Definition at line 685 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_ipfix_logging_addresses_exhausted ( u32  pool_id)

Generate NAT addresses exhausted event.

Parameters
pool_idNAT pool ID

Definition at line 696 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int snat_ipfix_logging_enable_disable ( int  enable,
u32  domain_id,
u16  src_port 
)

Enable/disable SNAT IPFIX logging.

Parameters
enable1 if enable, 0 if disable
domain_idobservation domain ID
src_portsource port number
Returns
0 if success

Definition at line 763 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_ipfix_logging_init ( vlib_main_t vm)

Initialize SNAT IPFIX logging.

Parameters
vmvlib main

Definition at line 826 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_ipfix_logging_max_entries_per_user ( u32  src_ip)

Generate maximum entries per user exceeded event.

Parameters
src_ipsource IPv4 address

Definition at line 731 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_max_entries_per_usr ( u32  src_ip,
int  do_flush 
)
static

Definition at line 512 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_max_entries_per_usr_rpc_cb ( snat_ipfix_logging_max_entries_per_user_args_t a)
static

Definition at line 720 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_nat44_ses ( u8  nat_event,
u32  src_ip,
u32  nat_src_ip,
snat_protocol_t  snat_proto,
u16  src_port,
u16  nat_src_port,
u32  vrf_id,
int  do_flush 
)
static

Definition at line 323 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_ipfix_logging_nat44_ses_create ( u32  src_ip,
u32  nat_src_ip,
snat_protocol_t  snat_proto,
u16  src_port,
u16  nat_src_port,
u32  vrf_id 
)

Generate NAT44 session create event.

Parameters
src_ipsource IPv4 address
nat_src_iptransaltes source IPv4 address
snat_protoSNAT transport protocol
src_portsource port
nat_src_porttranslated source port
vrf_idVRF ID

Definition at line 619 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_ipfix_logging_nat44_ses_delete ( u32  src_ip,
u32  nat_src_ip,
snat_protocol_t  snat_proto,
u16  src_port,
u16  nat_src_port,
u32  vrf_id 
)

Generate NAT44 session delete event.

Parameters
src_ipsource IPv4 address
nat_src_iptransaltes source IPv4 address
snat_protoSNAT transport protocol
src_portsource port
nat_src_porttranslated source port
vrf_idVRF ID

Definition at line 651 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_logging_nat44_ses_rpc_cb ( snat_ipfix_logging_nat44_ses_args_t a)
static

Definition at line 601 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void snat_ipfix_send ( flow_report_main_t frm,
vlib_frame_t f,
vlib_buffer_t b0,
u16  template_id 
)
inlinestatic

Definition at line 281 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* snat_template_rewrite ( flow_report_main_t frm,
flow_report_t fr,
ip4_address_t collector_address,
ip4_address_t src_address,
u16  collector_port,
nat_event_t  event,
quota_exceed_event_t  quota_event 
)
inlinestatic

Create an IPFIX template packet rewrite string.

Parameters
frmflow report main
frflow report
collector_addresscollector address
src_addresssource address
collector_portcollector
eventNAT event ID
quota_eventNAT quota exceeded event ID
Returns
template packet

Definition at line 65 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* snat_template_rewrite_addr_exhausted ( flow_report_main_t frm,
flow_report_t fr,
ip4_address_t collector_address,
ip4_address_t src_address,
u16  collector_port 
)

Definition at line 201 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* snat_template_rewrite_max_entries_per_usr ( flow_report_main_t frm,
flow_report_t fr,
ip4_address_t collector_address,
ip4_address_t src_address,
u16  collector_port 
)

Definition at line 223 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* snat_template_rewrite_nat44_session ( flow_report_main_t frm,
flow_report_t fr,
ip4_address_t collector_address,
ip4_address_t src_address,
u16  collector_port 
)

Definition at line 212 of file snat_ipfix_logging.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

snat_ipfix_logging_main_t snat_ipfix_logging_main

Definition at line 23 of file snat_ipfix_logging.c.