eda2a0883741b101f5a97fd719a38023311b12f4
[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 #include <stdlib.h>
29
30 typedef enum status_e {
31 SUCCESS,
32 FAILED,
33 OUT_OF_RES,
34 ALREADY_DONE,
35 NOT_SUPPORTED,
36 INVALID_ARG,
37 NOT_FOUND,
38 PARSE_ERROR,
39 VERIFY_ERROR,
40 INVALID_STATE
41 } status_t;
42
43
44 typedef struct timeval timeval_t;
45
46 typedef struct timespec timespec_t;
47
48 typedef struct sockaddr sockaddr_t;
49
50 /**
51 * General purpose pointer/length abstraction
52 */
53 typedef struct chunk_s chunk_t;
54 struct chunk_s {
55 u_char *ptr;
56 size_t len;
57 };
58
59 /**
60 * General purpose boolean type
61 */
62 typedef int bool;
63 #define FALSE 0
64 #define TRUE 1
65
66
67 #endif /*TYPES_H_*/