- u int values can be generated: Not fully tested !
[strongswan.git] / Source / charon / encodings / ike_header.h
1 /**
2 * @file ike_header.h
3 *
4 * @brief Declaration of the data struct ike_header_t.
5 *
6 * The data of a parsed header are stored in a struct of this type.
7 *
8 */
9
10 /*
11 * Copyright (C) 2005 Jan Hutter, Martin Willi
12 * Hochschule fuer Technik Rapperswil
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 */
24
25 #ifndef IKE_HEADER_H_
26 #define IKE_HEADER_H_
27
28 #include <freeswan.h>
29 #include <pluto/constants.h>
30 #include <pluto/defs.h>
31
32 /**
33 * Data structure to hold the data of an IKEv2-Header
34 *
35 * The header format of an IKEv2-Message is compatible to the
36 * ISAKMP-Header format to allow implementations supporting
37 * both versions of the IKE-protocol.
38 *
39 */
40 typedef struct ike_header_s ike_header_t;
41
42 struct ike_header_s{
43 /**
44 * SPI of the initiator
45 */
46 u_int64_t initiator_spi;
47 /**
48 * SPI of the responder
49 */
50 u_int64_t responder_spi;
51 /**
52 * next payload type
53 */
54 u_int8_t next_payload;
55 /**
56 * IKE major version
57 */
58 u_int8_t maj_version;
59
60 /**
61 * IKE minor version
62 */
63 u_int8_t min_version;
64
65 /**
66 * Exchange type
67 */
68 u_int8_t exchange_type;
69
70 /**
71 * Flags of the Message
72 *
73 */
74 struct {
75 /**
76 * Sender is initiator of the associated IKE_SA_INIT-Exchange
77 */
78 bool initiator;
79 /**
80 * is protocol supporting higher version?
81 */
82 bool version;
83 /**
84 * TRUE, if this is a response, FALSE if its a Request
85 */
86 bool response;
87 } flags;
88 /**
89 * Associated Message-ID
90 */
91 u_int32_t message_id;
92 /**
93 * Length of the whole IKEv2-Message (header and all payloads)
94 */
95 u_int32_t length;
96 };
97
98 #endif /*IKE_HEADER_H_*/