diff options
Diffstat (limited to 'src/vnet/l2/l2_api.c')
-rw-r--r-- | src/vnet/l2/l2_api.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c index c555a17d5ea..cb22547f940 100644 --- a/src/vnet/l2/l2_api.c +++ b/src/vnet/l2/l2_api.c @@ -3,6 +3,7 @@ * l2_api.c - layer 2 forwarding api * * Copyright (c) 2016 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: @@ -511,6 +512,37 @@ vl_api_bridge_domain_add_del_t_handler (vl_api_bridge_domain_add_del_t * mp) } static void +vl_api_bridge_domain_add_del_v2_t_handler ( + vl_api_bridge_domain_add_del_v2_t *mp) +{ + vl_api_bridge_domain_add_del_v2_reply_t *rmp; + u32 bd_id = ntohl (mp->bd_id); + int rv = 0; + + if ((~0 == bd_id) && (mp->is_add)) + bd_id = bd_get_unused_id (); + + if ((~0 == bd_id) && (mp->is_add)) + rv = VNET_API_ERROR_EAGAIN; + else + { + l2_bridge_domain_add_del_args_t a = { .is_add = mp->is_add, + .flood = mp->flood, + .uu_flood = mp->uu_flood, + .forward = mp->forward, + .learn = mp->learn, + .arp_term = mp->arp_term, + .arp_ufwd = mp->arp_ufwd, + .mac_age = mp->mac_age, + .bd_id = bd_id, + .bd_tag = mp->bd_tag }; + rv = bd_add_del (&a); + } + REPLY_MACRO2 (VL_API_BRIDGE_DOMAIN_ADD_DEL_V2_REPLY, + ({ rmp->bd_id = htonl (bd_id); })); +} + +static void send_bridge_domain_details (l2input_main_t * l2im, vl_api_registration_t * reg, l2_bridge_domain_t * bd_config, |