Debian Codegraph @

src/tls/utils.h

raw
1 /*
2 * Copyright (C) 2019 Red Hat, Inc.
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6 #pragma once
7
8 #include <stdio.h>
9
10 /* define to 1 to enable debug messages; very verbose! */
11 #define DEBUG 0
12
13 /* messages can be disabled per-domain */
14 #define DEBUG_POLL 0
15 #define DEBUG_BUFFER 0
16 #define DEBUG_IOVEC 0
17 #define DEBUG_CONNECTION 1
18 #define DEBUG_SERVER 1
19 #define DEBUG_FACTORY 1
20 #define DEBUG_SOCKET_IO 1
21
22 /* socket-activation-helper.c */
23 #define DEBUG_HELPER 1
24
25 /* cockpit-certificate-ensure.c */
26 #define DEBUG_ENSURE 1
27
28 /* testcases */
29 #define DEBUG_TESTS 1
30
31 #if DEBUG
32 #define debug(domain, fmt, ...) do if (DEBUG_##domain) fprintf (stderr, __FILE__ ": " fmt "\n", ##__VA_ARGS__); while (0)
33 #else
34 #define debug(...)
35 #endif
36
37 #define N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
38
39 #define SD_LISTEN_FDS_START 3 /* sd_listen_fds(3) */
40
41 #define SHA256_NIL "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
42 #define WSINSTANCE_MAX (64 + 1)
43