summaryrefslogtreecommitdiff
path: root/src/network/networkd.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-11-19 16:54:42 +0100
committerTom Gundersen <teg@jklm.no>2013-11-25 19:35:44 +0100
commit6ae115c1fe95611b39d2f20cfcea3d385429f59e (patch)
tree98b548db167fa6afda6635310d944c6406d7226c /src/network/networkd.h
parent71a6151083d842b2f5bf04e50239f0bf85d34d2e (diff)
networkd: add support for [Address] sections
This will allow specifying more options per address than the simple Address= entry in the [Network] section. Preliminary support for the same functionality for [Route] sections are added, but not yet hooked up, as more testing is needed.
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r--src/network/networkd.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 11012f5558..04a56ea8c8 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -54,11 +54,15 @@ struct Network {
LIST_HEAD(Address, addresses);
LIST_HEAD(Route, routes);
+ Hashmap *addresses_by_section;
+ Hashmap *routes_by_section;
+
LIST_FIELDS(Network, networks);
};
struct Address {
Network *network;
+ uint64_t section;
unsigned char family;
unsigned char prefixlen;
@@ -76,14 +80,21 @@ struct Address {
struct Route {
Network *network;
+ uint64_t section;
unsigned char family;
+ unsigned char dst_prefixlen;
union {
struct in_addr in;
struct in6_addr in6;
} in_addr;
+ union {
+ struct in_addr in;
+ struct in6_addr in6;
+ } dst_addr;
+
LIST_FIELDS(Route, routes);
};
@@ -156,7 +167,7 @@ int network_apply(Manager *manager, Network *network, Link *link);
const struct ConfigPerfItem* network_gperf_lookup(const char *key, unsigned length);
/* Route */
-int route_new(Network *network, Route **ret);
+int route_new(Network *network, unsigned section, Route **ret);
void route_free(Route *route);
int route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
@@ -167,8 +178,12 @@ int config_parse_gateway(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_destination(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);
+
/* Address */
-int address_new(Network *network, Address **ret);
+int address_new(Network *network, unsigned section, Address **ret);
void address_free(Address *address);
int address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback);
@@ -179,6 +194,10 @@ int config_parse_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_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);
+
/* Link */
int link_new(Manager *manager, struct udev_device *device, Link **ret);