automake build system
[mech_eap.orig] / src / eap_common / eap_ikev2_common.h
1 /*
2  * EAP-IKEv2 definitions
3  * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #ifndef EAP_IKEV2_COMMON_H
16 #define EAP_IKEV2_COMMON_H
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #ifdef CCNS_PL
23 /* incorrect bit order */
24 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x01
25 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x02
26 #define IKEV2_FLAGS_ICV_INCLUDED 0x04
27 #else /* CCNS_PL */
28 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x80
29 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x40
30 #define IKEV2_FLAGS_ICV_INCLUDED 0x20
31 #endif /* CCNS_PL */
32
33 #define IKEV2_FRAGMENT_SIZE 1400
34
35 struct ikev2_keys;
36
37 int eap_ikev2_derive_keymat(int prf, struct ikev2_keys *keys,
38                             const u8 *i_nonce, size_t i_nonce_len,
39                             const u8 *r_nonce, size_t r_nonce_len,
40                             u8 *keymat);
41 struct wpabuf * eap_ikev2_build_frag_ack(u8 id, u8 code);
42 int eap_ikev2_validate_icv(int integ_alg, struct ikev2_keys *keys,
43                            int initiator, const struct wpabuf *msg,
44                            const u8 *pos, const u8 *end);
45
46 #ifdef __cplusplus
47 }
48 #endif
49
50 #endif /* EAP_IKEV2_COMMON_H */