- sprintf(buf, "0x%x", s->flags[1]);
- ptr.o = NULL;
- ptr.option = "__flags_v6";
- ptr.value = buf;
- uci_set(ctx, &ptr);
+ list_for_each_entry(type, &s->datatypes, list)
+ {
+ sprintf(buf, "%s_%s", type->dir, fw3_ipset_type_names[type->type]);
+ ptr.o = NULL;
+ ptr.option = "match";
+ ptr.value = buf;
+ uci_add_list(ctx, &ptr);
+ }
+
+ if (s->iprange.set)
+ {
+ ptr.o = NULL;
+ ptr.option = "iprange";
+ ptr.value = fw3_address_to_string(&s->iprange, false);
+ uci_set(ctx, &ptr);
+ }
+
+ if (s->portrange.set)
+ {
+ sprintf(buf, "%u-%u", s->portrange.port_min, s->portrange.port_max);
+ ptr.o = NULL;
+ ptr.option = "portrange";
+ ptr.value = buf;
+ uci_set(ctx, &ptr);
+ }