summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-07-04 00:19:02 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-07-04 00:19:02 +0000
commitd8693b0a85979ed63f797a19e95bc47934091ff8 (patch)
treece2f67cf900d072f4c593841b953806dffe98839 /sys
parent72f62f23d4e14f972d9c80b5416c6b7532447279 (diff)
Re-commit: use time_t for storing time_t values. This is an ABI
change for pf, but that's fine at this time. You'll need to rebuild pf userland after updating your kernel. change to 'since' member ok henning@ rest ok henning@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_table.c43
-rw-r--r--sys/net/pfvar.h14
2 files changed, 29 insertions, 28 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c
index 19f5b5787cc..78610d0e7df 100644
--- a/sys/net/pf_table.c
+++ b/sys/net/pf_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_table.c,v 1.99 2013/07/02 05:57:37 guenther Exp $ */
+/* $OpenBSD: pf_table.c,v 1.100 2013/07/04 00:19:00 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 a4c7701fd84..7284e61b9f0 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.386 2013/07/02 05:57:37 guenther Exp $ */
+/* $OpenBSD: pfvar.h,v 1.387 2013/07/04 00:19: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;
@@ -1405,10 +1405,10 @@ struct pf_status {
u_int64_t pcounters[2][2][3];
u_int64_t bcounters[2][2];
u_int64_t stateid;
+ time_t since;
u_int32_t running;
u_int32_t states;
u_int32_t src_nodes;
- u_int32_t since;
u_int32_t debug;
u_int32_t hostid;
u_int32_t reass; /* reassembly */
@@ -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 *,