diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-30 10:07:52 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-30 10:07:52 +0000 |
commit | ba28bae8cc6d4d02d73c6fe0bf1262701abd396b (patch) | |
tree | 21efce1d519d9912289cb340c04ca1f75f09780d /sbin | |
parent | 61c36f0bc447e7c1130909dc07635cd4c1ad0012 (diff) |
move unmask back into pf_print_state.c where it was, and please keep it there; henning@ ok
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pf_print_state.c | 24 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index cb3c56f4449..be1c930d10b 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_print_state.c,v 1.12 2002/11/29 18:24:29 mickey Exp $ */ +/* $OpenBSD: pf_print_state.c,v 1.13 2002/11/30 10:07:51 mickey Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -224,3 +224,25 @@ print_state(struct pf_state *s, int opts) printf("\n"); } } + +int +unmask(struct pf_addr *m, sa_family_t af) +{ + int i = 31, j = 0, b = 0, msize; + u_int32_t tmp; + + if (af == AF_INET) + msize = 1; + else + msize = 4; + while (j < msize && m->addr32[j] == 0xffffffff) { + b += 32; + j++; + } + if (j < msize) { + tmp = ntohl(m->addr32[j]); + for (i = 31; tmp & (1 << i); --i) + b++; + } + return (b); +} diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 72a9bd930be..80261b69c0d 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.114 2002/11/28 13:18:09 mcbride Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.115 2002/11/30 10:07:51 mickey Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -888,25 +888,3 @@ parse_flags(char *s) } return (f ? f : PF_TH_ALL); } - -int -unmask(struct pf_addr *m, sa_family_t af) -{ - int i = 31, j = 0, b = 0, msize; - u_int32_t tmp; - - if (af == AF_INET) - msize = 1; - else - msize = 4; - while (j < msize && m->addr32[j] == 0xffffffff) { - b += 32; - j++; - } - if (j < msize) { - tmp = ntohl(m->addr32[j]); - for (i = 31; tmp & (1 << i); --i) - b++; - } - return (b); -} |