MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_opcode

Function print_opcode

tools/ipfw/ipfw2.c:1776–1799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774}
1775
1776static ipfw_insn *
1777print_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
1801static void
1802print_fwd(struct buf_pr *bp, const ipfw_insn *cmd)

Callers 2

print_protoFunction · 0.85
show_static_ruleFunction · 0.85

Calls 1

print_instructionFunction · 0.85

Tested by

no test coverage detected