summaryrefslogtreecommitdiff
path: root/sys/net/if_pfsync.h
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-22 04:54:19 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-22 04:54:19 +0000
commite9021d37990da8cd956294b3e568b70970680503 (patch)
treee2379b236b1edf944ea9ff0e6a8e2b56ef4454a3 /sys/net/if_pfsync.h
parent4d6c0c7208725a3573825ee052fe58d20e8b998c (diff)
Support for best effort bulk transfers of states when pfsync syncif is
configured. This this allows pfsync+carp clusters to come up gracefully without killing active connections. pfsync now prevents carp from preempting to become master until the state table has sync'd. ABI change, any application which use struct pf_state must be recompiled. Reminded about this by Christian Gut. Thanks to beck@ cedric@ and dhartmei@ for testing and comments. ok deraadt@
Diffstat (limited to 'sys/net/if_pfsync.h')
-rw-r--r--sys/net/if_pfsync.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h
index 9c954768cf0..b3705c8dd2a 100644
--- a/sys/net/if_pfsync.h
+++ b/sys/net/if_pfsync.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.h,v 1.12 2004/02/20 19:22:03 mcbride Exp $ */
+/* $OpenBSD: if_pfsync.h,v 1.13 2004/03/22 04:54:17 mcbride Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -120,6 +120,15 @@ struct pfsync_state_clr {
u_int32_t pad;
} __packed;
+struct pfsync_state_bus {
+ u_int32_t creatorid;
+ u_int32_t endtime;
+ u_int8_t status;
+#define PFSYNC_BUS_START 1
+#define PFSYNC_BUS_END 2
+ u_int8_t pad[7];
+} __packed;
+
#ifdef _KERNEL
union sc_statep {
@@ -127,20 +136,28 @@ union sc_statep {
struct pfsync_state_upd *u;
struct pfsync_state_del *d;
struct pfsync_state_clr *c;
+ struct pfsync_state_bus *b;
struct pfsync_state_upd_req *r;
};
+extern int pfsync_sync_ok;
+
struct pfsync_softc {
struct ifnet sc_if;
struct ifnet *sc_sync_ifp;
struct ip_moptions sc_imo;
struct timeout sc_tmo;
+ struct timeout sc_bulk_tmo;
+ struct timeout sc_bulkfail_tmo;
struct in_addr sc_sendaddr;
struct mbuf *sc_mbuf; /* current cummulative mbuf */
struct mbuf *sc_mbuf_net; /* current cummulative mbuf */
union sc_statep sc_statep;
union sc_statep sc_statep_net;
+ u_int32_t sc_ureq_received;
+ u_int32_t sc_ureq_sent;
+ int sc_bulk_tries;
int sc_maxcount; /* number of states in mtu */
int sc_maxupdates; /* number of updates/state */
};
@@ -161,14 +178,18 @@ struct pfsync_header {
#define PFSYNC_ACT_INS_F 6 /* insert fragment */
#define PFSYNC_ACT_DEL_F 7 /* delete fragments */
#define PFSYNC_ACT_UREQ 8 /* request "uncompressed" state */
-#define PFSYNC_ACT_MAX 9
+#define PFSYNC_ACT_BUS 9 /* Bulk Update Status */
+#define PFSYNC_ACT_MAX 10
u_int8_t count;
} __packed;
+#define PFSYNC_BULKPACKETS 1 /* # of packets per timeout */
+#define PFSYNC_MAX_BULKTRIES 12
#define PFSYNC_HDRLEN sizeof(struct pfsync_header)
#define PFSYNC_ACTIONS \
"CLR ST", "INS ST", "UPD ST", "DEL ST", \
- "UPD ST COMP", "DEL ST COMP", "INS FR", "DEL FR", "UPD REQ"
+ "UPD ST COMP", "DEL ST COMP", "INS FR", "DEL FR", \
+ "UPD REQ", "BLK UPD STAT"
#define PFSYNC_DFLTTL 255