43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 51 #define foreach_vpe_api_msg \ 52 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \ 53 _(HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \ 54 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \ 55 _(WANT_INTERFACE_EVENTS, want_interface_events) \ 56 _(SW_INTERFACE_DUMP, sw_interface_dump) \ 57 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \ 58 _(SW_INTERFACE_SET_RX_MODE, sw_interface_set_rx_mode) \ 59 _(SW_INTERFACE_RX_PLACEMENT_DUMP, sw_interface_rx_placement_dump) \ 60 _(SW_INTERFACE_SET_RX_PLACEMENT, sw_interface_set_rx_placement) \ 61 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \ 62 _(SW_INTERFACE_GET_TABLE, sw_interface_get_table) \ 63 _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \ 64 _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \ 65 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \ 66 _(SW_INTERFACE_SET_MAC_ADDRESS, sw_interface_set_mac_address) \ 67 _(SW_INTERFACE_GET_MAC_ADDRESS, sw_interface_get_mac_address) \ 68 _(CREATE_VLAN_SUBIF, create_vlan_subif) \ 69 _(CREATE_SUBIF, create_subif) \ 70 _(DELETE_SUBIF, delete_subif) \ 71 _(CREATE_LOOPBACK, create_loopback) \ 72 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \ 73 _(DELETE_LOOPBACK, delete_loopback) \ 74 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \ 75 _(COLLECT_DETAILED_INTERFACE_STATS, collect_detailed_interface_stats) \ 76 _(SW_INTERFACE_SET_IP_DIRECTED_BROADCAST, \ 77 sw_interface_set_ip_directed_broadcast) 82 vl_api_sw_interface_set_flags_reply_t *rmp;
106 vl_api_hw_interface_set_mtu_reply_t *rmp;
109 u16 mtu = ntohs (mp->
mtu);
118 rv = VNET_API_ERROR_INVALID_VALUE;
119 goto bad_sw_if_index;
127 rv = VNET_API_ERROR_FEATURE_DISABLED;
128 goto bad_sw_if_index;
131 if (mtu < hi->min_supported_packet_bytes)
133 rv = VNET_API_ERROR_INVALID_VALUE;
134 goto bad_sw_if_index;
139 rv = VNET_API_ERROR_INVALID_VALUE;
140 goto bad_sw_if_index;
152 vl_api_sw_interface_set_mtu_reply_t *rmp;
162 per_protocol_mtu[i] = ntohl (mp->
mtu[i]);
174 vl_api_sw_interface_set_ip_directed_broadcast_reply_t *rmp;
184 REPLY_MACRO (VL_API_SW_INTERFACE_SET_IP_DIRECTED_BROADCAST_REPLY);
198 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_DETAILS);
245 u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0;
248 &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0)
252 clib_warning (
"cannot get vlan tag rewrite for sw_if_index %d",
257 mp->
vtr_op = ntohl (vtr_op);
273 &vtr_op, &outer_tag, ð_hdr, &b_vlanid, &i_sid))
307 u8 *filter = 0, *
name = 0;
314 char *strcasestr (
char *,
char *);
318 if (!vnet_swif_is_api_visible (swif))
320 vec_reset_length(name);
321 name = format (name,
"%U%c", format_vnet_sw_interface_name, am->vnet_main,
324 if (filter && !strcasestr((char *) name, (char *) filter))
327 send_sw_interface_details (am, rp, swif, name, mp->context);
341 vl_api_sw_interface_add_del_address_reply_t *rmp;
372 REPLY_MACRO (VL_API_SW_INTERFACE_ADD_DEL_ADDRESS_REPLY);
390 vl_api_sw_interface_set_table_reply_t *rmp;
413 u32 sw_if_index,
u32 table_id,
u8 is_api)
416 u32 fib_index, mfib_index;
437 if (~0 == fib_index || ~0 == mfib_index)
439 return (VNET_API_ERROR_NO_SUCH_FIB);
455 return (VNET_API_ERROR_ADDRESS_FOUND_FOR_INTERFACE);
506 return (VNET_API_ERROR_ADDRESS_FOUND_FOR_INTERFACE);
559 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_GET_TABLE_REPLY);
561 mp->
retval = htonl (retval);
562 mp->
vrf_id = htonl (vrf_id);
572 u32 sw_if_index = ~0;
604 vl_api_sw_interface_set_unnumbered_reply_t *rmp;
617 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
624 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX_2;
631 REPLY_MACRO (VL_API_SW_INTERFACE_SET_UNNUMBERED_REPLY);
638 vl_api_sw_interface_clear_stats_reply_t *rmp;
645 int i, j, n_counters;
664 for (j = 0; j < n_counters; j++)
666 for (i = 0; i <
vec_len (my_vnet_mains); i++)
679 for (j = 0; j < n_counters; j++)
681 for (i = 0; i <
vec_len (my_vnet_mains); i++)
694 REPLY_MACRO (VL_API_SW_INTERFACE_CLEAR_STATS_REPLY);
720 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_EVENT);
735 uword *event_by_sw_if_index = 0;
740 uword *event_data = 0;
752 for (i = 0; i <
vec_len (event_data); i++)
754 sw_if_index = event_data[
i];
761 for (i = 0; i <
vec_len (event_by_sw_if_index); i++)
763 if (event_by_sw_if_index[i] == 0)
769 vl_reg = vl_api_client_index_to_registration (reg->client_index);
771 send_sw_interface_event (vam, reg, vl_reg, i, event_by_sw_if_index[i]);
784 u32 hw_if_index,
u32 flags);
793 .name =
"vpe-link-state-process",
812 link_state_process_node.index, event,
833 link_state_process_node.index, event,
849 link_state_process_node.index, event,
859 vl_api_sw_interface_tag_add_del_reply_t *rmp;
870 rv = VNET_API_ERROR_INVALID_VALUE;
883 REPLY_MACRO (VL_API_SW_INTERFACE_TAG_ADD_DEL_REPLY);
889 vl_api_sw_interface_set_mac_address_reply_t *rmp;
903 rv = VNET_API_ERROR_UNIMPLEMENTED;
910 REPLY_MACRO (VL_API_SW_INTERFACE_SET_MAC_ADDRESS_REPLY);
936 rmp->_vl_msg_id = htons (VL_API_SW_INTERFACE_GET_MAC_ADDRESS_REPLY);
947 vl_api_sw_interface_set_rx_mode_reply_t *rmp;
959 rv = VNET_API_ERROR_INVALID_VALUE;
960 goto bad_sw_if_index;
968 rv = VNET_API_ERROR_UNIMPLEMENTED;
975 REPLY_MACRO (VL_API_SW_INTERFACE_SET_RX_MODE_REPLY);
981 u32 sw_if_index,
u32 worker_id,
988 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_RX_PLACEMENT_DETAILS);
1010 if (sw_if_index == ~0)
1015 (
u8 *)
"device-input");
1023 rt = vlib_node_get_runtime_data (this_vlib_main, si);
1024 vec_foreach (dq, rt->devices_and_queues)
1026 vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm,
1028 send_interface_rx_placement_details (am, reg, hw->sw_if_index, index,
1029 dq->queue_id, dq->mode, mp->context);
1043 clib_warning (
"sw_if_index %u does not exist", sw_if_index);
1044 goto bad_sw_if_index;
1050 clib_warning (
"interface type is not HARDWARE! P2P, PIPE and SUB" 1051 " interfaces are not supported");
1052 goto bad_sw_if_index;
1073 vl_api_sw_interface_set_rx_placement_reply_t *rmp;
1085 rv = VNET_API_ERROR_INVALID_VALUE;
1086 goto bad_sw_if_index;
1094 rv = VNET_API_ERROR_UNIMPLEMENTED;
1101 REPLY_MACRO (VL_API_SW_INTERFACE_SET_RX_PLACEMENT_REPLY);
1109 u32 sw_if_index = (
u32) ~ 0;
1116 u64 sup_and_sub_key;
1126 rv = VNET_API_ERROR_BOND_SLAVE_NOT_ALLOWED;
1131 if (
id == 0 ||
id > 4095)
1133 rv = VNET_API_ERROR_INVALID_VLAN;
1142 rv = VNET_API_ERROR_VLAN_ALREADY_EXISTS;
1150 template.sub.id =
id;
1151 template.sub.eth.raw_flags = 0;
1152 template.sub.eth.flags.one_tag = 1;
1153 template.sub.eth.outer_vlan_id =
id;
1154 template.sub.eth.flags.exact_match = 1;
1160 rv = VNET_API_ERROR_INVALID_REGISTRATION;
1165 *kp = sup_and_sub_key;
1178 rmp->_vl_msg_id = htons (VL_API_CREATE_VLAN_SUBIF_REPLY);
1180 rmp->
retval = htonl (rv);
1190 u32 sw_if_index = ~0;
1198 u64 sup_and_sub_key;
1208 rv = VNET_API_ERROR_BOND_SLAVE_NOT_ALLOWED;
1213 sub_id = ntohl (mp->
sub_id);
1215 sup_and_sub_key = ((
u64) (sw_if_index) << 32) | (
u64) sub_id;
1221 clib_warning (
"sup sw_if_index %d, sub id %d already exists\n",
1222 sw_if_index, sub_id);
1223 rv = VNET_API_ERROR_SUBIF_ALREADY_EXISTS;
1231 template.sub.id = sub_id;
1232 template.sub.eth.flags.no_tags = mp->
no_tags;
1233 template.sub.eth.flags.one_tag = mp->
one_tag;
1234 template.sub.eth.flags.two_tags = mp->
two_tags;
1235 template.sub.eth.flags.dot1ad = mp->
dot1ad;
1236 template.sub.eth.flags.exact_match = mp->
exact_match;
1237 template.sub.eth.flags.default_sub = mp->
default_sub;
1247 rv = VNET_API_ERROR_SUBIF_CREATE_FAILED;
1252 *kp = sup_and_sub_key;
1272 vl_api_delete_subif_reply_t *rmp;
1284 vl_api_interface_name_renumber_reply_t *rmp;
1294 REPLY_MACRO (VL_API_INTERFACE_NAME_RENUMBER_REPLY);
1324 is_specified, user_instance);
1337 vl_api_delete_loopback_reply_t *rmp;
1351 vl_api_collect_detailed_interface_stats_reply_t *rmp;
1358 REPLY_MACRO (VL_API_COLLECT_DETAILED_INTERFACE_STATS_REPLY);
1368 #define vl_msg_name_crc_list 1369 #include <vnet/interface.api.h> 1370 #undef vl_msg_name_crc_list 1375 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1376 foreach_vl_msg_name_crc_interface;
1388 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1389 vl_api_##n##_t_handler, \ 1391 vl_api_##n##_t_endian, \ 1392 vl_api_##n##_t_print, \ 1393 sizeof(vl_api_##n##_t), 1); 1398 am->
is_mp_safe[VL_API_SW_INTERFACE_DUMP] = 1;
1399 am->
is_mp_safe[VL_API_SW_INTERFACE_DETAILS] = 1;
1400 am->
is_mp_safe[VL_API_SW_INTERFACE_TAG_ADD_DEL] = 1;
static void vl_api_delete_subif_t_handler(vl_api_delete_subif_t *mp)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
u32 mfib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, mfib_source_t src)
Get the index of the FIB for a Table-ID.
#define hash_set(h, key, value)
ip4_table_bind_function_t * function
Enable or disable detailed interface stats.
clib_error_t * set_hw_interface_rx_placement(u32 hw_if_index, u32 queue_id, u32 thread_index, u8 is_main)
void vnet_sw_interface_ip_directed_broadcast(vnet_main_t *vnm, u32 sw_if_index, u8 enable)
Get interface's MAC address.
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
vnet_main_t * vnet_get_main(void)
static void vl_api_interface_name_renumber_t_handler(vl_api_interface_name_renumber_t *mp)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
void stats_dsunlock(void)
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(link_up_down_function)
ethernet_main_t * ethernet_get_main(vlib_main_t *vm)
static clib_error_t * sw_interface_add_del_function(vnet_main_t *vm, u32 sw_if_index, u32 flags)
Set flags on the interface.
vnet_interface_main_t interface_main
static void vl_api_sw_interface_add_del_address_t_handler(vl_api_sw_interface_add_del_address_t *mp)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Set an interface's rx-placement Rx-Queue placement on specific thread is operational for only hardwar...
u32 * input_node_thread_index_by_queue
vnet_main_t ** vnet_mains
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static void vl_api_delete_loopback_t_handler(vl_api_delete_loopback_t *mp)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
static void send_sw_interface_event(vpe_api_main_t *am, vpe_client_registration_t *reg, vl_api_registration_t *vl_reg, u32 sw_if_index, enum api_events events)
VLIB_API_INIT_FUNCTION(interface_api_hookup)
#define hash_set_mem(h, key, value)
ip_lookup_main_t lookup_main
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
uword * sub_interface_sw_if_index_by_id
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
Set IP4 directed broadcast The directed broadcast enabled a packet sent to the interface's subnet add...
static void vl_api_sw_interface_set_unnumbered_t_handler(vl_api_sw_interface_set_unnumbered_t *mp)
static void vl_api_sw_interface_set_rx_placement_t_handler(vl_api_sw_interface_set_rx_placement_t *mp)
vpe_api_main_t vpe_api_main
uword * dq_runtime_index_by_queue
void * vl_msg_api_alloc(int nbytes)
static void vl_api_sw_interface_dump_t_handler(vl_api_sw_interface_dump_t *mp)
trace_cfg_t * api_trace_cfg
Current trace configuration.
static void send_interface_rx_placement_details(vpe_api_main_t *am, vl_api_registration_t *rp, u32 sw_if_index, u32 worker_id, u32 queue_id, u8 mode, u32 context)
#define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK
static clib_error_t * interface_api_hookup(vlib_main_t *vm)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static uword link_state_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
#define clib_memcpy(d, s, n)
int ip_table_bind(fib_protocol_t fproto, u32 sw_if_index, u32 table_id, u8 is_api)
enum mfib_source_t_ mfib_source_t
Possible [control plane] sources of MFIB entries.
ethernet_main_t ethernet_main
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
Set an interface's rx-mode.
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
Clear interface statistics.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
vlib_combined_counter_main_t * combined_sw_if_counters
Reply for the vlan subinterface create request.
vnet_hw_interface_flags_t flags
static void vl_api_sw_interface_rx_placement_dump_t_handler(vl_api_sw_interface_rx_placement_dump_t *mp)
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static void vl_api_hw_interface_set_mtu_t_handler(vl_api_hw_interface_set_mtu_t *mp)
Get VRF id assigned to interface.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
A collection of simple counters.
void vnet_sw_interface_set_protocol_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu[])
u32 max_supported_packet_bytes
struct vnet_sub_interface_t::@208::@209::@211 flags
clib_error_t * ip4_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 is_del)
vnet_api_error_t api_errno
static clib_error_t * link_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
#define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
static void vl_api_sw_interface_get_table_t_handler(vl_api_sw_interface_get_table_t *mp)
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
enum fib_source_t_ fib_source_t
The different sources that can create a route.
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
static void send_sw_interface_get_table_reply(vl_api_registration_t *reg, u32 context, int retval, u32 vrf_id)
u32 new_show_dev_instance
int replay_enable
This message can be replayed.
uword * sw_if_index_by_sup_and_sub
static void vl_api_sw_interface_set_mac_address_t_handler(vl_api_sw_interface_set_mac_address_t *mp)
ip6_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
Reply to get_sw_interface_vrf.
vnet_sw_interface_flags_t flags
clib_error_t * set_hw_interface_change_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u8 queue_id_valid, u32 queue_id, vnet_hw_interface_rx_mode mode)
static void vl_api_create_loopback_t_handler(vl_api_create_loopback_t *mp)
Create loopback interface instance response.
vlib_simple_counter_main_t * sw_if_counters
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
void vnet_sw_interface_update_unnumbered(u32 unnumbered_sw_if_index, u32 ip_sw_if_index, u8 enable)
void ip_del_all_interface_addresses(vlib_main_t *vm, u32 sw_if_index)
#define foreach_vlib_main(body)
Set or delete one or all ip addresses on a specified interface.
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
vnet_hw_interface_class_t ethernet_hw_interface_class
API main structure, used by both vpp and binary API clients.
static void setup_message_id_table(api_main_t *am)
int vnet_create_loopback_interface(u32 *sw_if_indexp, u8 *mac_address, u8 is_specified, u32 user_instance)
An API client registration, only in vpp/vlib.
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
#define BAD_SW_IF_INDEX_LABEL
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
#define VLIB_REGISTER_NODE(x,...)
static void vl_api_sw_interface_set_flags_t_handler(vl_api_sw_interface_set_flags_t *mp)
u32 ft_table_id
Table ID (hash key) for this FIB.
struct vnet_sub_interface_t::@208 eth
void stats_dslock_with_hint(int hint, int tag)
show the interface's queue - thread placement This api is used to display the interface and queue wor...
int vnet_delete_sub_interface(u32 sw_if_index)
#define vec_free(V)
Free vector's memory (no header).
int vnet_delete_loopback_interface(u32 sw_if_index)
static clib_error_t * admin_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
#define clib_warning(format, args...)
Request all or filtered subset of sw_interface_details.
static void vl_api_create_loopback_instance_t_handler(vl_api_create_loopback_instance_t *mp)
Delete sub interface request.
static void send_sw_interface_details(vpe_api_main_t *am, vl_api_registration_t *rp, vnet_sw_interface_t *swif, u8 *interface_name, u32 context)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define foreach_vpe_api_msg
Delete loopback interface request.
vl_api_vxlan_gbp_api_tunnel_mode_t mode
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(admin_up_down_function)
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
foreach_registration_hash u8 link_state_process_up
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(sw_interface_add_del_function)
Reply for get interface's MAC address request.
ip_lookup_main_t lookup_main
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t src)
Get the index of the FIB for a Table-ID.
static void vl_api_sw_interface_tag_add_del_t_handler(vl_api_sw_interface_tag_add_del_t *mp)
#define clib_error_report(e)
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
static u8 * vnet_get_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
From the control plane API.
static void vl_api_sw_interface_clear_stats_t_handler(vl_api_sw_interface_clear_stats_t *mp)
static void * clib_mem_alloc(uword size)
static vlib_main_t * vlib_get_main(void)
Interface Event generated by want_interface_events.
static void vl_api_sw_interface_set_mtu_t_handler(vl_api_sw_interface_set_mtu_t *mp)
ip4_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
static uword vnet_sw_interface_is_api_valid(vnet_main_t *vnm, u32 sw_if_index)
static void vl_api_sw_interface_set_rx_mode_t_handler(vl_api_sw_interface_set_rx_mode_t *mp)
void vnet_hw_interface_set_mtu(vnet_main_t *vnm, u32 hw_if_index, u32 mtu)
static void vl_api_create_subif_t_handler(vl_api_create_subif_t *mp)
Create loopback interface instance request.
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Set interface physical MTU.
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vnet_sw_interface_t * sw_interfaces
Create loopback interface request.
ip6_table_bind_function_t * function
Set unnumbered interface add / del request.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
A collection of combined counters.
Create a new subinterface with the given vlan id.
int vnet_sw_interface_stats_collect_enable_disable(u32 sw_if_index, u8 enable)
Create loopback interface response.
#define hash_get_mem(h, key)
static void vl_api_sw_interface_set_ip_directed_broadcast_t_handler(vl_api_sw_interface_set_ip_directed_broadcast_t *mp)
dump the rx queue placement of interface(s)
u32 l2vtr_get(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u32 *push_dot1q, u32 *vtr_tag1, u32 *vtr_tag2)
Get vtag tag rewrite on the given interface.
Set an interface's MAC address.
u8 * is_mp_safe
Message is mp safe vector.
void vlib_clear_simple_counters(vlib_simple_counter_main_t *cm)
Clear a collection of simple counters.
vnet_sw_interface_type_t type
ip4_main_t ip4_main
Global ip4 main structure.
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
pub_sub_handler(interface_events, INTERFACE_EVENTS)
#define vec_foreach(var, vec)
Vector iterator.
static void vl_api_create_vlan_subif_t_handler(vl_api_create_vlan_subif_t *mp)
static void vl_api_collect_detailed_interface_stats_t_handler(vl_api_collect_detailed_interface_stats_t *mp)
clib_error_t * ip6_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 is_del)
clib_error_t * vnet_hw_interface_change_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address)
clib_error_t * vnet_create_sw_interface(vnet_main_t *vnm, vnet_sw_interface_t *template, u32 *sw_if_index)
Interface details structure (fix this)
static void vl_api_sw_interface_set_table_t_handler(vl_api_sw_interface_set_table_t *mp)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
Set / clear software interface tag.
ethernet_interface_t * interfaces
Associate the specified interface with a fib table.
static void vl_api_sw_interface_get_mac_address_t_handler(vl_api_sw_interface_get_mac_address_t *mp)
u32 * fib_index_by_sw_if_index
u32 l2pbb_get(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u16 *outer_tag, ethernet_header_t *eth_hdr, u16 *b_vlanid, u32 *i_sid)
Get pbb tag rewrite on the given interface.
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
u32 unnumbered_sw_if_index