| 1774 | } |
| 1775 | |
| 1776 | static ipfw_insn * |
| 1777 | print_opcode(struct buf_pr *bp, struct format_opts *fo, |
| 1778 | struct show_state *state, int opcode) |
| 1779 | { |
| 1780 | ipfw_insn *cmd; |
| 1781 | int l; |
| 1782 | |
| 1783 | for (l = state->rule->act_ofs, cmd = state->rule->cmd; |
| 1784 | l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { |
| 1785 | /* We use zero opcode to print the rest of options */ |
| 1786 | if (opcode >= 0 && cmd->opcode != opcode) |
| 1787 | continue; |
| 1788 | /* |
| 1789 | * Skip O_NOP, when we printing the rest |
| 1790 | * of options, it will be handled separately. |
| 1791 | */ |
| 1792 | if (cmd->opcode == O_NOP && opcode != O_NOP) |
| 1793 | continue; |
| 1794 | if (!print_instruction(bp, fo, state, cmd)) |
| 1795 | continue; |
| 1796 | return (cmd); |
| 1797 | } |
| 1798 | return (NULL); |
| 1799 | } |
| 1800 | |
| 1801 | static void |
| 1802 | print_fwd(struct buf_pr *bp, const ipfw_insn *cmd) |
no test coverage detected