Lines Matching refs:iface
198 char *iface; member
282 return ifd->iface; in get_var()
285 return ifd->iface; in get_var()
507 if (!if_nametoindex(ifd->iface)) in static_down6()
605 if (!if_nametoindex(ifd->iface)) in static_down()
974 currif->iface = xstrdup(iface_name); in read_interfaces()
999 if ((strcmp(tmp->iface, currif->iface) == 0) in read_interfaces()
1002 bb_error_msg_and_die("duplicate interface \"%s\"", tmp->iface); in read_interfaces()
1008 debug_noise("iface %s %s %s\n", currif->iface, address_family_name, method_name); in read_interfaces()
1121 static void set_environ(struct interface_defn_t *iface, const char *mode, const char *opt) in set_environ() argument
1134 G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 7)); in set_environ()
1137 for (i = 0; i < iface->n_options; i++) { in set_environ()
1138 if (index_in_strings(keywords_up_down, iface->option[i].name) >= 0) { in set_environ()
1141 *pp++ = setlocalenv("IF_%s=%s", iface->option[i].name, iface->option[i].value); in set_environ()
1144 *pp++ = setlocalenv("%s=%s", "IFACE", iface->iface); in set_environ()
1145 *pp++ = setlocalenv("%s=%s", "ADDRFAM", iface->address_family->name); in set_environ()
1146 *pp++ = setlocalenv("%s=%s", "METHOD", iface->method->name); in set_environ()
1211 static int iface_up(struct interface_defn_t *iface) in iface_up() argument
1213 if (!iface->method->up(iface, check)) return -1; in iface_up()
1214 set_environ(iface, "start", "pre-up"); in iface_up()
1215 if (!execute_all(iface, "pre-up")) return 0; in iface_up()
1216 if (!iface->method->up(iface, doit)) return 0; in iface_up()
1217 set_environ(iface, "start", "post-up"); in iface_up()
1218 if (!execute_all(iface, "up")) return 0; in iface_up()
1222 static int iface_down(struct interface_defn_t *iface) in iface_down() argument
1224 if (!iface->method->down(iface, check)) return -1; in iface_down()
1225 set_environ(iface, "stop", "pre-down"); in iface_down()
1226 if (!execute_all(iface, "down")) return 0; in iface_down()
1227 if (!iface->method->down(iface, doit)) return 0; in iface_down()
1228 set_environ(iface, "stop", "post-down"); in iface_down()
1229 if (!execute_all(iface, "post-down")) return 0; in iface_down()
1307 static llist_t *find_iface_state(llist_t *state_list, const char *iface) in find_iface_state() argument
1312 char *after_iface = is_prefixed_with(search->data, iface); in find_iface_state()
1418 char *iface; in ifupdown_main() local
1425 iface = xstrdup(target_list->data); in ifupdown_main()
1428 pch = strchr(iface, '='); in ifupdown_main()
1433 liface = xstrdup(iface); in ifupdown_main()
1438 const llist_t *iface_state = find_iface_state(state_list, iface); in ifupdown_main()
1443 bb_error_msg("interface %s already configured", iface); in ifupdown_main()
1449 bb_error_msg("interface %s not configured", iface); in ifupdown_main()
1468 liface = run_mapping(iface, currmap); in ifupdown_main()
1478 if (strcmp(liface, currif->iface) == 0) { in ifupdown_main()
1479 char *oldiface = currif->iface; in ifupdown_main()
1482 currif->iface = iface; in ifupdown_main()
1496 currif->iface = oldiface; in ifupdown_main()
1512 llist_t *iface_state = find_iface_state(state_list, iface); in ifupdown_main()
1515 char *newiface = xasprintf("%s=%s", iface, liface); in ifupdown_main()
1541 free(iface); in ifupdown_main()