Merge pull request #17478 from yuwata/split-network-internal

libsystemd-network: split network-internal.c
This commit is contained in:
Yu Watanabe
2020-11-27 09:04:19 +09:00
committed by GitHub
35 changed files with 869 additions and 851 deletions
+41 -1
View File
@@ -4,7 +4,6 @@
#include "bridge.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h"
#include "string-table.h"
#include "vlan-util.h"
@@ -342,6 +341,47 @@ int config_parse_bridge_igmp_version(
return 0;
}
int config_parse_bridge_port_priority(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
uint16_t i;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
/* This is used in networkd-network-gperf.gperf. */
r = safe_atou16(rvalue, &i);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to parse bridge port priority, ignoring: %s", rvalue);
return 0;
}
if (i > LINK_BRIDGE_PORT_PRIORITY_MAX) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Bridge port priority is larger than maximum %u, ignoring: %s",
LINK_BRIDGE_PORT_PRIORITY_MAX, rvalue);
return 0;
}
*((uint16_t *)data) = i;
return 0;
}
static void bridge_init(NetDev *n) {
Bridge *b;
+4
View File
@@ -7,6 +7,9 @@
#include "conf-parser.h"
#include "netdev.h"
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
typedef struct Bridge {
NetDev meta;
@@ -45,3 +48,4 @@ MulticastRouter multicast_router_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router);
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version);
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
-1
View File
@@ -12,7 +12,6 @@
#include "macsec.h"
#include "memory-util.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h"
#include "path-util.h"
#include "socket-util.h"
+5 -5
View File
@@ -7,23 +7,23 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#include "bond.h"
#include "bridge.h"
#include "conf-parser.h"
#include "fou-tunnel.h"
#include "geneve.h"
#include "ipvlan.h"
#include "l2tp-tunnel.h"
#include "macsec.h"
#include "macvlan.h"
#include "net-condition.h"
#include "netdev.h"
#include "tunnel.h"
#include "tuntap.h"
#include "veth.h"
#include "vlan-util.h"
#include "vlan.h"
#include "vxlan.h"
#include "vrf.h"
#include "netdev.h"
#include "network-internal.h"
#include "vxcan.h"
#include "vxlan.h"
#include "wireguard.h"
#include "fou-tunnel.h"
#include "l2tp-tunnel.h"
#include "xfrm.h"
%}
struct ConfigPerfItem;
-1
View File
@@ -23,7 +23,6 @@
#include "netdev.h"
#include "netdevsim.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h"
#include "nlmon.h"
#include "path-lookup.h"