X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=ucimap-example.c;h=8e27bf8e9aebc6f63af3eb8c08b5fd503b8c1ba5;hb=3fa4e980d9dd281ad556069e09d17ba64ef4156d;hp=d401624df9695abb853e1cb22093dd9513c66842;hpb=062323b4f663d3c0a33c49d2c0ded624e4fb4693;p=uci.git diff --git a/ucimap-example.c b/ucimap-example.c index d401624..8e27bf8 100644 --- a/ucimap-example.c +++ b/ucimap-example.c @@ -20,6 +20,7 @@ struct list_head ifs; struct uci_network { + struct ucimap_section_data map; struct list_head list; struct list_head alias; @@ -33,6 +34,7 @@ struct uci_network { }; struct uci_alias { + struct ucimap_section_data map; struct list_head list; const char *name; @@ -43,7 +45,7 @@ static int network_parse_ip(void *section, struct uci_optmap *om, union ucimap_data *data, const char *str) { struct uci_network *net = section; - unsigned char *target = data->s; + unsigned char *target = (unsigned char *) data->s; unsigned int tmp[4]; int i; @@ -155,6 +157,7 @@ static struct my_optmap network_interface_options[] = { }; static struct uci_sectionmap network_interface = { + UCIMAP_SECTION(struct uci_network, map), .type = "interface", .alloc_len = sizeof(struct uci_network), .init = network_init_interface, @@ -173,9 +176,9 @@ static struct uci_optmap network_alias_options[] = { }; static struct uci_sectionmap network_alias = { + UCIMAP_SECTION(struct uci_alias, map), .type = "alias", .options = network_alias_options, - .alloc_len = sizeof(struct uci_network), .init = network_init_alias, .add = network_add_alias, .n_options = ARRAY_SIZE(network_alias_options),