iface->linkspeed = ifs->linkspeed;
iface->capability = ifs->capability;
iface->if_index = ifs->if_index;
+ iface->options = ifs->options;
DLIST_ADD(local_interfaces, iface);
}
-static void parse_extra_info(char *key, uint64_t *speed, uint32_t *cap,
- uint32_t *if_index)
+static void parse_extra_info(char *key,
+ uint64_t *speed,
+ uint32_t *cap,
+ uint32_t *if_index,
+ uint32_t *options)
{
while (key != NULL && *key != '\0') {
char *next_key;
if (error != 0) {
DBG_DEBUG("Invalid key value (%s)\n", val);
}
+ } else if (strequal_m(key, "options")) {
+ if (strequal_m(val, "dynamic")) {
+ *options |= IFACE_DYNAMIC_OPTION;
+ } else if (strequal_m(val, "nodynamic")) {
+ *options &= ~IFACE_DYNAMIC_OPTION;
+ } else {
+ DBG_WARNING("Options unknown: "
+ "'%s'\n", val);
+ }
} else {
DBG_DEBUG("Key unknown: '%s'\n", key);
}
bool speed_set = false;
bool cap_set = false;
bool if_index_set = false;
+ uint32_t options = IFACE_NONE_OPTION;
+ bool options_set = false;
/*
* extract speed / capability information if present
p = strchr_m(token, ';');
if (p != NULL) {
*p++ = 0;
- parse_extra_info(p, &speed, &cap, &if_index);
+ parse_extra_info(p, &speed, &cap, &if_index, &options);
if (speed != 0) {
speed_set = true;
}
if (if_index != 0) {
if_index_set = true;
}
+ if (options != IFACE_NONE_OPTION) {
+ options_set = true;
+ }
}
/* first check if it is an interface name */
if (if_index_set) {
probed_ifaces[i].if_index = if_index;
}
+ if (options_set) {
+ probed_ifaces[i].options = options;
+ }
add_interface(&probed_ifaces[i]);
added = true;
}
if (if_index_set) {
probed_ifaces[i].if_index = if_index;
}
+ if (options_set) {
+ probed_ifaces[i].options = options;
+ }
add_interface(&probed_ifaces[i]);
return;
}
if (if_index_set) {
probed_ifaces[i].if_index = if_index;
}
+ if (options_set) {
+ probed_ifaces[i].options = options;
+ }
add_interface(&probed_ifaces[i]);
probed_ifaces[i].netmask = saved_mask;
return;
ifs.linkspeed = 1000 * 1000 * 1000;
}
ifs.capability = cap;
+ ifs.options = options;
add_interface(&ifs);
}