|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
34 #define foreach_mactime_error \
35 _(OK, "Permitted packets") \
36 _(STATIC_DROP, "Static drop packets") \
37 _(RANGE_DROP, "Range drop packets") \
38 _(QUOTA_DROP, "Data quota drop packets") \
39 _(DROP_10001, "Dropped UDP DST-port 10001")
43 #define _(sym,str) MACTIME_ERROR_##sym,
50 #define _(sym,string) string,
70 s =
format (s,
"MACTIME: src mac %U device %s result %s\n",
122 int has_dynamic_range_allow = 0;
154 if (clib_bihash_search_8_8 (lut, &kv, &kv) < 0)
167 device_index0 = kv.
value;
178 &device_current_count);
182 b0->
error =
node->errors[MACTIME_ERROR_QUOTA_DROP];
199 b0->
error =
node->errors[MACTIME_ERROR_STATIC_DROP];
215 if (
ip->protocol != IP_PROTOCOL_UDP)
217 if (clib_net_to_host_u16 (udp->
dst_port) == 10001 ||
218 clib_net_to_host_u16 (udp->
dst_port) == 9603)
221 b0->
error =
node->errors[MACTIME_ERROR_DROP_10001];
247 has_dynamic_range_allow = 1;
250 if (
now >= start0 &&
now <= end0)
259 b0->
error =
node->errors[MACTIME_ERROR_RANGE_DROP];
263 else if (has_dynamic_range_allow)
268 b0->
error =
node->errors[MACTIME_ERROR_QUOTA_DROP];
298 b0->
error =
node->errors[MACTIME_ERROR_STATIC_DROP];
314 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
333 to_next, n_left_to_next,
341 MACTIME_ERROR_OK, packets_ok);
342 return frame->n_vectors;
357 .vector_size =
sizeof (
u32),
386 .name =
"mactime-tx",
387 .vector_size =
sizeof (
u32),
vnet_interface_main_t * im
vnet_config_main_t config_main
#define MACTIME_DEVICE_FLAG_DYNAMIC_DROP
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void mactime_send_create_entry_message(u8 *mac_address)
Create a lookup table entry for the indicated mac address.
nat44_ei_hairpin_src_next_t next_index
vl_api_mac_address_t src_mac
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW_QUOTA
@ VLIB_NODE_TYPE_INTERNAL
vlib_combined_counter_main_t drop_counters
vlib_main_t vlib_node_runtime_t * node
#define MACTIME_DEVICE_FLAG_STATIC_DROP
Always drop packets from this device.
#define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u8 * format_mactime_trace(u8 *s, va_list *args)
vnet_hw_if_output_node_runtime_t * r
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
vlib_node_registration_t mactime_tx_node
(constructor) VLIB_REGISTER_NODE (mactime_tx_node)
u8 * format_mac_address(u8 *s, va_list *args)
static uword mactime_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_tx)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
Combined counter to hold both packets and byte differences.
@ MACTIME_NEXT_ETHERNET_INPUT
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
clib_timebase_range_t * ranges
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
vlib_node_registration_t mactime_node
(constructor) VLIB_REGISTER_NODE (mactime_node)
sll srl srl sll sra u16x4 i
vlib_combined_counter_main_t allow_counters
static char * mactime_error_strings[]
static uword mactime_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct _vlib_node_registration vlib_node_registration_t
mactime_device_t * devices
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
static uword mactime_tx_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
#define foreach_mactime_error
mactime_main_t mactime_main
static f64 clib_timebase_now(clib_timebase_t *tb)
counter_t bytes
byte counter
8 octet key, 8 octet key value pair
#define MACTIME_DEVICE_FLAG_STATIC_ALLOW
static_always_inline vnet_feature_config_main_t * vnet_feature_get_config_main(u16 arc)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
clib_bihash_8_8_t lookup_table
__clib_export f64 clib_timebase_find_sunday_midnight(f64 start_time)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
u8 output_feature_arc_index
vl_api_fib_path_type_t type
vnet_interface_main_t interface_main
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
#define MACTIME_DEVICE_FLAG_DROP_UDP_10001
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)