summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat')
-rw-r--r--src/plugins/nat/lib/ipfix_logging.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/plugins/nat/lib/ipfix_logging.c b/src/plugins/nat/lib/ipfix_logging.c
index 0b67a34b200..1c39e853084 100644
--- a/src/plugins/nat/lib/ipfix_logging.c
+++ b/src/plugins/nat/lib/ipfix_logging.c
@@ -144,9 +144,8 @@ do { \
*/
static inline u8 *
nat_template_rewrite (ipfix_exporter_t *exp, 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)
+ u16 collector_port, nat_event_t event,
+ quota_exceed_event_t quota_event)
{
nat_ipfix_logging_main_t *silm = &nat_ipfix_logging_main;
ip4_header_t *ip;
@@ -239,8 +238,8 @@ nat_template_rewrite (ipfix_exporter_t *exp, flow_report_t *fr,
ip->ip_version_and_header_length = 0x45;
ip->ttl = 254;
ip->protocol = IP_PROTOCOL_UDP;
- ip->src_address.as_u32 = src_address->as_u32;
- ip->dst_address.as_u32 = collector_address->as_u32;
+ ip->src_address.as_u32 = exp->src_address.as_u32;
+ ip->dst_address.as_u32 = exp->ipfix_collector.as_u32;
udp->src_port = clib_host_to_net_u16 (stream->src_port);
udp->dst_port = clib_host_to_net_u16 (collector_port);
udp->length = clib_host_to_net_u16 (vec_len (rewrite) - sizeof (*ip));
@@ -389,26 +388,22 @@ nat_template_rewrite (ipfix_exporter_t *exp, flow_report_t *fr,
u8 *
nat_template_rewrite_addr_exhausted (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address,
u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, NAT_ADDRESSES_EXHAUTED, 0);
+ return nat_template_rewrite (exp, fr, collector_port, NAT_ADDRESSES_EXHAUTED,
+ 0);
}
u8 *
nat_template_rewrite_nat44_session (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address,
u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, NAT44_SESSION_CREATE, 0);
+ return nat_template_rewrite (exp, fr, collector_port, NAT44_SESSION_CREATE,
+ 0);
}
u8 *
@@ -417,57 +412,47 @@ nat_template_rewrite_max_entries_per_usr (
ip4_address_t *src_address, u16 collector_port, ipfix_report_element_t *elts,
u32 n_elts, u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, QUOTA_EXCEEDED,
+ return nat_template_rewrite (exp, fr, collector_port, QUOTA_EXCEEDED,
MAX_ENTRIES_PER_USER);
}
u8 *
nat_template_rewrite_max_sessions (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address,
u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, QUOTA_EXCEEDED,
+ return nat_template_rewrite (exp, fr, collector_port, QUOTA_EXCEEDED,
MAX_SESSION_ENTRIES);
}
u8 *
nat_template_rewrite_max_bibs (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address, u16 collector_port,
+ u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, QUOTA_EXCEEDED,
+ return nat_template_rewrite (exp, fr, collector_port, QUOTA_EXCEEDED,
MAX_BIB_ENTRIES);
}
u8 *
nat_template_rewrite_nat64_bib (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address, u16 collector_port,
+ u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, NAT64_BIB_CREATE, 0);
+ return nat_template_rewrite (exp, fr, collector_port, NAT64_BIB_CREATE, 0);
}
u8 *
nat_template_rewrite_nat64_session (ipfix_exporter_t *exp, flow_report_t *fr,
- ip4_address_t *collector_address,
- ip4_address_t *src_address,
u16 collector_port,
ipfix_report_element_t *elts, u32 n_elts,
u32 *stream_index)
{
- return nat_template_rewrite (exp, fr, collector_address, src_address,
- collector_port, NAT64_SESSION_CREATE, 0);
+ return nat_template_rewrite (exp, fr, collector_port, NAT64_SESSION_CREATE,
+ 0);
}
static inline void