summaryrefslogtreecommitdiff
path: root/src/libfreeswan/ipsec_life.h
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2007-04-12 20:30:08 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2007-04-12 20:30:08 +0000
commitb0d8ed94fe9e74afb49fdf5f11e4add29879c65c (patch)
treeb20167235628771046e940a82a906a6d0991ee4a /src/libfreeswan/ipsec_life.h
parentea939d07c84d2a8e51215458063fc05e9c399290 (diff)
downloadvyos-strongswan-b0d8ed94fe9e74afb49fdf5f11e4add29879c65c.tar.gz
vyos-strongswan-b0d8ed94fe9e74afb49fdf5f11e4add29879c65c.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.1.1)
Diffstat (limited to 'src/libfreeswan/ipsec_life.h')
-rw-r--r--src/libfreeswan/ipsec_life.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/libfreeswan/ipsec_life.h b/src/libfreeswan/ipsec_life.h
new file mode 100644
index 000000000..4cf270272
--- /dev/null
+++ b/src/libfreeswan/ipsec_life.h
@@ -0,0 +1,112 @@
+/*
+ * Definitions relevant to IPSEC lifetimes
+ * Copyright (C) 2001 Richard Guy Briggs <rgb@freeswan.org>
+ * and Michael Richardson <mcr@freeswan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * RCSID $Id: ipsec_life.h,v 1.1 2004/03/15 20:35:25 as Exp $
+ *
+ * This file derived from ipsec_xform.h on 2001/9/18 by mcr.
+ *
+ */
+
+/*
+ * This file describes the book keeping fields for the
+ * IPsec Security Association Structure. ("ipsec_sa")
+ *
+ * This structure is never allocated directly by kernel code,
+ * (it is always a static/auto or is part of a structure)
+ * so it does not have a reference count.
+ *
+ */
+
+#ifndef _IPSEC_LIFE_H_
+
+/*
+ * _count is total count.
+ * _hard is hard limit (kill SA after this number)
+ * _soft is soft limit (try to renew SA after this number)
+ * _last is used in some special cases.
+ *
+ */
+
+struct ipsec_lifetime64
+{
+ __u64 ipl_count;
+ __u64 ipl_soft;
+ __u64 ipl_hard;
+ __u64 ipl_last;
+};
+
+struct ipsec_lifetimes
+{
+ /* number of bytes processed */
+ struct ipsec_lifetime64 ipl_bytes;
+
+ /* number of packets processed */
+ struct ipsec_lifetime64 ipl_packets;
+
+ /* time since SA was added */
+ struct ipsec_lifetime64 ipl_addtime;
+
+ /* time since SA was first used */
+ struct ipsec_lifetime64 ipl_usetime;
+
+ /* from rfc2367:
+ * For CURRENT, the number of different connections,
+ * endpoints, or flows that the association has been
+ * allocated towards. For HARD and SOFT, the number of
+ * these the association may be allocated towards
+ * before it expires. The concept of a connection,
+ * flow, or endpoint is system specific.
+ *
+ * mcr(2001-9-18) it is unclear what purpose these serve for FreeSWAN.
+ * They are maintained for PF_KEY compatibility.
+ */
+ struct ipsec_lifetime64 ipl_allocations;
+};
+
+enum ipsec_life_alive {
+ ipsec_life_harddied = -1,
+ ipsec_life_softdied = 0,
+ ipsec_life_okay = 1
+};
+
+enum ipsec_life_type {
+ ipsec_life_timebased = 1,
+ ipsec_life_countbased= 0
+};
+
+#define _IPSEC_LIFE_H_
+#endif /* _IPSEC_LIFE_H_ */
+
+
+/*
+ * $Log: ipsec_life.h,v $
+ * Revision 1.1 2004/03/15 20:35:25 as
+ * added files from freeswan-2.04-x509-1.5.3
+ *
+ * Revision 1.3 2002/04/24 07:36:46 mcr
+ * Moved from ./klips/net/ipsec/ipsec_life.h,v
+ *
+ * Revision 1.2 2001/11/26 09:16:14 rgb
+ * Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
+ *
+ * Revision 1.1.2.1 2001/09/25 02:25:58 mcr
+ * lifetime structure created and common functions created.
+ *
+ *
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ *
+ */