Lines Matching refs:cmd
92 print_ip6(struct buf_pr *bp, const ipfw_insn_ip6 *cmd) in print_ip6() argument
96 const struct in6_addr *a = &(cmd->addr6); in print_ip6()
99 len = F_LEN((const ipfw_insn *)cmd) - 1; in print_ip6()
100 if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { in print_ip6()
104 if (cmd->o.opcode == O_IP6) { in print_ip6()
117 mb = (cmd->o.opcode == O_IP6_SRC || in print_ip6()
118 cmd->o.opcode == O_IP6_DST) ? 128: in print_ip6()
150 fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) in fill_icmp6types() argument
155 memset(cmd, 0, sizeof(*cmd)); in fill_icmp6types()
170 cmd->d[type / 32] |= ( 1 << (type % 32)); in fill_icmp6types()
172 cmd->o.opcode = O_ICMP6TYPE; in fill_icmp6types()
173 cmd->o.len |= F_INSN_SIZE(ipfw_insn_icmp6); in fill_icmp6types()
177 print_icmp6types(struct buf_pr *bp, const ipfw_insn_u32 *cmd) in print_icmp6types() argument
185 if ( (cmd->d[i] & (1 << (j))) == 0) in print_icmp6types()
193 print_flow6id(struct buf_pr *bp, const ipfw_insn_u32 *cmd) in print_flow6id() argument
195 uint16_t i, limit = cmd->o.arg1; in print_flow6id()
202 bprintf(bp, "%d%c", cmd->d[i], sep); in print_flow6id()
221 fill_ext6hdr( ipfw_insn *cmd, char *av) in fill_ext6hdr() argument
226 cmd->arg1 = 0; in fill_ext6hdr()
232 cmd->arg1 |= EXT_FRAGMENT; in fill_ext6hdr()
235 cmd->arg1 |= EXT_HOPOPTS; in fill_ext6hdr()
238 cmd->arg1 |= EXT_ROUTING; in fill_ext6hdr()
241 cmd->arg1 |= EXT_DSTOPTS; in fill_ext6hdr()
244 cmd->arg1 |= EXT_AH; in fill_ext6hdr()
247 cmd->arg1 |= EXT_ESP; in fill_ext6hdr()
250 cmd->arg1 |= EXT_RTHDR0; in fill_ext6hdr()
253 cmd->arg1 |= EXT_RTHDR2; in fill_ext6hdr()
261 if (cmd->arg1 == 0) in fill_ext6hdr()
263 cmd->opcode = O_EXT_HDR; in fill_ext6hdr()
264 cmd->len |= F_INSN_SIZE(ipfw_insn); in fill_ext6hdr()
269 print_ext6hdr(struct buf_pr *bp, const ipfw_insn *cmd ) in print_ext6hdr() argument
274 if (cmd->arg1 & EXT_FRAGMENT) { in print_ext6hdr()
278 if (cmd->arg1 & EXT_HOPOPTS) { in print_ext6hdr()
282 if (cmd->arg1 & EXT_ROUTING) { in print_ext6hdr()
286 if (cmd->arg1 & EXT_RTHDR0) { in print_ext6hdr()
290 if (cmd->arg1 & EXT_RTHDR2) { in print_ext6hdr()
294 if (cmd->arg1 & EXT_DSTOPTS) { in print_ext6hdr()
298 if (cmd->arg1 & EXT_AH) { in print_ext6hdr()
302 if (cmd->arg1 & EXT_ESP) { in print_ext6hdr()
341 fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate) in fill_ip6() argument
344 struct in6_addr *d = &(cmd->addr6); in fill_ip6()
351 cmd->o.len &= ~F_LEN_MASK; /* zero len */ in fill_ip6()
358 cmd->o.len |= F_INSN_SIZE(ipfw_insn); in fill_ip6()
363 fill_table(&cmd->o, av, O_IP_DST_LOOKUP, tstate); in fill_ip6()
424 if (cmd->o.len & F_NOT && av == NULL && len == 0) in fill_ip6()
448 cmd->o.len |= len+1; in fill_ip6()
460 fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) in fill_flow6() argument
465 cmd->d[0] = 0; /* Initializing the base number*/ in fill_flow6()
477 cmd->d[nflow] |= type; in fill_flow6()
481 cmd->o.opcode = O_FLOW6ID; in fill_flow6()
482 cmd->o.len |= F_INSN_SIZE(ipfw_insn_u32) + nflow; in fill_flow6()
483 cmd->o.arg1 = nflow; in fill_flow6()
491 add_srcip6(ipfw_insn *cmd, char *av, int cblen, struct tidx *tstate) in add_srcip6() argument
494 fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen, tstate); in add_srcip6()
495 if (cmd->opcode == O_IP_DST_SET) /* set */ in add_srcip6()
496 cmd->opcode = O_IP_SRC_SET; in add_srcip6()
497 else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ in add_srcip6()
498 cmd->opcode = O_IP_SRC_LOOKUP; in add_srcip6()
499 else if (F_LEN(cmd) == 0) { /* any */ in add_srcip6()
500 } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ in add_srcip6()
501 cmd->opcode = O_IP6_SRC_ME; in add_srcip6()
502 } else if (F_LEN(cmd) == in add_srcip6()
505 cmd->opcode = O_IP6_SRC; in add_srcip6()
507 cmd->opcode = O_IP6_SRC_MASK; in add_srcip6()
509 return cmd; in add_srcip6()
513 add_dstip6(ipfw_insn *cmd, char *av, int cblen, struct tidx *tstate) in add_dstip6() argument
516 fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen, tstate); in add_dstip6()
517 if (cmd->opcode == O_IP_DST_SET) /* set */ in add_dstip6()
519 else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ in add_dstip6()
521 else if (F_LEN(cmd) == 0) { /* any */ in add_dstip6()
522 } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ in add_dstip6()
523 cmd->opcode = O_IP6_DST_ME; in add_dstip6()
524 } else if (F_LEN(cmd) == in add_dstip6()
527 cmd->opcode = O_IP6_DST; in add_dstip6()
529 cmd->opcode = O_IP6_DST_MASK; in add_dstip6()
531 return cmd; in add_dstip6()