Type: fix
IPfix messages about NAT44 session create/delete were being populated
with the FIB table index instead of the table ID. The table ID is the
correct identifier to report externally (NAT64 IPfix messages for BIB
and session create/delete use table ID, as does NAT syslogging). Convert
the table index to an ID before adding it to the IPfix NAT44 session
create/delete message data.
Change-Id: I0166384752b17ff3a8c55aa19fa2af7a8140791e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
* limitations under the License.
*/
* limitations under the License.
*/
+#include <vnet/fib/fib_table.h>
#include <vnet/ipfix-export/flow_report.h>
#include <vnet/ip/ip4.h>
#include <vnet/udp/udp_local.h>
#include <vnet/ipfix-export/flow_report.h>
#include <vnet/ip/ip4.h>
#include <vnet/udp/udp_local.h>
static void
nat_ipfix_logging_nat44_ses (u32 thread_index, u8 nat_event, u32 src_ip,
u32 nat_src_ip, nat_protocol_t nat_proto,
static void
nat_ipfix_logging_nat44_ses (u32 thread_index, u8 nat_event, u32 src_ip,
u32 nat_src_ip, nat_protocol_t nat_proto,
- u16 src_port, u16 nat_src_port, u32 vrf_id,
+ u16 src_port, u16 nat_src_port, u32 fib_index,
int do_flush)
{
nat_ipfix_logging_main_t *silm = &nat_ipfix_logging_main;
int do_flush)
{
nat_ipfix_logging_main_t *silm = &nat_ipfix_logging_main;
u64 now;
u8 proto;
u16 template_id;
u64 now;
u8 proto;
u16 template_id;
proto = nat_proto_to_ip_proto (nat_proto);
proto = nat_proto_to_ip_proto (nat_proto);
clib_memcpy_fast (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
offset += sizeof (nat_src_port);
clib_memcpy_fast (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
offset += sizeof (nat_src_port);
+ vrf_id = fib_table_get_table_id (fib_index, FIB_PROTOCOL_IP4);
vrf_id = clib_host_to_net_u32 (vrf_id);
clib_memcpy_fast (b0->data + offset, &vrf_id, sizeof (vrf_id));
offset += sizeof (vrf_id);
vrf_id = clib_host_to_net_u32 (vrf_id);
clib_memcpy_fast (b0->data + offset, &vrf_id, sizeof (vrf_id));
offset += sizeof (vrf_id);
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port,
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port,
- u16 nat_src_port, u32 vrf_id)
+ u16 nat_src_port, u32 fib_index)
{
skip_if_disabled ();
nat_ipfix_logging_nat44_ses (thread_index, NAT44_SESSION_CREATE, src_ip,
nat_src_ip, nat_proto, src_port, nat_src_port,
{
skip_if_disabled ();
nat_ipfix_logging_nat44_ses (thread_index, NAT44_SESSION_CREATE, src_ip,
nat_src_ip, nat_proto, src_port, nat_src_port,
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port,
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port,
- u16 nat_src_port, u32 vrf_id)
+ u16 nat_src_port, u32 fib_index)
{
skip_if_disabled ();
nat_ipfix_logging_nat44_ses (thread_index, NAT44_SESSION_DELETE, src_ip,
nat_src_ip, nat_proto, src_port, nat_src_port,
{
skip_if_disabled ();
nat_ipfix_logging_nat44_ses (thread_index, NAT44_SESSION_DELETE, src_ip,
nat_src_ip, nat_proto, src_port, nat_src_port,
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port, u16 nat_src_port,
u32 nat_src_ip,
nat_protocol_t nat_proto,
u16 src_port, u16 nat_src_port,
void nat_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,
void nat_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,
void nat_ipfix_logging_addresses_exhausted(u32 thread_index, u32 pool_id);
void nat_ipfix_logging_max_entries_per_user(u32 thread_index,
u32 limit, u32 src_ip);
void nat_ipfix_logging_addresses_exhausted(u32 thread_index, u32 pool_id);
void nat_ipfix_logging_max_entries_per_user(u32 thread_index,
u32 limit, u32 src_ip);