diff options
| author | Christian S.J. Peron <csjp@FreeBSD.org> | 2004-08-12 22:06:55 +0000 |
|---|---|---|
| committer | Christian S.J. Peron <csjp@FreeBSD.org> | 2004-08-12 22:06:55 +0000 |
| commit | 31c88a3043053e6caa5cd4d9f686be6e10db1630 (patch) | |
| tree | 8b1ead136b954572913352304170c0ae98120eea /sbin | |
| parent | f7abebde9e23c64a0c87a60d05b8b1a0ce576073 (diff) | |
Notes
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/ipfw/ipfw.8 | 4 | ||||
| -rw-r--r-- | sbin/ipfw/ipfw2.c | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index e01ac72b1bfc6..eb9e92b17cac1 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -929,6 +929,10 @@ Matches all TCP or UDP packets sent by or received for a A .Ar group may be specified by name or number. +.It Cm jail Ar prisonID +Matches all TCP or UDP packets sent by or received for the +jail whos prison ID is +.Ar prisoniD . .It Cm icmptypes Ar types Matches ICMP packets whose ICMP type is in the list .Ar types . diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 1030e39aaec7c..bac35529c2a8d 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -204,6 +204,7 @@ enum tokens { TOK_UID, TOK_GID, + TOK_JAIL, TOK_IN, TOK_LIMIT, TOK_KEEPSTATE, @@ -304,6 +305,7 @@ struct _s_x rule_actions[] = { struct _s_x rule_options[] = { { "uid", TOK_UID }, { "gid", TOK_GID }, + { "jail", TOK_JAIL }, { "in", TOK_IN }, { "limit", TOK_LIMIT }, { "keep-state", TOK_KEEPSTATE }, @@ -1284,6 +1286,10 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) } break; + case O_JAIL: + printf(" jail %d", cmd32->d[0]); + break; + case O_VERREVPATH: printf(" verrevpath"); break; @@ -3298,6 +3304,22 @@ read_options: } break; + case TOK_JAIL: + NEED1("jail requires argument"); + { + char *end; + int jid; + + cmd->opcode = O_JAIL; + jid = (int)strtol(*av, &end, 0); + if (jid < 0 || *end != '\0') + errx(EX_DATAERR, "jail requires prison ID"); + cmd32->d[0] = (unsigned int)jid; + cmd->len = F_INSN_SIZE(ipfw_insn_u32); + ac--; av++; + } + break; + case TOK_ESTAB: fill_cmd(cmd, O_ESTAB, 0, 0); break; |
