- parser successfully parses an ike_header
[strongswan.git] / Source / charon / types.h
1 /**
2 * @file types.h
3 *
4 * @brief Generic type definitions
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23
24 #ifndef TYPES_H_
25 #define TYPES_H_
26
27 #include <sys/types.h>
28
29 typedef enum status_e {
30 SUCCESS,
31 FAILED,
32 OUT_OF_RES,
33 ALREADY_DONE,
34 NOT_SUPPORTED,
35 INVALID_ARG,
36 NOT_FOUND,
37 EXCHANGE_TYPE_NOT_SET,
38 } status_t;
39
40 typedef enum ike_sa_role_e {
41 INITIATOR,
42 RESPONDER
43 } ike_sa_role_t;
44
45 typedef struct timeval timeval_t;
46
47 typedef struct timespec timespec_t;
48
49 /**
50 * Representates a IKE_SA spi
51 */
52 typedef struct spi_s spi_t;
53 struct spi_s{
54 u_int32_t high;
55 u_int32_t low;
56 };
57
58 /**
59 * General purpose pointer/length abstraction
60 */
61 typedef struct chunk_s chunk_t;
62 struct chunk_s {
63 u_char *ptr;
64 size_t len;
65 };
66
67 /**
68 * General purpose boolean type
69 */
70 typedef int bool;
71 #define FALSE 0
72 #define TRUE 1
73
74
75 #endif /*TYPES_H_*/