2
* Authentication Header declarations
3
* Copyright (C) 1996, 1997 John Ioannidis.
4
* Copyright (C) 1998, 1999, 2000, 2001 Richard Guy Briggs.
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_ah.h,v 1.21 2003/12/13 19:10:16 mcr Exp $
19
#include "ipsec_md5h.h"
20
#include "ipsec_sha1.h"
24
#endif /* IPPROTO_AH */
26
#include "ipsec_auth.h"
30
extern struct inet_protocol ah_protocol;
34
struct ahhdr /* Generic AH header */
36
__u8 ah_nh; /* Next header (protocol) */
37
__u8 ah_hl; /* AH length, in 32-bit words */
38
__u16 ah_rv; /* reserved, must be 0 */
39
__u32 ah_spi; /* Security Parameters Index */
40
__u32 ah_rpl; /* Replay prevention */
41
__u8 ah_data[AHHMAC_HASHLEN];/* Authentication hash */
43
#define AH_BASIC_LEN 8 /* basic AH header is 8 bytes, nh,hl,rv,spi
44
* and the ah_hl, says how many bytes after that
47
extern struct xform_functions ah_xform_funcs[];
49
#ifdef CONFIG_IPSEC_DEBUG
51
#endif /* CONFIG_IPSEC_DEBUG */
52
#endif /* __KERNEL__ */
55
* $Log: ipsec_ah.h,v $
56
* Revision 1.21 2003/12/13 19:10:16 mcr
57
* refactored rcv and xmit code - same as FS 2.05.
59
* Revision 1.22 2003/12/11 20:14:58 mcr
60
* refactored the xmit code, to move all encapsulation
61
* code into protocol functions. Note that all functions
62
* are essentially done by a single function, which is probably
64
* the rcv_functions structures are renamed xform_functions.
66
* Revision 1.21 2003/12/06 21:21:19 mcr
67
* split up receive path into per-transform files, for
68
* easier later removal.
70
* Revision 1.20 2003/02/06 02:21:34 rgb
72
* Moved "struct auth_alg" from ipsec_rcv.c to ipsec_ah.h .
73
* Changed "struct ah" to "struct ahhdr" and "struct esp" to "struct esphdr".
74
* Removed "#ifdef INBOUND_POLICY_CHECK_eroute" dead code.
76
* Revision 1.19 2002/09/16 21:19:13 mcr
77
* fixes for west-ah-icmp-01 - length of AH header must be
78
* calculated properly, and next_header field properly copied.
80
* Revision 1.18 2002/05/14 02:37:02 rgb
81
* Change reference from _TDB to _IPSA.
83
* Revision 1.17 2002/04/24 07:36:46 mcr
84
* Moved from ./klips/net/ipsec/ipsec_ah.h,v
86
* Revision 1.16 2002/02/20 01:27:06 rgb
87
* Ditched a pile of structs only used by the old Netlink interface.
89
* Revision 1.15 2001/12/11 02:35:57 rgb
90
* Change "struct net_device" to "struct device" for 2.2 compatibility.
92
* Revision 1.14 2001/11/26 09:23:47 rgb
93
* Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
95
* Revision 1.13.2.1 2001/09/25 02:18:24 mcr
96
* replace "struct device" with "struct netdevice"
98
* Revision 1.13 2001/06/14 19:35:08 rgb
99
* Update copyright date.
101
* Revision 1.12 2000/09/12 03:21:20 rgb
102
* Cleared out unused htonq.
104
* Revision 1.11 2000/09/08 19:12:55 rgb
105
* Change references from DEBUG_IPSEC to CONFIG_IPSEC_DEBUG.
107
* Revision 1.10 2000/01/21 06:13:10 rgb
109
* Added macros for HMAC padding magic numbers.(kravietz)
111
* Revision 1.9 1999/12/07 18:16:23 rgb
112
* Fixed comments at end of #endif lines.
114
* Revision 1.8 1999/04/11 00:28:56 henry
117
* Revision 1.7 1999/04/06 04:54:25 rgb
118
* Fix/Add RCSID Id: and Log: bits to make PHMDs happy. This includes
121
* Revision 1.6 1999/01/26 02:06:01 rgb
122
* Removed CONFIG_IPSEC_ALGO_SWITCH macro.
124
* Revision 1.5 1999/01/22 06:17:49 rgb
125
* Updated macro comments.
126
* Added context types to support algorithm switch code.
127
* 64-bit clean-up -- converting 'u long long' to __u64.
129
* Revision 1.4 1998/07/14 15:54:56 rgb
130
* Add #ifdef __KERNEL__ to protect kernel-only structures.
132
* Revision 1.3 1998/06/30 18:05:16 rgb
133
* Comment out references to htonq.
135
* Revision 1.2 1998/06/25 19:33:46 rgb
136
* Add prototype for protocol receive function.
137
* Rearrange for more logical layout.
139
* Revision 1.1 1998/06/18 21:27:43 henry
140
* move sources from klips/src to klips/net/ipsec, to keep stupid
141
* kernel-build scripts happier in the presence of symlinks
143
* Revision 1.4 1998/05/18 22:28:43 rgb
144
* Disable key printing facilities from /proc/net/ipsec_*.
146
* Revision 1.3 1998/04/21 21:29:07 rgb
147
* Rearrange debug switches to change on the fly debug output from user
148
* space. Only kernel changes checked in at this time. radij.c was also
149
* changed to temporarily remove buggy debugging code in rj_delete causing
150
* an OOPS and hence, netlink device open errors.
152
* Revision 1.2 1998/04/12 22:03:17 rgb
153
* Updated ESP-3DES-HMAC-MD5-96,
154
* ESP-DES-HMAC-MD5-96,
156
* AH-HMAC-SHA1-96 since Henry started freeswan cvs repository
157
* from old standards (RFC182[5-9] to new (as of March 1998) drafts.
159
* Fixed eroute references in /proc/net/ipsec*.
161
* Started to patch module unloading memory leaks in ipsec_netlink and
162
* radij tree unloading.
164
* Revision 1.1 1998/04/09 03:05:55 henry
165
* sources moved up from linux/net/ipsec
167
* Revision 1.1.1.1 1998/04/08 05:35:02 henry
168
* RGB's ipsec-0.8pre2.tar.gz ipsec-0.8
170
* Revision 0.4 1997/01/15 01:28:15 ji
171
* Added definitions for new AH transforms.
173
* Revision 0.3 1996/11/20 14:35:48 ji
175
* Rationalized debugging code.
177
* Revision 0.2 1996/11/02 00:18:33 ji
178
* First limited release.