2 * Definitions relevant to IPSEC lifetimes
3 * Copyright (C) 2001 Richard Guy Briggs <rgb@freeswan.org>
4 * and Michael Richardson <mcr@freeswan.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * RCSID $Id: ipsec_life.h,v 1.2 2001/11/26 09:16:14 rgb Exp $
18 * This file derived from ipsec_xform.h on 2001/9/18 by mcr.
23 * This file describes the book keeping fields for the
24 * IPsec Security Association Structure. ("ipsec_sa")
26 * This structure is never allocated directly by kernel code,
27 * (it is always a static/auto or is part of a structure)
28 * so it does not have a reference count.
32 #ifndef _IPSEC_LIFE_H_
35 * _count is total count.
36 * _hard is hard limit (kill SA after this number)
37 * _soft is soft limit (try to renew SA after this number)
38 * _last is used in some special cases.
42 struct ipsec_lifetime64
50 struct ipsec_lifetimes
52 /* number of bytes processed */
53 struct ipsec_lifetime64 ipl_bytes;
55 /* number of packets processed */
56 struct ipsec_lifetime64 ipl_packets;
58 /* time since SA was added */
59 struct ipsec_lifetime64 ipl_addtime;
61 /* time since SA was first used */
62 struct ipsec_lifetime64 ipl_usetime;
65 * For CURRENT, the number of different connections,
66 * endpoints, or flows that the association has been
67 * allocated towards. For HARD and SOFT, the number of
68 * these the association may be allocated towards
69 * before it expires. The concept of a connection,
70 * flow, or endpoint is system specific.
72 * mcr(2001-9-18) it is unclear what purpose these serve for FreeSWAN.
73 * They are maintained for PF_KEY compatibility.
75 struct ipsec_lifetime64 ipl_allocations;
77 #define LIFETIMETOA_BUF (4*ULTOA_BUF+10) /* enough room for worst case */
79 enum ipsec_life_alive {
80 ipsec_life_harddied = -1,
81 ipsec_life_softdied = 0,
85 enum ipsec_life_type {
86 ipsec_life_timebased = 1,
87 ipsec_life_countbased= 0
90 #define _IPSEC_LIFE_H_
91 #endif /* _IPSEC_LIFE_H_ */
95 * $Log: ipsec_life.h,v $
96 * Revision 1.2 2001/11/26 09:16:14 rgb
97 * Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
99 * Revision 1.1.2.1 2001/09/25 02:25:58 mcr
100 * lifetime structure created and common functions created.
104 * c-file-style: "linux"