#include <vnet/fib/fib_table.h>
#include <vnet/fib/ip4_fib.h>
+source_range_check_main_t source_range_check_main;
+
/**
* @file
* @brief IPv4 Source and Port Range Checking.
u16x8_sub_saturate (ppr_dpo->blocks[i].low.as_u16x8, key.as_u16x8);
diff2.as_u16x8 =
u16x8_sub_saturate (ppr_dpo->blocks[i].hi.as_u16x8, key.as_u16x8);
- sum.as_u16x8 = u16x8_add (diff1.as_u16x8, diff2.as_u16x8);
- sum_equal_diff2.as_u16x8 =
- u16x8_is_equal (sum.as_u16x8, diff2.as_u16x8);
+ sum.as_u16x8 = diff1.as_u16x8 + diff2.as_u16x8;
+ sum_equal_diff2.as_u16x8 = (sum.as_u16x8 == diff2.as_u16x8);
sum_nonzero = ~u16x8_zero_byte_mask (sum.as_u16x8);
sum_equal = ~u16x8_zero_byte_mask (sum_equal_diff2.as_u16x8);
winner_mask = sum_nonzero & sum_equal;
ip0 = vlib_buffer_get_current (b0);
- c0 = vnet_feature_next_with_data (sw_if_index0, &next0,
- b0, sizeof (c0[0]));
+ c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0]));
/* we can't use the default VRF here... */
for (i = 0; i < IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS; i++)
.n_next_nodes = IP4_SOURCE_AND_PORT_RANGE_CHECK_N_NEXT,
.next_nodes = {
- [IP4_SOURCE_AND_PORT_RANGE_CHECK_NEXT_DROP] = "error-drop",
+ [IP4_SOURCE_AND_PORT_RANGE_CHECK_NEXT_DROP] = "ip4-drop",
},
.format_buffer = format_ip4_header,
.n_next_nodes = IP4_SOURCE_AND_PORT_RANGE_CHECK_N_NEXT,
.next_nodes = {
- [IP4_SOURCE_AND_PORT_RANGE_CHECK_NEXT_DROP] = "error-drop",
+ [IP4_SOURCE_AND_PORT_RANGE_CHECK_NEXT_DROP] = "ip4-drop",
},
.format_buffer = format_ip4_header,
* Example of graph node before range checking is enabled:
* @cliexstart{show vlib graph ip4-source-and-port-range-check-tx}
* Name Next Previous
- * ip4-source-and-port-range- error-drop [0]
+ * ip4-source-and-port-range- ip4-drop [0]
* @cliexend
*
* Example of how to enable range checking on TX:
* Example of graph node after range checking is enabled:
* @cliexstart{show vlib graph ip4-source-and-port-range-check-tx}
* Name Next Previous
- * ip4-source-and-port-range- error-drop [0] ip4-rewrite
+ * ip4-source-and-port-range- ip4-drop [0] ip4-rewrite
* interface-output [1]
* @cliexend
*
protocol_port_range_dpo_t *ppr_dpo;
pool_get_aligned (ppr_dpo_pool, ppr_dpo, CLIB_CACHE_LINE_BYTES);
- memset (ppr_dpo, 0, sizeof (*ppr_dpo));
+ clib_memset (ppr_dpo, 0, sizeof (*ppr_dpo));
ppr_dpo->n_free_ranges = N_PORT_RANGES_PER_DPO;
u16 * low_ports,
u16 * high_ports, int is_add)
{
- uint32_t fib_index;
+ u32 fib_index;
fib_index = fib_table_find (FIB_PROTOCOL_IP4, vrf_id);