-}
-
-void
-fw3_format_mac(struct fw3_mac *mac)
-{
- if (!mac)
- return;
-
- fw3_pr(" -m mac %s--mac-source %s",
- mac->invert ? "! " : "", ether_ntoa(&mac->mac));
-}
-
-void
-fw3_format_protocol(struct fw3_protocol *proto, enum fw3_family family)
-{
- uint16_t pr;
-
- if (!proto)
- return;
-
- pr = proto->protocol;
-
- if (pr == 1 && family == FW3_FAMILY_V6)
- pr = 58;
-
- if (proto->any)
- fw3_pr(" -p all");
- else
- fw3_pr(" %s-p %u", proto->invert ? "! " : "", pr);
-}
-
-void
-fw3_format_icmptype(struct fw3_icmptype *icmp, enum fw3_family family)
-{
- if (!icmp)
- return;
-
- if (family != FW3_FAMILY_V6)
- {
- if (icmp->code_min == 0 && icmp->code_max == 0xFF)
- fw3_pr(" %s--icmp-type %u", icmp->invert ? "! " : "", icmp->type);
- else
- fw3_pr(" %s--icmp-type %u/%u",
- icmp->invert ? "! " : "", icmp->type, icmp->code_min);
- }
- else
- {
- if (icmp->code6_min == 0 && icmp->code6_max == 0xFF)
- fw3_pr(" %s--icmpv6-type %u", icmp->invert ? "! " : "", icmp->type6);
- else
- fw3_pr(" %s--icmpv6-type %u/%u",
- icmp->invert ? "! " : "", icmp->type6, icmp->code6_min);
- }
-}
-
-void
-fw3_format_limit(struct fw3_limit *limit)
-{
- if (!limit)
- return;
-
- if (limit->rate > 0)
- {
- fw3_pr(" -m limit %s--limit %u/%s",
- limit->invert ? "! " : "",
- limit->rate, limit_units[limit->unit]);
-
- if (limit->burst > 0)
- fw3_pr(" --limit-burst %u", limit->burst);
- }
-}
-
-void
-fw3_format_ipset(struct fw3_ipset *ipset, bool invert)
-{
- bool first = true;
- const char *name = NULL;
- struct fw3_ipset_datatype *type;
-
- if (!ipset)
- return;
-
- if (ipset->external && *ipset->external)
- name = ipset->external;