diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2013-07-02 01:42:02 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2013-07-02 01:42:02 +0000 |
commit | f1d93108272959671a778d688d96e156720e5532 (patch) | |
tree | 7788ab4be0e4f0f3b1acc0d700c8497e610bc218 | |
parent | 7b4c6994e0c310bfd79ccb11c41c709f549a8977 (diff) |
Use time_t for storing time_t values. No change to the underlying
type**, so no ABI change.
ok henning@ deraadt@
** ...yet
-rw-r--r-- | share/man/man4/pf.4 | 10 | ||||
-rw-r--r-- | sys/net/pf_table.c | 43 | ||||
-rw-r--r-- | sys/net/pfvar.h | 12 |
3 files changed, 33 insertions, 32 deletions
diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 2132df0e6dc..49a6d04fb23 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pf.4,v 1.75 2013/06/01 17:15:02 lteo Exp $ +.\" $OpenBSD: pf.4,v 1.76 2013/07/02 01:42:01 guenther Exp $ .\" .\" Copyright (C) 2001, Kjell Wooding. All rights reserved. .\" @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: June 1 2013 $ +.Dd $Mdocdate: July 2 2013 $ .Dt PF 4 .Os .Sh NAME @@ -527,7 +527,7 @@ struct pfr_tstats { [PFR_DIR_MAX][PFR_OP_TABLE_MAX]; u_int64_t pfrts_match; u_int64_t pfrts_nomatch; - long pfrts_tzero; + time_t pfrts_tzero; int pfrts_cnt; int pfrts_refcnt[PFR_REFCNT_MAX]; }; @@ -672,7 +672,7 @@ struct pfr_astats { [PFR_DIR_MAX][PFR_OP_ADDR_MAX]; u_int64_t pfras_bytes [PFR_DIR_MAX][PFR_OP_ADDR_MAX]; - long pfras_tzero; + time_t pfras_tzero; }; .Ed .It Dv DIOCRCLRASTATS Fa "struct pfioc_table *io" @@ -974,7 +974,7 @@ struct pfi_kif { RB_ENTRY(pfi_kif) pfik_tree; u_int64_t pfik_packets[2][2][2]; u_int64_t pfik_bytes[2][2][2]; - u_int32_t pfik_tzero; + time_t pfik_tzero; int pfik_flags; int pfik_flags_new; void *pfik_ah_cookie; diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index c9661f5f08e..c2f4b983de7 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.97 2013/02/18 14:48:13 mikeb Exp $ */ +/* $OpenBSD: pf_table.c,v 1.98 2013/07/02 01:42:01 guenther Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -153,10 +153,10 @@ struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, u_int32_t); void pfr_destroy_kentries(struct pfr_kentryworkq *); void pfr_destroy_kentry(struct pfr_kentry *); void pfr_insert_kentries(struct pfr_ktable *, - struct pfr_kentryworkq *, long); + struct pfr_kentryworkq *, time_t); void pfr_remove_kentries(struct pfr_ktable *, struct pfr_kentryworkq *); -void pfr_clstats_kentries(struct pfr_kentryworkq *, long, +void pfr_clstats_kentries(struct pfr_kentryworkq *, time_t, int); void pfr_reset_feedback(struct pfr_addr *, int, int); void pfr_prepare_network(union sockaddr_union *, int, int); @@ -167,15 +167,16 @@ int pfr_unroute_kentry(struct pfr_ktable *, int pfr_walktree(struct radix_node *, void *, u_int); int pfr_validate_table(struct pfr_table *, int, int); int pfr_fix_anchor(char *); -void pfr_commit_ktable(struct pfr_ktable *, long); +void pfr_commit_ktable(struct pfr_ktable *, time_t); void pfr_insert_ktables(struct pfr_ktableworkq *); void pfr_insert_ktable(struct pfr_ktable *); void pfr_setflags_ktables(struct pfr_ktableworkq *); void pfr_setflags_ktable(struct pfr_ktable *, int); -void pfr_clstats_ktables(struct pfr_ktableworkq *, long, +void pfr_clstats_ktables(struct pfr_ktableworkq *, time_t, + int); +void pfr_clstats_ktable(struct pfr_ktable *, time_t, int); +struct pfr_ktable *pfr_create_ktable(struct pfr_table *, time_t, int, int); -void pfr_clstats_ktable(struct pfr_ktable *, long, int); -struct pfr_ktable *pfr_create_ktable(struct pfr_table *, long, int, int); void pfr_destroy_ktables(struct pfr_ktableworkq *, int); void pfr_destroy_ktable(struct pfr_ktable *, int); int pfr_ktable_compare(struct pfr_ktable *, @@ -271,7 +272,7 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size, struct pfr_kentry *p, *q; struct pfr_addr ad; int i, rv, xadd = 0; - long tzero = time_second; + time_t tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK); if (pfr_validate_table(tbl, 0, flags & PFR_FLAG_USERIOCTL)) @@ -438,7 +439,7 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size, struct pfr_kentry *p, *q; struct pfr_addr ad; int i, rv, xadd = 0, xdel = 0, xchange = 0; - long tzero = time_second; + time_t tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK); if (pfr_validate_table(tbl, ignore_pfrt_flags, flags & @@ -630,7 +631,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astats *addr, int *size, struct pfr_walktree w; struct pfr_kentryworkq workq; int rv; - long tzero = time_second; + time_t tzero = time_second; if (pfr_validate_table(tbl, 0, 0)) return (EINVAL); @@ -885,7 +886,7 @@ pfr_destroy_kentry(struct pfr_kentry *ke) void pfr_insert_kentries(struct pfr_ktable *kt, - struct pfr_kentryworkq *workq, long tzero) + struct pfr_kentryworkq *workq, time_t tzero) { struct pfr_kentry *p; int rv, n = 0; @@ -909,7 +910,7 @@ pfr_insert_kentries(struct pfr_ktable *kt, } int -pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_addr *ad, long tzero) +pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_addr *ad, time_t tzero) { struct pfr_kentry *p; int rv; @@ -974,7 +975,7 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } void -pfr_clstats_kentries(struct pfr_kentryworkq *workq, long tzero, int negchange) +pfr_clstats_kentries(struct pfr_kentryworkq *workq, time_t tzero, int negchange) { struct pfr_kentry *p; int s; @@ -1243,7 +1244,7 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags) struct pfr_ktableworkq addq, changeq; struct pfr_ktable *p, *q, *r, key; int i, rv, xadd = 0; - long tzero = time_second; + time_t tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); SLIST_INIT(&addq); @@ -1394,7 +1395,7 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size, struct pfr_ktable *p; struct pfr_ktableworkq workq; int s, n, nn; - long tzero = time_second; + time_t tzero = time_second; /* XXX PFR_FLAG_CLSTATS disabled */ ACCEPT_FLAGS(flags, PFR_FLAG_ALLRSETS); @@ -1439,7 +1440,7 @@ pfr_clr_tstats(struct pfr_table *tbl, int size, int *nzero, int flags) struct pfr_ktableworkq workq; struct pfr_ktable *p, key; int i, xzero = 0; - long tzero = time_second; + time_t tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_ADDRSTOO); SLIST_INIT(&workq); @@ -1692,7 +1693,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, struct pfr_ktableworkq workq; struct pf_ruleset *rs; int xadd = 0, xchange = 0; - long tzero = time_second; + time_t tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); rs = pf_find_ruleset(trs->pfrt_anchor); @@ -1728,7 +1729,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, } void -pfr_commit_ktable(struct pfr_ktable *kt, long tzero) +pfr_commit_ktable(struct pfr_ktable *kt, time_t tzero) { struct pfr_ktable *shadow = kt->pfrkt_shadow; int nflags; @@ -1925,7 +1926,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf) } void -pfr_clstats_ktables(struct pfr_ktableworkq *workq, long tzero, int recurse) +pfr_clstats_ktables(struct pfr_ktableworkq *workq, time_t tzero, int recurse) { struct pfr_ktable *p; @@ -1934,7 +1935,7 @@ pfr_clstats_ktables(struct pfr_ktableworkq *workq, long tzero, int recurse) } void -pfr_clstats_ktable(struct pfr_ktable *kt, long tzero, int recurse) +pfr_clstats_ktable(struct pfr_ktable *kt, time_t tzero, int recurse) { struct pfr_kentryworkq addrq; int s; @@ -1952,7 +1953,7 @@ pfr_clstats_ktable(struct pfr_ktable *kt, long tzero, int recurse) } struct pfr_ktable * -pfr_create_ktable(struct pfr_table *tbl, long tzero, int attachruleset, +pfr_create_ktable(struct pfr_table *tbl, time_t tzero, int attachruleset, int intr) { struct pfr_ktable *kt; diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3d73bf591d7..639df4b6803 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.384 2013/06/26 09:12:39 henning Exp $ */ +/* $OpenBSD: pfvar.h,v 1.385 2013/07/02 01:42:01 guenther Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1060,7 +1060,7 @@ struct pfr_astats { struct pfr_addr pfras_a; u_int64_t pfras_packets[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; u_int64_t pfras_bytes[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; - long pfras_tzero; + time_t pfras_tzero; }; enum { PFR_REFCNT_RULE, PFR_REFCNT_ANCHOR, PFR_REFCNT_MAX }; @@ -1071,7 +1071,7 @@ struct pfr_tstats { u_int64_t pfrts_bytes[PFR_DIR_MAX][PFR_OP_TABLE_MAX]; u_int64_t pfrts_match; u_int64_t pfrts_nomatch; - long pfrts_tzero; + time_t pfrts_tzero; int pfrts_cnt; int pfrts_refcnt[PFR_REFCNT_MAX]; }; @@ -1090,7 +1090,7 @@ struct _pfr_kentry { union sockaddr_union _pfrke_sa; SLIST_ENTRY(pfr_kentry) _pfrke_workq; struct pfr_kcounters *_pfrke_counters; - long _pfrke_tzero; + time_t _pfrke_tzero; u_int8_t _pfrke_af; u_int8_t _pfrke_net; u_int8_t _pfrke_flags; @@ -1197,7 +1197,7 @@ struct pfi_kif { RB_ENTRY(pfi_kif) pfik_tree; u_int64_t pfik_packets[2][2][2]; u_int64_t pfik_bytes[2][2][2]; - u_int32_t pfik_tzero; + time_t pfik_tzero; int pfik_flags; int pfik_flags_new; void *pfik_ah_cookie; @@ -1869,7 +1869,7 @@ int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); int pfr_set_tflags(struct pfr_table *, int, int, int, int *, int *, int); int pfr_clr_addrs(struct pfr_table *, int *, int); -int pfr_insert_kentry(struct pfr_ktable *, struct pfr_addr *, long); +int pfr_insert_kentry(struct pfr_ktable *, struct pfr_addr *, time_t); int pfr_add_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int); int pfr_del_addrs(struct pfr_table *, struct pfr_addr *, int, int *, |