Lines Matching +full:1 +full:ac
94 mib[1] = PF_ROUTE; in set_addr_dynamic()
102 if (sysctl(mib, 6, NULL, &needed, NULL, 0) == -1) in set_addr_dynamic()
103 err(1, "iflist-sysctl-estimate"); in set_addr_dynamic()
104 buf = safe_calloc(1, needed); in set_addr_dynamic()
105 if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1) in set_addr_dynamic()
106 err(1, "iflist-sysctl-get"); in set_addr_dynamic()
126 sdl = (struct sockaddr_dl *)(ifm + 1); in set_addr_dynamic()
135 errx(1, "unknown interface name %s", ifn); in set_addr_dynamic()
153 char *cp = (char *)(ifam + 1); in set_addr_dynamic()
155 for (i = 1; i < RTA_IFA; i <<= 1) { in set_addr_dynamic()
210 errx (1, "unknown host %s", str); in StrToAddr()
228 SETNUMPORTS(*portRange, 1); in StrToPortRange()
238 SETNUMPORTS(*portRange, 1); in StrToPortRange()
251 SETNUMPORTS(*portRange, hiPort - loPort + 1); in StrToPortRange()
309 * spool_cnt n=0 ...... n=(X-1)
322 estimate_redir_addr(int *ac, char ***av) in estimate_redir_addr() argument
328 (void)ac; /* UNUSED */ in estimate_redir_addr()
343 setup_redir_addr(char *buf, int *ac, char ***av) in setup_redir_addr() argument
374 (*av)++; (*ac)--; in setup_redir_addr()
378 (*av)++; (*ac)--; in setup_redir_addr()
384 estimate_redir_port(int *ac, char ***av) in estimate_redir_port() argument
390 (void)ac; /* UNUSED */ in estimate_redir_port()
405 setup_redir_port(char *buf, int *ac, char ***av) in setup_redir_port() argument
426 (*av)++; (*ac)--; in setup_redir_port()
434 numLocalPorts = 1; in setup_redir_port()
459 (*av)++; (*ac)--; in setup_redir_port()
482 (*av)++; (*ac)--; in setup_redir_port()
491 if (*ac != 0 && isdigit(***av)) { in setup_redir_port()
499 SETNUMPORTS(portRange, 1); in setup_redir_port()
502 (*av)++; (*ac)--; in setup_redir_port()
505 SETNUMPORTS(portRange, 1); in setup_redir_port()
520 (r->rport_cnt != 1 || r->rport != 0)) in setup_redir_port()
552 if (GETNUMPORTS(portRange) != 1) in setup_redir_port()
569 setup_redir_proto(char *buf, int *ac, char ***av) in setup_redir_proto() argument
590 (*av)++; (*ac)--; in setup_redir_proto()
597 (*av)++; (*ac)--; in setup_redir_proto()
602 if (*ac == 0) { in setup_redir_proto()
609 (*av)++; (*ac)--; in setup_redir_proto()
615 if (*ac != 0 && isdigit(***av)) { in setup_redir_proto()
617 (*av)++; (*ac)--; in setup_redir_proto()
630 buf = (char *)(n + 1); in nat_show_log()
711 if (t->pport_cnt > 1) in nat_show_cfg()
713 t->pport_cnt - 1); in nat_show_cfg()
728 if (!t->spool_cnt && t->pport_cnt > 1) in nat_show_cfg()
729 printf("-%u", t->pport + t->pport_cnt - 1); in nat_show_cfg()
735 if (!t->spool_cnt && t->rport_cnt > 1) in nat_show_cfg()
737 t->rport_cnt - 1); in nat_show_cfg()
778 return 1; in nat_port_alias_parse()
782 ipfw_config_nat(int ac, char **av) in ipfw_config_nat() argument
792 ac--; in ipfw_config_nat()
794 if (ac == 0) in ipfw_config_nat()
801 ac--; in ipfw_config_nat()
802 if (ac == 0) in ipfw_config_nat()
806 ac1 = ac; in ipfw_config_nat()
871 errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]); in ipfw_config_nat()
882 n = (struct nat44_cfg_nat *)(oh + 1); in ipfw_config_nat()
887 while (ac > 0) { in ipfw_config_nat()
889 ac--; in ipfw_config_nat()
893 if (ac == 0) in ipfw_config_nat()
898 ac--; in ipfw_config_nat()
902 if (ac == 0) in ipfw_config_nat()
905 ac--; in ipfw_config_nat()
947 i = setup_redir_addr(&buf[off], &ac, &av); in ipfw_config_nat()
950 i = setup_redir_port(&buf[off], &ac, &av); in ipfw_config_nat()
953 i = setup_redir_proto(&buf[off], &ac, &av); in ipfw_config_nat()
960 if (ac == 0) in ipfw_config_nat()
970 ac--; in ipfw_config_nat()
980 err(1, "setsockopt(%s)", "IP_FW_NAT44_XCONFIG"); in ipfw_config_nat()
994 ntlv->head.type = IPFW_TLV_EACTION_NAME(1); /* it doesn't matter */ in nat_fill_ntlv()
996 ntlv->idx = 1; in nat_fill_ntlv()
1010 if (ret == -1) { in ipfw_delete_nat()
1037 nat_show_cfg((struct nat44_cfg_nat *)(oh + 1), NULL); in nat_show_data()
1042 nat_show_log((struct nat44_cfg_nat *)(oh + 1), NULL); in nat_show_data()
1088 if ((olh = calloc(1, sz)) == NULL) in nat_foreach()
1101 qsort(olh + 1, olh->count, olh->objsize, natname_cmp); in nat_foreach()
1103 cfg = (struct nat44_cfg_nat*)(olh + 1); in nat_foreach()
1128 if ((oh = calloc(1, sz)) == NULL) in nat_get_cmd()
1130 cfg = (struct nat44_cfg_nat *)(oh + 1); in nat_get_cmd()
1151 ipfw_show_nat(int ac, char **av) in ipfw_show_nat() argument
1158 ac--; in ipfw_show_nat()
1167 for ( ; ac != 0; ac--, av++) { in ipfw_show_nat()
1187 nla.is_all = 1; in ipfw_show_nat()
1188 nat_foreach(nat_show_data, &nla, 1); in ipfw_show_nat()
1192 nat_show_cfg((struct nat44_cfg_nat *)(oh + 1), NULL); in ipfw_show_nat()