summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2011-04-18 21:18:22 +0000
committerglebius <glebius@FreeBSD.org>2011-04-18 21:18:22 +0000
commit57baf3da41e06e14fc231a6361a34932b3de1c2a (patch)
treedb3bade514eee879822dab423e313cd92d92f7c2 /sbin/ipfw/ipfw2.c
parent54ee91ad9a5e7308638bf0e173f9b7fac62869a7 (diff)
downloadFreeBSD-src-57baf3da41e06e14fc231a6361a34932b3de1c2a.zip
FreeBSD-src-57baf3da41e06e14fc231a6361a34932b3de1c2a.tar.gz
Whitespace fixes.
Checked with: md5, diff -w
Diffstat (limited to 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 9f2fe69..4402f44 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -210,7 +210,7 @@ static struct _s_x rule_actions[] = {
{ "unreach", TOK_UNREACH },
{ "check-state", TOK_CHECKSTATE },
{ "//", TOK_COMMENT },
- { "nat", TOK_NAT },
+ { "nat", TOK_NAT },
{ "reass", TOK_REASS },
{ "setfib", TOK_SETFIB },
{ NULL, 0 } /* terminator */
@@ -380,8 +380,8 @@ do_cmd(int optname, void *optval, uintptr_t optlen)
if (optname == IP_FW_GET || optname == IP_DUMMYNET_GET ||
optname == IP_FW_ADD || optname == IP_FW_TABLE_LIST ||
- optname == IP_FW_TABLE_GETSIZE ||
- optname == IP_FW_NAT_GET_CONFIG ||
+ optname == IP_FW_TABLE_GETSIZE ||
+ optname == IP_FW_NAT_GET_CONFIG ||
optname < 0 ||
optname == IP_FW_NAT_GET_LOG) {
if (optname < 0)
@@ -1028,7 +1028,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
/*
* first print actions
*/
- for (l = rule->cmd_len - rule->act_ofs, cmd = ACTION_PTR(rule);
+ for (l = rule->cmd_len - rule->act_ofs, cmd = ACTION_PTR(rule);
l > 0 ; l -= F_LEN(cmd), cmd += F_LEN(cmd)) {
switch(cmd->opcode) {
case O_CHECK_STATE:
@@ -1158,7 +1158,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
/*
* then print the body.
*/
- for (l = rule->act_ofs, cmd = rule->cmd ;
+ for (l = rule->act_ofs, cmd = rule->cmd ;
l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) {
if ((cmd->len & F_OR) || (cmd->len & F_NOT))
continue;
@@ -1182,7 +1182,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
if (co.comment_only)
comment = "...";
- for (l = rule->act_ofs, cmd = rule->cmd ;
+ for (l = rule->act_ofs, cmd = rule->cmd ;
l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) {
/* useful alias */
ipfw_insn_u32 *cmd32 = (ipfw_insn_u32 *)cmd;
@@ -1569,7 +1569,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
}
}
show_prerequisites(&flags, HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP
- | HAVE_IP, 0);
+ | HAVE_IP, 0);
if (comment)
printf(" // %s", comment);
printf("\n");
@@ -2198,7 +2198,6 @@ n2mask(struct in6_addr *mask, int n)
}
return;
}
-
/*
* helper function to process a set of flags and set bits in the
@@ -2229,9 +2228,9 @@ fill_flags(ipfw_insn *cmd, enum ipfw_opcodes opcode,
*which |= (uint8_t)val;
p = q;
}
- cmd->opcode = opcode;
- cmd->len = (cmd->len & (F_NOT | F_OR)) | 1;
- cmd->arg1 = (set & 0xff) | ( (clear & 0xff) << 8);
+ cmd->opcode = opcode;
+ cmd->len = (cmd->len & (F_NOT | F_OR)) | 1;
+ cmd->arg1 = (set & 0xff) | ( (clear & 0xff) << 8);
}
@@ -2289,7 +2288,7 @@ ipfw_delete(char *av[])
* fill the interface structure. We do not check the name as we can
* create interfaces dynamically, so checking them at insert time
* makes relatively little sense.
- * Interface names containing '*', '?', or '[' are assumed to be shell
+ * Interface names containing '*', '?', or '[' are assumed to be shell
* patterns which match interfaces.
*/
static void
@@ -2817,7 +2816,7 @@ chkarg:
"illegal forwarding port ``%s''", s);
p->sa.sin_port = (u_short)i;
}
- if (_substrcmp(*av, "tablearg") == 0)
+ if (_substrcmp(*av, "tablearg") == 0)
p->sa.sin_addr.s_addr = INADDR_ANY;
else
lookup_host(*av, &(p->sa.sin_addr));
@@ -2837,7 +2836,7 @@ chkarg:
action->opcode = O_SETFIB;
NEED1("missing fib number");
- action->arg1 = strtoul(*av, NULL, 10);
+ action->arg1 = strtoul(*av, NULL, 10);
if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
errx(EX_DATAERR, "fibs not suported.\n");
if (action->arg1 >= numfibs) /* Temporary */
@@ -3144,7 +3143,7 @@ read_options:
errx(EX_USAGE, "+missing \")\"\n");
open_par = 0;
prev = NULL;
- break;
+ break;
case TOK_IN:
fill_cmd(cmd, O_IN, 0, 0);
@@ -3829,10 +3828,10 @@ ipfw_table_handler(int ac, char *av[])
if (strchr(*av, (int)'.') == NULL && isdigit(**av)) {
ent.value = strtoul(*av, NULL, 0);
} else {
- if (lookup_host(*av, (struct in_addr *)&tval) == 0) {
+ if (lookup_host(*av, (struct in_addr *)&tval) == 0) {
/* The value must be stored in host order *
* so that the values < 65k can be distinguished */
- ent.value = ntohl(tval);
+ ent.value = ntohl(tval);
} else {
errx(EX_NOHOST, "hostname ``%s'' unknown", *av);
}
@@ -3851,7 +3850,7 @@ ipfw_table_handler(int ac, char *av[])
if (do_cmd(IP_FW_TABLE_ADD,
&ent, sizeof(ent)) < 0)
err(EX_OSERR,
- "setsockopt(IP_FW_TABLE_ADD)");
+ "setsockopt(IP_FW_TABLE_ADD)");
}
}
} else if (_substrcmp(*av, "flush") == 0) {
OpenPOWER on IntegriCloud