Lines Matching full:cmd

85 print_ip6(struct buf_pr *bp, const ipfw_insn_ip6 *cmd)  in print_ip6()  argument
89 const struct in6_addr *a = &(cmd->addr6); in print_ip6()
92 len = F_LEN((const ipfw_insn *)cmd) - 1; in print_ip6()
93 if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { in print_ip6()
97 if (cmd->o.opcode == O_IP6) { in print_ip6()
110 mb = (cmd->o.opcode == O_IP6_SRC || in print_ip6()
111 cmd->o.opcode == O_IP6_DST) ? 128: in print_ip6()
139 fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) in fill_icmp6types() argument
144 memset(cmd, 0, sizeof(*cmd)); in fill_icmp6types()
159 cmd->d[type / 32] |= ( 1 << (type % 32)); in fill_icmp6types()
161 cmd->o.opcode = O_ICMP6TYPE; in fill_icmp6types()
162 cmd->o.len |= F_INSN_SIZE(ipfw_insn_icmp6); in fill_icmp6types()
166 print_icmp6types(struct buf_pr *bp, const ipfw_insn_u32 *cmd) in print_icmp6types() argument
174 if ( (cmd->d[i] & (1 << (j))) == 0) in print_icmp6types()
182 print_flow6id(struct buf_pr *bp, const ipfw_insn_u32 *cmd) in print_flow6id() argument
184 uint16_t i, limit = cmd->o.arg1; in print_flow6id()
191 bprintf(bp, "%d%c", cmd->d[i], sep); in print_flow6id()
210 fill_ext6hdr( ipfw_insn *cmd, char *av) in fill_ext6hdr() argument
215 cmd->arg1 = 0; in fill_ext6hdr()
221 cmd->arg1 |= EXT_FRAGMENT; in fill_ext6hdr()
224 cmd->arg1 |= EXT_HOPOPTS; in fill_ext6hdr()
227 cmd->arg1 |= EXT_ROUTING; in fill_ext6hdr()
230 cmd->arg1 |= EXT_DSTOPTS; in fill_ext6hdr()
233 cmd->arg1 |= EXT_AH; in fill_ext6hdr()
236 cmd->arg1 |= EXT_ESP; in fill_ext6hdr()
239 cmd->arg1 |= EXT_RTHDR0; in fill_ext6hdr()
242 cmd->arg1 |= EXT_RTHDR2; in fill_ext6hdr()
250 if (cmd->arg1 == 0) in fill_ext6hdr()
252 cmd->opcode = O_EXT_HDR; in fill_ext6hdr()
253 cmd->len |= F_INSN_SIZE(ipfw_insn); in fill_ext6hdr()
258 print_ext6hdr(struct buf_pr *bp, const ipfw_insn *cmd ) in print_ext6hdr() argument
263 if (cmd->arg1 & EXT_FRAGMENT) { in print_ext6hdr()
267 if (cmd->arg1 & EXT_HOPOPTS) { in print_ext6hdr()
271 if (cmd->arg1 & EXT_ROUTING) { in print_ext6hdr()
275 if (cmd->arg1 & EXT_RTHDR0) { in print_ext6hdr()
279 if (cmd->arg1 & EXT_RTHDR2) { in print_ext6hdr()
283 if (cmd->arg1 & EXT_DSTOPTS) { in print_ext6hdr()
287 if (cmd->arg1 & EXT_AH) { in print_ext6hdr()
291 if (cmd->arg1 & EXT_ESP) { in print_ext6hdr()
328 fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate) in fill_ip6() argument
331 struct in6_addr *d = &(cmd->addr6); in fill_ip6()
335 * Note d[1] points to struct in6_add r mask6 of cmd in fill_ip6()
338 cmd->o.len &= ~F_LEN_MASK; /* zero len */ in fill_ip6()
345 cmd->o.len |= F_INSN_SIZE(ipfw_insn); in fill_ip6()
350 fill_table(&cmd->o, av, O_IP_DST_LOOKUP, tstate); in fill_ip6()
411 if (cmd->o.len & F_NOT && av == NULL && len == 0) in fill_ip6()
435 cmd->o.len |= len+1; in fill_ip6()
447 fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) in fill_flow6() argument
452 cmd->d[0] = 0; /* Initializing the base number*/ in fill_flow6()
464 cmd->d[nflow] |= type; in fill_flow6()
468 cmd->o.opcode = O_FLOW6ID; in fill_flow6()
469 cmd->o.len |= F_INSN_SIZE(ipfw_insn_u32) + nflow; in fill_flow6()
470 cmd->o.arg1 = nflow; in fill_flow6()
478 add_srcip6(ipfw_insn *cmd, char *av, int cblen, struct tidx *tstate) in add_srcip6() argument
481 fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen, tstate); in add_srcip6()
482 if (cmd->opcode == O_IP_DST_SET) /* set */ in add_srcip6()
483 cmd->opcode = O_IP_SRC_SET; in add_srcip6()
484 else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ in add_srcip6()
485 cmd->opcode = O_IP_SRC_LOOKUP; in add_srcip6()
486 else if (F_LEN(cmd) == 0) { /* any */ in add_srcip6()
487 } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ in add_srcip6()
488 cmd->opcode = O_IP6_SRC_ME; in add_srcip6()
489 } else if (F_LEN(cmd) == in add_srcip6()
492 cmd->opcode = O_IP6_SRC; in add_srcip6()
494 cmd->opcode = O_IP6_SRC_MASK; in add_srcip6()
496 return cmd; in add_srcip6()
500 add_dstip6(ipfw_insn *cmd, char *av, int cblen, struct tidx *tstate) in add_dstip6() argument
503 fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen, tstate); in add_dstip6()
504 if (cmd->opcode == O_IP_DST_SET) /* set */ in add_dstip6()
506 else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ in add_dstip6()
508 else if (F_LEN(cmd) == 0) { /* any */ in add_dstip6()
509 } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ in add_dstip6()
510 cmd->opcode = O_IP6_DST_ME; in add_dstip6()
511 } else if (F_LEN(cmd) == in add_dstip6()
514 cmd->opcode = O_IP6_DST; in add_dstip6()
516 cmd->opcode = O_IP6_DST_MASK; in add_dstip6()
518 return cmd; in add_dstip6()