X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_bd.h;h=082d210b9725c0976b7ee56309b283b98ccc2d7b;hb=7c2a3357f32ae02bcc20cdad6d87beda39f71d31;hp=226e30ecfd4cdec9c52cf95c38ec7e8f8fbceccb;hpb=b474380f82b75d9640f9bf6ee78c891a6794dbfb;p=vpp.git diff --git a/src/vnet/l2/l2_bd.h b/src/vnet/l2/l2_bd.h index 226e30ecfd4..082d210b972 100644 --- a/src/vnet/l2/l2_bd.h +++ b/src/vnet/l2/l2_bd.h @@ -2,6 +2,7 @@ * l2_bd.h : layer 2 bridge domain * * Copyright (c) 2013 Cisco and/or its affiliates. + * Copyright (c) 2022 Nordix Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -20,6 +21,8 @@ #include #include +#include +#include typedef enum l2_bd_port_type_t_ { @@ -108,6 +111,12 @@ typedef struct /* Bridge domain tag (C string NULL terminated) */ u8 *bd_tag; + /* Maximum number of learned entries */ + u32 learn_limit; + + /* Current number of learned entries */ + u32 learn_count; + } l2_bridge_domain_t; /* Limit Bridge Domain ID to 24 bits to match 24-bit VNI range */ @@ -121,6 +130,7 @@ typedef struct u8 forward; u8 learn; u8 arp_term; + u8 arp_ufwd; u8 mac_age; u8 *bd_tag; u8 is_add; @@ -136,7 +146,6 @@ bd_is_valid (l2_bridge_domain_t * bd_config) /* Init bridge domain if not done already */ void bd_validate (l2_bridge_domain_t * bd_config); - void bd_add_member (l2_bridge_domain_t * bd_config, l2_flood_member_t * member); @@ -150,13 +159,15 @@ typedef enum bd_flags_t_ L2_FLOOD = (1 << 2), L2_UU_FLOOD = (1 << 3), L2_ARP_TERM = (1 << 4), + L2_ARP_UFWD = (1 << 5), } bd_flags_t; u32 bd_set_flags (vlib_main_t * vm, u32 bd_index, bd_flags_t flags, u32 enable); void bd_set_mac_age (vlib_main_t * vm, u32 bd_index, u8 age); +void bd_set_learn_limit (vlib_main_t *vm, u32 bd_index, u32 learn_limit); int bd_add_del (l2_bridge_domain_add_del_args_t * args); - +u32 bd_get_unused_id (void); /** * \brief Get a bridge domain. * @@ -197,8 +208,22 @@ bd_find_or_add_bd_index (bd_main_t * bdm, u32 bd_id) return bd_index; } +/** + * \brief Walk all the input interfaces in the BD + */ +typedef walk_rc_t (*bd_input_walk_fn_t) (u32 bd_index, u32 sw_if_index); + +u32 bd_input_walk (u32 bd_index, bd_input_walk_fn_t fn, void *data); + +l2_bridge_domain_t *bd_get (u32 bd_index); +l2_bridge_domain_t *bd_get_by_table_id (u32 table_id); + u32 bd_add_del_ip_mac (u32 bd_index, - u8 * ip_addr, u8 * mac_addr, u8 is_ip6, u8 is_add); + ip46_type_t type, + const ip46_address_t * ip_addr, + const mac_address_t * mac, u8 is_add); + +void bd_flush_ip_mac (u32 bd_index); #endif