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