From 5106ad00e69e121f98ef6fc96ee16ef3e2586b5d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 25 May 2021 17:11:54 +0900 Subject: [PATCH] network: expose bridge_vlan_append_info() --- src/network/networkd-bridge-vlan.c | 10 ++++++++-- src/network/networkd-bridge-vlan.h | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c index c4c25eaff4d..8f39d35c783 100644 --- a/src/network/networkd-bridge-vlan.c +++ b/src/network/networkd-bridge-vlan.c @@ -42,7 +42,13 @@ static int find_next_bit(int i, uint32_t x) { return j ? j + i : 0; } -static int append_vlan_info_data(Link *const link, sd_netlink_message *req, uint16_t pvid, const uint32_t *br_vid_bitmap, const uint32_t *br_untagged_bitmap) { +int bridge_vlan_append_info( + const Link *link, + sd_netlink_message *req, + uint16_t pvid, + const uint32_t *br_vid_bitmap, + const uint32_t *br_untagged_bitmap) { + struct bridge_vlan_info br_vlan; bool done, untagged = false; uint16_t begin, end; @@ -183,7 +189,7 @@ int link_set_bridge_vlan(Link *link) { } /* add vlan info */ - r = append_vlan_info_data(link, req, link->network->pvid, link->network->br_vid_bitmap, link->network->br_untagged_bitmap); + r = bridge_vlan_append_info(link, req, link->network->pvid, link->network->br_vid_bitmap, link->network->br_untagged_bitmap); if (r < 0) return log_link_error_errno(link, r, "Could not append VLANs: %m"); diff --git a/src/network/networkd-bridge-vlan.h b/src/network/networkd-bridge-vlan.h index 22f886f1b46..3ee87729d16 100644 --- a/src/network/networkd-bridge-vlan.h +++ b/src/network/networkd-bridge-vlan.h @@ -5,6 +5,10 @@ Copyright © 2016 BISDN GmbH. All rights reserved. ***/ +#include + +#include "sd-netlink.h" + #include "conf-parser.h" #define BRIDGE_VLAN_BITMAP_MAX 4096 @@ -15,6 +19,13 @@ typedef struct Network Network; void network_adjust_bridge_vlan(Network *network); +int bridge_vlan_append_info( + const Link * link, + sd_netlink_message *req, + uint16_t pvid, + const uint32_t *br_vid_bitmap, + const uint32_t *br_untagged_bitmap); + int link_set_bridge_vlan(Link *link); CONFIG_PARSER_PROTOTYPE(config_parse_brvlan_pvid); -- 2.47.3