fixed typo
[strongswan.git] / src / libstrongswan / printf_hook.h
1 /**
2 * @file printf_hook.h
3 *
4 * @brief Printf hook definitions and arginfo functions.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 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 #ifndef PRINTF_HOOK_H_
24 #define PRINTF_HOOK_H_
25
26 #include <printf.h>
27
28 /**
29 * Printf() hook characters.
30 * We define all characters here to have them on a central place.
31 */
32
33 /** 2 arguments: u_char *buffer, int size */
34 #define PRINTF_BYTES 'b'
35 /** 1 argument: chunk_t *chunk; use #-modifier to print inline */
36 #define PRINTF_CHUNK 'B'
37 /** 1 argument: identification_t *id */
38 #define PRINTF_IDENTIFICATION 'D'
39 /** 1 argumnet: host_t *host; use #-modifier to include port number */
40 #define PRINTF_HOST 'H'
41 /** 1 argument: ike_sa_id_t *id */
42 #define PRINTF_IKE_SA_ID 'J'
43 /** 1 argument: ike_sa_t *ike_sa */
44 #define PRINTF_IKE_SA 'K'
45 /** 1 argument: message_t *message */
46 #define PRINTF_MESSAGE 'M'
47 /** 2 arguments: enum_name_t *name, long value */
48 #define PRINTF_ENUM 'N'
49 /** 1 argument: child_sa_t *child_sa */
50 #define PRINTF_CHILD_SA 'P'
51 /** 1 argument: traffic_selector_t *ts */
52 #define PRINTF_TRAFFIC_SELECTOR 'R'
53 /** 1 argument: time_t *time; with #-modifier 2 arguments: time_t *time, bool utc */
54 #define PRINTF_TIME 'T'
55 /** 1 argument: x509_t *cert; with #-modifier 2 arguments: x509_t *cert, bool utc */
56 #define PRINTF_X509 'Q'
57 /** 1 argument: crl_t *crl; with #-modifier 2 arguments: crl_t *crl, bool utc */
58 #define PRINTF_CRL 'U'
59 /** 2 arguments: time_t *begin, time_t *end */
60 #define PRINTF_TIME_DELTA 'V'
61 /** 1 argument: ca_info_t *ca_info; with #-modifier 2 arguments: ca_info_t *ca_info, bool utc */
62 #define PRINTF_CAINFO 'W'
63
64 /**
65 * Generic arginfo handlers for printf() hooks
66 */
67 int arginfo_ptr(const struct printf_info *info, size_t n, int *argtypes);
68 int arginfo_ptr_ptr(const struct printf_info *info, size_t n, int *argtypes);
69 int arginfo_ptr_int(const struct printf_info *info, size_t n, int *argtypes);
70 int arginfo_int_int(const struct printf_info *info, size_t n, int *argtypes);
71 int arginfo_ptr_alt_ptr_int(const struct printf_info *info, size_t n, int *argtypes);
72 int arginfo_int_alt_int_int(const struct printf_info *info, size_t n, int *argtypes);
73
74 #endif /* PRINTF_HOOK_H_ */