a427160ccb02a1d15d93ba61ab4cc9b115cc8367
[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 } status_t;
38
39 typedef enum ike_sa_role_e {
40 INITIATOR,
41 RESPONDER
42 } ike_sa_role_t;
43
44 typedef struct timeval timeval_t;
45
46 typedef struct timespec timespec_t;
47
48 /**
49 * Representates a IKE_SA spi
50 */
51 typedef struct spi_s spi_t;
52 struct spi_s{
53 u_int32_t high;
54 u_int32_t low;
55 };
56
57 /**
58 * General purpose pointer/length abstraction
59 */
60 typedef struct chunk_s chunk_t;
61 struct chunk_s {
62 u_char *ptr;
63 size_t len;
64 };
65
66 /**
67 * General purpose boolean type
68 */
69 typedef int bool;
70 #define FALSE 0
71 #define TRUE 1
72
73
74 #endif /*TYPES_H_*/