diff options
author | glebius <glebius@FreeBSD.org> | 2011-04-18 22:09:03 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2011-04-18 22:09:03 +0000 |
commit | 54ea1a10a5370fdc4fe35392a981779de4c01e5e (patch) | |
tree | 09837c1c6a3ac80e5eb9e48e5551ec9c5a04b75e | |
parent | 01863c379027d6ae674e4d811a85deca9de5f87d (diff) | |
download | FreeBSD-src-54ea1a10a5370fdc4fe35392a981779de4c01e5e.zip FreeBSD-src-54ea1a10a5370fdc4fe35392a981779de4c01e5e.tar.gz |
More whitespace fixes.
Checked with: md5, diff -x -w
-rw-r--r-- | sbin/ipfw/dummynet.c | 2 | ||||
-rw-r--r-- | sbin/ipfw/ipfw2.c | 20 | ||||
-rw-r--r-- | sbin/ipfw/ipfw2.h | 2 | ||||
-rw-r--r-- | sbin/ipfw/nat.c | 58 |
4 files changed, 41 insertions, 41 deletions
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c index f263d22..cb2972d 100644 --- a/sbin/ipfw/dummynet.c +++ b/sbin/ipfw/dummynet.c @@ -284,7 +284,7 @@ flush_buf(char *buf) printf("%s\n", buf); buf[0] = '\0'; } - + /* * generic list routine. We expect objects in a specific order, i.e. * PIPES AND SCHEDULERS: diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 4402f44..ad871fe 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -435,7 +435,7 @@ match_value(struct _s_x *p, int value) int _substrcmp(const char *str1, const char* str2) { - + if (strncmp(str1, str2, strlen(str1)) != 0) return 1; @@ -463,7 +463,7 @@ _substrcmp(const char *str1, const char* str2) int _substrcmp2(const char *str1, const char* str2, const char* str3) { - + if (strncmp(str1, str2, strlen(str2)) != 0) return 1; @@ -1123,7 +1123,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) case O_NAT: PRINT_UINT_ARG("nat ", cmd->arg1); break; - + case O_SETFIB: PRINT_UINT_ARG("setfib ", cmd->arg1); break; @@ -1131,7 +1131,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) case O_REASS: printf("reass"); break; - + default: printf("** unrecognized action %d len %d ", cmd->opcode, cmd->len); @@ -1168,7 +1168,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) } else if (cmd->opcode == O_IP6) { flags |= HAVE_PROTO6; break; - } + } } if (rule->_pad & 1) { /* empty rules before options */ if (!co.do_compact) { @@ -1625,7 +1625,7 @@ show_dyn_ipfw(ipfw_dyn_rule *d, int pcwidth, int bcwidth) sizeof(buf)), d->id.dst_port); } else printf(" UNKNOWN <-> UNKNOWN\n"); - + printf("\n"); } @@ -2762,7 +2762,7 @@ ipfw_add(char *av[]) goto chkarg; case TOK_TEE: action->opcode = O_TEE; -chkarg: +chkarg: if (!av[0]) errx(EX_USAGE, "missing argument for %s", *(av - 1)); if (isdigit(**av)) { @@ -2848,7 +2848,7 @@ chkarg: case TOK_REASS: action->opcode = O_REASS; break; - + default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } @@ -3196,7 +3196,7 @@ read_options: fill_icmptypes((ipfw_insn_u32 *)cmd, *av); av++; break; - + case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); @@ -3432,7 +3432,7 @@ read_options: av++; } break; - + case TOK_DSTIP6: NEED1("missing destination IP6"); if (add_dstip6(cmd, *av)) { diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 2ba091f..c9f8687 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -183,7 +183,7 @@ enum tokens { TOK_PROXY_ONLY, TOK_REDIR_ADDR, TOK_REDIR_PORT, - TOK_REDIR_PROTO, + TOK_REDIR_PROTO, TOK_IPV6, TOK_FLOWID, diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c index bf93549..9c84d68 100644 --- a/sbin/ipfw/nat.c +++ b/sbin/ipfw/nat.c @@ -54,7 +54,7 @@ static struct _s_x nat_params[] = { { "same_ports", TOK_SAME_PORTS }, { "unreg_only", TOK_UNREG_ONLY }, { "reset", TOK_RESET_ADDR }, - { "reverse", TOK_ALIAS_REV }, + { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, { "redirect_addr", TOK_REDIR_ADDR }, { "redirect_port", TOK_REDIR_PORT }, @@ -84,9 +84,9 @@ set_addr_dynamic(const char *ifn, struct cfg_nat *n) mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; - mib[3] = AF_INET; + mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; - mib[5] = 0; + mib[5] = 0; /* * Get interface data. */ @@ -212,7 +212,7 @@ StrToPortRange (const char* str, const char* proto, port_range *portRange) char* end; u_short loPort; u_short hiPort; - + /* First see if this is a service, return corresponding port if so. */ sp = getservbyname (str,proto); if (sp) { @@ -325,8 +325,8 @@ setup_redir_addr(char *spool_buf, unsigned int len, /* Temporary buffer used to hold server pool ip's. */ char tmp_spool_buf[NAT_BUF_LEN]; int ac, space, lsnat; - struct cfg_redir *r; - struct cfg_spool *tmp; + struct cfg_redir *r; + struct cfg_spool *tmp; av = *_av; ac = *_ac; @@ -351,7 +351,7 @@ setup_redir_addr(char *spool_buf, unsigned int len, strncpy(tmp_spool_buf, *av, strlen(*av)+1); lsnat = 1; } else - StrToAddr(*av, &r->laddr); + StrToAddr(*av, &r->laddr); INC_ARGCV(); /* Extract public address. */ @@ -362,13 +362,13 @@ setup_redir_addr(char *spool_buf, unsigned int len, /* Setup LSNAT server pool. */ if (sep) { - sep = strtok(tmp_spool_buf, ","); + sep = strtok(tmp_spool_buf, ","); while (sep != NULL) { - tmp = (struct cfg_spool *)spool_buf; + tmp = (struct cfg_spool *)spool_buf; if (len < SOF_SPOOL) goto nospace; len -= SOF_SPOOL; - space += SOF_SPOOL; + space += SOF_SPOOL; StrToAddr(sep, &tmp->addr); tmp->port = ~0; r->spool_cnt++; @@ -392,13 +392,13 @@ setup_redir_port(char *spool_buf, unsigned int len, struct cfg_redir *r; struct cfg_spool *tmp; u_short numLocalPorts; - port_range portRange; + port_range portRange; av = *_av; ac = *_ac; space = 0; lsnat = 0; - numLocalPorts = 0; + numLocalPorts = 0; if (len >= SOF_REDIR) { r = (struct cfg_redir *)spool_buf; @@ -415,7 +415,7 @@ setup_redir_port(char *spool_buf, unsigned int len, if (ac == 0) errx (EX_DATAERR, "redirect_port: missing protocol"); r->proto = StrToProto(*av); - protoName = *av; + protoName = *av; INC_ARGCV(); /* @@ -456,7 +456,7 @@ setup_redir_port(char *spool_buf, unsigned int len, numLocalPorts = GETNUMPORTS(portRange); } } - INC_ARGCV(); + INC_ARGCV(); /* * Extract public port and optionally address. @@ -487,7 +487,7 @@ setup_redir_port(char *spool_buf, unsigned int len, /* * Extract remote address and optionally port. - */ + */ /* * NB: isalpha(**av) => we've to check that next parameter is really an * option for this redirect entry, else stop here processing arg[cv]. @@ -562,7 +562,7 @@ setup_redir_port(char *spool_buf, unsigned int len, "this context"); tmp->port = GETLOPORT(portRange); } - r->spool_cnt++; + r->spool_cnt++; /* Point to the next possible cfg_spool. */ spool_buf = &spool_buf[SOF_SPOOL]; sep = strtok(NULL, ","); @@ -581,7 +581,7 @@ setup_redir_proto(char *spool_buf, unsigned int len, int ac, space; struct protoent *protoent; struct cfg_redir *r; - + av = *_av; ac = *_ac; if (len >= SOF_REDIR) { @@ -595,7 +595,7 @@ setup_redir_proto(char *spool_buf, unsigned int len, r->mode = REDIR_PROTO; /* * Extract protocol. - */ + */ if (ac == 0) errx(EX_DATAERR, "redirect_proto: missing protocol"); @@ -606,7 +606,7 @@ setup_redir_proto(char *spool_buf, unsigned int len, r->proto = protoent->p_proto; INC_ARGCV(); - + /* * Extract local address. */ @@ -616,28 +616,28 @@ setup_redir_proto(char *spool_buf, unsigned int len, StrToAddr(*av, &r->laddr); INC_ARGCV(); - + /* * Extract optional public address. */ if (ac == 0) { - r->paddr.s_addr = INADDR_ANY; - r->raddr.s_addr = INADDR_ANY; + r->paddr.s_addr = INADDR_ANY; + r->raddr.s_addr = INADDR_ANY; } else { /* see above in setup_redir_port() */ if (!isalpha(**av)) { - StrToAddr(*av, &r->paddr); + StrToAddr(*av, &r->paddr); INC_ARGCV(); - + /* * Extract optional remote address. - */ + */ /* see above in setup_redir_port() */ if (ac!=0 && !isalpha(**av)) { StrToAddr(*av, &r->raddr); INC_ARGCV(); } - } + } } return (space); nospace: @@ -765,7 +765,7 @@ ipfw_config_nat(int ac, char **av) struct cfg_nat *n; /* Nat instance configuration. */ int i, len, off, tok; char *id, buf[NAT_BUF_LEN]; /* Buffer for serialized data. */ - + len = NAT_BUF_LEN; /* Offset in buf: save space for n at the beginning. */ off = sizeof(*n); @@ -777,7 +777,7 @@ ipfw_config_nat(int ac, char **av) if (ac && isdigit(**av)) { id = *av; i = atoi(*av); - ac--; av++; + ac--; av++; n->id = i; } else errx(EX_DATAERR, "missing nat id"); @@ -894,7 +894,7 @@ ipfw_show_nat(int ac, char **av) frule = lrule = strtoul(av[0], &endptr, 10); if (*endptr == '-') lrule = strtoul(endptr+1, &endptr, 10); - if (lrule == 0) + if (lrule == 0) err(EX_USAGE, "invalid rule number: %s", av[0]); do_rule = 1; } |