method *method;
} address_family;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
typedef struct mapping_defn {
struct mapping_defn *next;
int n_mappings;
char **mapping;
} mapping_defn;
-#endif
typedef struct variable {
char *name;
char **autointerfaces;
interface_defn *ifaces;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
mapping_defn *mappings;
-#endif
} interfaces_file;
#define MAX_OPT_DEPTH 10
{
interface_defn *currif = NULL;
interfaces_file *defn;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
mapping_defn *currmap = NULL;
-#endif
FILE *f;
char firstword[80];
char *buf = NULL;
defn = xmalloc(sizeof(interfaces_file));
defn->max_autointerfaces = defn->n_autointerfaces = 0;
defn->autointerfaces = NULL;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
defn->mappings = NULL;
-#endif
defn->ifaces = NULL;
f = fopen(filename, "r");
if (f == NULL) {
}
if (strcmp(firstword, "mapping") == 0) {
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
currmap = xmalloc(sizeof(mapping_defn));
currmap->max_matches = 0;
currmap->n_matches = 0;
currmap->next = NULL;
}
currently_processing = MAPPING;
-#endif
} else if (strcmp(firstword, "iface") == 0) {
{
char iface_name[80];
currif->n_options++;
break;
case MAPPING:
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
if (strcmp(firstword, "script") == 0) {
if (currmap->script != NULL) {
error_msg("%s:%d: duplicate script in mapping", filename, line);
error_msg("%s:%d: misplaced option", filename, line);
return NULL;
}
-#endif
break;
case NONE:
default:
return (1);
}
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
static int popen2(FILE **in, FILE **out, char *command, ...)
{
va_list ap;
return 1;
}
-#endif /* CONFIG_FEATURE_IFUPDOWN_MAPPING */
static int lookfor_iface(char **ifaces, int n_ifaces, char *iface)
char *statefile = "/etc/network/ifstate";
int do_all = 0;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
int run_mappings = 1;
-#endif
int force = 0;
int n_target_ifaces = 0;
int n_state = 0;
case 'n': /* no-act */
no_act = 1;
break;
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
case 'm': /* no-mappings */
run_mappings = 0;
break;
-#endif
case 'f': /* force */
force = 1;
break;
liface[79] = 0;
}
}
-#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
if ((cmds == iface_up) && run_mappings) {
mapping_defn *currmap;
}
}
}
-#endif
for (currif = defn->ifaces; currif; currif = currif->next) {
if (strcmp(liface, currif->iface) == 0) {