| 3618 | } |
| 3619 | |
| 3620 | static ipfw_insn * |
| 3621 | add_proto(ipfw_insn *cmd, char *av, u_char *protop) |
| 3622 | { |
| 3623 | u_char proto = IPPROTO_IP; |
| 3624 | |
| 3625 | if (_substrcmp(av, "all") == 0 || strcmp(av, "ip") == 0) |
| 3626 | ; /* do not set O_IP4 nor O_IP6 */ |
| 3627 | else if (strcmp(av, "ip4") == 0) |
| 3628 | /* explicit "just IPv4" rule */ |
| 3629 | fill_cmd(cmd, O_IP4, 0, 0); |
| 3630 | else if (strcmp(av, "ip6") == 0) { |
| 3631 | /* explicit "just IPv6" rule */ |
| 3632 | proto = IPPROTO_IPV6; |
| 3633 | fill_cmd(cmd, O_IP6, 0, 0); |
| 3634 | } else |
| 3635 | return add_proto0(cmd, av, protop); |
| 3636 | |
| 3637 | *protop = proto; |
| 3638 | return cmd; |
| 3639 | } |
| 3640 | |
| 3641 | static ipfw_insn * |
| 3642 | add_proto_compat(ipfw_insn *cmd, char *av, u_char *protop) |
no test coverage detected