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