]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: expose bridge_vlan_append_info()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 May 2021 08:11:54 +0000 (17:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Jun 2021 21:34:38 +0000 (06:34 +0900)
src/network/networkd-bridge-vlan.c
src/network/networkd-bridge-vlan.h

index c4c25eaff4d1322644a5a9708069fd2a52238519..8f39d35c783fc4eb6b9a176f92cc914000eb4eb1 100644 (file)
@@ -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");
 
index 22f886f1b46fbe3945342d9b9c1c725b1600ac98..3ee87729d16c796af88d97b6a132ba2ef90a20b2 100644 (file)
@@ -5,6 +5,10 @@
   Copyright © 2016 BISDN GmbH. All rights reserved.
 ***/
 
+#include <inttypes.h>
+
+#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);