diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-08-16 12:41:34 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-08-16 12:54:09 +0900 |
commit | 634815762d837e25ed4640cb8a12fa742a13d9ac (patch) | |
tree | 50f67f1b0ba72de47b13cd041d37d15fdc5b6300 /src/network/netdev | |
parent | d64441b669932ab97fbbfc71cb143045f690039e (diff) | |
download | systemd-634815762d837e25ed4640cb8a12fa742a13d9ac.tar.gz |
network: rebreak conf parser arguments
Diffstat (limited to 'src/network/netdev')
-rw-r--r-- | src/network/netdev/geneve.c | 88 | ||||
-rw-r--r-- | src/network/netdev/tunnel.c | 117 | ||||
-rw-r--r-- | src/network/netdev/vxlan.c | 88 |
3 files changed, 159 insertions, 134 deletions
diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c index b0baa53edc..1bffbc9586 100644 --- a/src/network/netdev/geneve.c +++ b/src/network/netdev/geneve.c @@ -164,16 +164,18 @@ static int netdev_geneve_create(NetDev *netdev) { return r; } -int config_parse_geneve_vni(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) { +int config_parse_geneve_vni( + 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) { + Geneve *v = userdata; uint32_t f; int r; @@ -199,16 +201,18 @@ int config_parse_geneve_vni(const char *unit, return 0; } -int config_parse_geneve_address(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) { +int config_parse_geneve_address( + 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) { + Geneve *v = userdata; union in_addr_union *addr = data, buffer; int r, f; @@ -236,16 +240,18 @@ int config_parse_geneve_address(const char *unit, return 0; } -int config_parse_geneve_flow_label(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) { +int config_parse_geneve_flow_label( + 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) { + Geneve *v = userdata; uint32_t f; int r; @@ -272,16 +278,18 @@ int config_parse_geneve_flow_label(const char *unit, return 0; } -int config_parse_geneve_ttl(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) { +int config_parse_geneve_ttl( + 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) { + Geneve *v = userdata; unsigned f; int r; diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c index f27a1e4335..cae2ef1a90 100644 --- a/src/network/netdev/tunnel.c +++ b/src/network/netdev/tunnel.c @@ -501,16 +501,18 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { return 0; } -int config_parse_tunnel_address(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) { +int config_parse_tunnel_address( + 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) { + Tunnel *t = userdata; union in_addr_union *addr = data, buffer; int r, f; @@ -555,16 +557,18 @@ int config_parse_tunnel_address(const char *unit, return 0; } -int config_parse_tunnel_key(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) { +int config_parse_tunnel_key( + 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) { + union in_addr_union buffer; Tunnel *t = userdata; uint32_t k; @@ -596,16 +600,18 @@ int config_parse_tunnel_key(const char *unit, return 0; } -int config_parse_ipv6_flowlabel(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) { +int config_parse_ipv6_flowlabel( + 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) { + IPv6FlowLabel *ipv6_flowlabel = data; Tunnel *t = userdata; int k = 0; @@ -635,16 +641,18 @@ int config_parse_ipv6_flowlabel(const char* unit, return 0; } -int config_parse_encap_limit(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) { +int config_parse_encap_limit( + 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) { + Tunnel *t = userdata; int k = 0; int r; @@ -673,26 +681,27 @@ int config_parse_encap_limit(const char* unit, return 0; } -int config_parse_6rd_prefix(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) { +int config_parse_6rd_prefix( + 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) { + Tunnel *t = userdata; + union in_addr_union p; + uint8_t l; + int r; assert(filename); assert(lvalue); assert(rvalue); - union in_addr_union p; - uint8_t l; - int r; - r = in_addr_prefix_from_string(rvalue, AF_INET6, &p, &l); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse 6rd prefix \"%s\", ignoring: %m", rvalue); diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c index 52d8b3736c..6829017f80 100644 --- a/src/network/netdev/vxlan.c +++ b/src/network/netdev/vxlan.c @@ -174,16 +174,18 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli return r; } -int config_parse_vxlan_address(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) { +int config_parse_vxlan_address( + 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) { + VxLan *v = userdata; union in_addr_union *addr = data, buffer; int r, f; @@ -225,16 +227,18 @@ int config_parse_vxlan_address(const char *unit, return 0; } -int config_parse_port_range(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) { +int config_parse_port_range( + 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) { + VxLan *v = userdata; uint16_t low, high; int r; @@ -257,16 +261,18 @@ int config_parse_port_range(const char *unit, return 0; } -int config_parse_flow_label(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) { +int config_parse_flow_label( + 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) { + VxLan *v = userdata; unsigned f; int r; @@ -293,16 +299,18 @@ int config_parse_flow_label(const char *unit, return 0; } -int config_parse_vxlan_ttl(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) { +int config_parse_vxlan_ttl( + 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) { + VxLan *v = userdata; unsigned f; int r; |