diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/include | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/include')
118 files changed, 5005 insertions, 5506 deletions
diff --git a/src/include/block_dns.h b/src/include/block_dns.h index 399b34962..2e94e8c02 100644 --- a/src/include/block_dns.h +++ b/src/include/block_dns.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -37,8 +37,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
37 | /** | 37 | /** |
38 | * This is the structure describing an DNS exit service. | 38 | * This is the structure describing an DNS exit service. |
39 | */ | 39 | */ |
40 | struct GNUNET_DNS_Advertisement | 40 | struct GNUNET_DNS_Advertisement { |
41 | { | ||
42 | /** | 41 | /** |
43 | * Signature of the peer affirming that it is offering the service. | 42 | * Signature of the peer affirming that it is offering the service. |
44 | */ | 43 | */ |
@@ -59,7 +58,6 @@ struct GNUNET_DNS_Advertisement | |||
59 | * The peer providing this service | 58 | * The peer providing this service |
60 | */ | 59 | */ |
61 | struct GNUNET_PeerIdentity peer; | 60 | struct GNUNET_PeerIdentity peer; |
62 | |||
63 | }; | 61 | }; |
64 | GNUNET_NETWORK_STRUCT_END | 62 | GNUNET_NETWORK_STRUCT_END |
65 | 63 | ||
diff --git a/src/include/block_fs.h b/src/include/block_fs.h index b5c8d71d4..fb651909a 100644 --- a/src/include/block_fs.h +++ b/src/include/block_fs.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -47,9 +47,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
47 | /** | 47 | /** |
48 | * @brief universal block for keyword and namespace search results | 48 | * @brief universal block for keyword and namespace search results |
49 | */ | 49 | */ |
50 | struct UBlock | 50 | struct UBlock { |
51 | { | ||
52 | |||
53 | /** | 51 | /** |
54 | * Signature using pseudonym and search keyword / identifier. | 52 | * Signature using pseudonym and search keyword / identifier. |
55 | */ | 53 | */ |
@@ -72,7 +70,6 @@ struct UBlock | |||
72 | /* 0-terminated URI here */ | 70 | /* 0-terminated URI here */ |
73 | 71 | ||
74 | /* variable-size Meta-Data follows here */ | 72 | /* variable-size Meta-Data follows here */ |
75 | |||
76 | }; | 73 | }; |
77 | 74 | ||
78 | 75 | ||
@@ -81,8 +78,7 @@ struct UBlock | |||
81 | * can be obtained directly from reading | 78 | * can be obtained directly from reading |
82 | * the plaintext file) | 79 | * the plaintext file) |
83 | */ | 80 | */ |
84 | struct OnDemandBlock | 81 | struct OnDemandBlock { |
85 | { | ||
86 | /** | 82 | /** |
87 | * Hash code of the entire content of the | 83 | * Hash code of the entire content of the |
88 | * file that was indexed (used to uniquely | 84 | * file that was indexed (used to uniquely |
@@ -95,7 +91,6 @@ struct OnDemandBlock | |||
95 | * this on-demand encoded block? (in NBO) | 91 | * this on-demand encoded block? (in NBO) |
96 | */ | 92 | */ |
97 | uint64_t offset GNUNET_PACKED; | 93 | uint64_t offset GNUNET_PACKED; |
98 | |||
99 | }; | 94 | }; |
100 | GNUNET_NETWORK_STRUCT_END | 95 | GNUNET_NETWORK_STRUCT_END |
101 | 96 | ||
diff --git a/src/include/block_regex.h b/src/include/block_regex.h index 499655977..e29785cdf 100644 --- a/src/include/block_regex.h +++ b/src/include/block_regex.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file | 22 | * @file |
@@ -31,7 +31,7 @@ | |||
31 | extern "C" | 31 | extern "C" |
32 | { | 32 | { |
33 | #if 0 | 33 | #if 0 |
34 | /* keep Emacsens' auto-indent happy */ | 34 | /* keep Emacsens' auto-indent happy */ |
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | #endif | 37 | #endif |
@@ -46,9 +46,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
46 | /** | 46 | /** |
47 | * @brief Block to announce a peer accepting a state. | 47 | * @brief Block to announce a peer accepting a state. |
48 | */ | 48 | */ |
49 | struct RegexAcceptBlock | 49 | struct RegexAcceptBlock { |
50 | { | ||
51 | |||
52 | /** | 50 | /** |
53 | * Accept blocks must be signed. Signature | 51 | * Accept blocks must be signed. Signature |
54 | * goes over expiration time and key. | 52 | * goes over expiration time and key. |
diff --git a/src/include/compat.h b/src/include/compat.h index b24d09653..1a1103a81 100644 --- a/src/include/compat.h +++ b/src/include/compat.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Martin Schanzenbach | 22 | * @author Martin Schanzenbach |
@@ -33,7 +33,7 @@ extern "C" | |||
33 | { | 33 | { |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * memrchr as defined in glibc | 37 | * memrchr as defined in glibc |
38 | * | 38 | * |
39 | * @param s pointer to memory | 39 | * @param s pointer to memory |
@@ -41,11 +41,11 @@ extern "C" | |||
41 | * @param n search character limit | 41 | * @param n search character limit |
42 | */ | 42 | */ |
43 | void* | 43 | void* |
44 | GN_memrchr_ (const void *s, | 44 | GN_memrchr_(const void *s, |
45 | int c, | 45 | int c, |
46 | size_t n); | 46 | size_t n); |
47 | #ifndef HAVE_MEMRCHR | 47 | #ifndef HAVE_MEMRCHR |
48 | #define memrchr(s,c,n) GN_memrchr_(s,c,n) | 48 | #define memrchr(s, c, n) GN_memrchr_(s, c, n) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifdef __cplusplus | 51 | #ifdef __cplusplus |
diff --git a/src/include/gauger.h b/src/include/gauger.h index 54ba7f1f7..d23883742 100644 --- a/src/include/gauger.h +++ b/src/include/gauger.h | |||
@@ -17,67 +17,67 @@ | |||
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | #include <sys/wait.h> | 18 | #include <sys/wait.h> |
19 | 19 | ||
20 | #define GAUGER(category, counter, value, unit)\ | 20 | #define GAUGER(category, counter, value, unit) \ |
21 | {\ | 21 | { \ |
22 | char* __gauger_v[10];\ | 22 | char* __gauger_v[10]; \ |
23 | char __gauger_s[32];\ | 23 | char __gauger_s[32]; \ |
24 | pid_t __gauger_p;\ | 24 | pid_t __gauger_p; \ |
25 | if(!(__gauger_p=fork())){\ | 25 | if (!(__gauger_p = fork())) { \ |
26 | close (1); \ | 26 | close(1); \ |
27 | close (2); \ | 27 | close(2); \ |
28 | if(!fork()){\ | 28 | if (!fork()) { \ |
29 | sprintf(__gauger_s,"%Lf", (long double) (value));\ | 29 | sprintf(__gauger_s, "%Lf", (long double)(value)); \ |
30 | __gauger_v[0] = "gauger";\ | 30 | __gauger_v[0] = "gauger"; \ |
31 | __gauger_v[1] = "-n";\ | 31 | __gauger_v[1] = "-n"; \ |
32 | __gauger_v[2] = (char*) (counter); \ | 32 | __gauger_v[2] = (char*)(counter); \ |
33 | __gauger_v[3] = "-d";\ | 33 | __gauger_v[3] = "-d"; \ |
34 | __gauger_v[4] = __gauger_s;\ | 34 | __gauger_v[4] = __gauger_s; \ |
35 | __gauger_v[5] = "-u";\ | 35 | __gauger_v[5] = "-u"; \ |
36 | __gauger_v[6] = (char*) (unit); \ | 36 | __gauger_v[6] = (char*)(unit); \ |
37 | __gauger_v[7] = "-c";\ | 37 | __gauger_v[7] = "-c"; \ |
38 | __gauger_v[8] = (char*) (category); \ | 38 | __gauger_v[8] = (char*)(category); \ |
39 | __gauger_v[9] = (char*) NULL;\ | 39 | __gauger_v[9] = (char*)NULL; \ |
40 | execvp("gauger",__gauger_v);\ | 40 | execvp("gauger", __gauger_v); \ |
41 | _exit(1);\ | 41 | _exit(1); \ |
42 | }else{\ | 42 | }else{ \ |
43 | _exit(0);\ | 43 | _exit(0); \ |
44 | }\ | 44 | } \ |
45 | }else{\ | 45 | }else{ \ |
46 | waitpid(__gauger_p,NULL,0);\ | 46 | waitpid(__gauger_p, NULL, 0); \ |
47 | }\ | 47 | } \ |
48 | } | 48 | } |
49 | 49 | ||
50 | #define GAUGER_ID(category, counter, value, unit, id)\ | 50 | #define GAUGER_ID(category, counter, value, unit, id) \ |
51 | {\ | 51 | { \ |
52 | char* __gauger_v[12];\ | 52 | char* __gauger_v[12]; \ |
53 | char __gauger_s[32];\ | 53 | char __gauger_s[32]; \ |
54 | pid_t __gauger_p;\ | 54 | pid_t __gauger_p; \ |
55 | if(!(__gauger_p=fork())){\ | 55 | if (!(__gauger_p = fork())) { \ |
56 | close (1); \ | 56 | close(1); \ |
57 | close (2); \ | 57 | close(2); \ |
58 | if(!fork()){\ | 58 | if (!fork()) { \ |
59 | sprintf(__gauger_s,"%Lf", (long double) (value));\ | 59 | sprintf(__gauger_s, "%Lf", (long double)(value)); \ |
60 | __gauger_v[0] = "gauger";\ | 60 | __gauger_v[0] = "gauger"; \ |
61 | __gauger_v[1] = "-n";\ | 61 | __gauger_v[1] = "-n"; \ |
62 | __gauger_v[2] = (char*) (counter); \ | 62 | __gauger_v[2] = (char*)(counter); \ |
63 | __gauger_v[3] = "-d";\ | 63 | __gauger_v[3] = "-d"; \ |
64 | __gauger_v[4] = __gauger_s;\ | 64 | __gauger_v[4] = __gauger_s; \ |
65 | __gauger_v[5] = "-u";\ | 65 | __gauger_v[5] = "-u"; \ |
66 | __gauger_v[6] = (char*) (unit); \ | 66 | __gauger_v[6] = (char*)(unit); \ |
67 | __gauger_v[7] = "-i";\ | 67 | __gauger_v[7] = "-i"; \ |
68 | __gauger_v[8] = id;\ | 68 | __gauger_v[8] = id; \ |
69 | __gauger_v[9] = "-c";\ | 69 | __gauger_v[9] = "-c"; \ |
70 | __gauger_v[10] = (char *) (category); \ | 70 | __gauger_v[10] = (char *)(category); \ |
71 | __gauger_v[11] = (char *) NULL;\ | 71 | __gauger_v[11] = (char *)NULL; \ |
72 | execvp("gauger",__gauger_v);\ | 72 | execvp("gauger", __gauger_v); \ |
73 | _exit(1);\ | 73 | _exit(1); \ |
74 | }else{\ | 74 | }else{ \ |
75 | _exit(0);\ | 75 | _exit(0); \ |
76 | }\ | 76 | } \ |
77 | }else{\ | 77 | }else{ \ |
78 | waitpid(__gauger_p, NULL, 0);\ | 78 | waitpid(__gauger_p, NULL, 0); \ |
79 | }\ | 79 | } \ |
80 | } | 80 | } |
81 | 81 | ||
82 | #else /* WINDOWS */ | 82 | #else /* WINDOWS */ |
83 | 83 | ||
@@ -85,25 +85,25 @@ | |||
85 | #include <stdio.h> | 85 | #include <stdio.h> |
86 | #include <windef.h> | 86 | #include <windef.h> |
87 | 87 | ||
88 | #define GAUGER(category, counter, value, unit)\ | 88 | #define GAUGER(category, counter, value, unit) \ |
89 | {\ | 89 | { \ |
90 | char __gauger_commandline[MAX_PATH];\ | 90 | char __gauger_commandline[MAX_PATH]; \ |
91 | \ | 91 | \ |
92 | snprintf (__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -c \"%s\"",\ | 92 | snprintf(__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -c \"%s\"", \ |
93 | (counter), (long double) (value), (unit), (category)); \ | 93 | (counter), (long double)(value), (unit), (category)); \ |
94 | __gauger_commandline[MAX_PATH - 1] = '\0';\ | 94 | __gauger_commandline[MAX_PATH - 1] = '\0'; \ |
95 | system (__gauger_commandline);\ | 95 | system(__gauger_commandline); \ |
96 | } | 96 | } |
97 | 97 | ||
98 | #define GAUGER_ID(category, counter, value, unit, id)\ | 98 | #define GAUGER_ID(category, counter, value, unit, id) \ |
99 | {\ | 99 | { \ |
100 | char __gauger_commandline[MAX_PATH];\ | 100 | char __gauger_commandline[MAX_PATH]; \ |
101 | \ | 101 | \ |
102 | snprintf (__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -i \"%s\" -c \"%s\"",\ | 102 | snprintf(__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -i \"%s\" -c \"%s\"", \ |
103 | (counter), (long double) (value), (unit), (id), (category)); \ | 103 | (counter), (long double)(value), (unit), (id), (category)); \ |
104 | __gauger_commandline[MAX_PATH - 1] = '\0';\ | 104 | __gauger_commandline[MAX_PATH - 1] = '\0'; \ |
105 | system (__gauger_commandline);\ | 105 | system(__gauger_commandline); \ |
106 | } | 106 | } |
107 | 107 | ||
108 | #endif // WINDOWS | 108 | #endif // WINDOWS |
109 | 109 | ||
diff --git a/src/include/gettext.h b/src/include/gettext.h index 9a5be728f..1eb6cee93 100644 --- a/src/include/gettext.h +++ b/src/include/gettext.h | |||
@@ -42,20 +42,20 @@ | |||
42 | for invalid uses of the value returned from these functions. | 42 | for invalid uses of the value returned from these functions. |
43 | On pre-ANSI systems without 'const', the config.h file is supposed to | 43 | On pre-ANSI systems without 'const', the config.h file is supposed to |
44 | contain "#define const". */ | 44 | contain "#define const". */ |
45 | #define gettext(Msgid) ((const char *) (Msgid)) | 45 | #define gettext(Msgid) ((const char *)(Msgid)) |
46 | #define dgettext(Domainname, Msgid) ((const char *) (Msgid)) | 46 | #define dgettext(Domainname, Msgid) ((const char *)(Msgid)) |
47 | #define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) | 47 | #define dcgettext(Domainname, Msgid, Category) ((const char *)(Msgid)) |
48 | #define ngettext(Msgid1, Msgid2, N) \ | 48 | #define ngettext(Msgid1, Msgid2, N) \ |
49 | ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) | 49 | ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) |
50 | #define dngettext(Domainname, Msgid1, Msgid2, N) \ | 50 | #define dngettext(Domainname, Msgid1, Msgid2, N) \ |
51 | ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) | 51 | ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) |
52 | #define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ | 52 | #define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ |
53 | ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) | 53 | ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) |
54 | /* slight modification here to avoid warnings: generate GNUNET_NO code, | 54 | /* slight modification here to avoid warnings: generate GNUNET_NO code, |
55 | not even the cast... */ | 55 | not even the cast... */ |
56 | #define textdomain(Domainname) | 56 | #define textdomain(Domainname) |
57 | #define bindtextdomain(Domainname, Dirname) | 57 | #define bindtextdomain(Domainname, Dirname) |
58 | #define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) | 58 | #define bind_textdomain_codeset(Domainname, Codeset) ((const char *)(Codeset)) |
59 | 59 | ||
60 | #endif | 60 | #endif |
61 | 61 | ||
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h index 89129ea32..1988f4dec 100644 --- a/src/include/gnunet_abe_lib.h +++ b/src/include/gnunet_abe_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_abe_lib.h | 22 | * @file include/gnunet_abe_lib.h |
@@ -60,7 +60,7 @@ struct GNUNET_CRYPTO_AbeKey; | |||
60 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key | 60 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key |
61 | */ | 61 | */ |
62 | struct GNUNET_ABE_AbeMasterKey * | 62 | struct GNUNET_ABE_AbeMasterKey * |
63 | GNUNET_ABE_cpabe_create_master_key (void); | 63 | GNUNET_ABE_cpabe_create_master_key(void); |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * @ingroup abe | 66 | * @ingroup abe |
@@ -70,7 +70,7 @@ GNUNET_ABE_cpabe_create_master_key (void); | |||
70 | * @return fresh private key; free using #GNUNET_free | 70 | * @return fresh private key; free using #GNUNET_free |
71 | */ | 71 | */ |
72 | void | 72 | void |
73 | GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); | 73 | GNUNET_ABE_cpabe_delete_master_key(struct GNUNET_ABE_AbeMasterKey *key); |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * @ingroup abe | 76 | * @ingroup abe |
@@ -81,8 +81,8 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); | |||
81 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key | 81 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key |
82 | */ | 82 | */ |
83 | struct GNUNET_ABE_AbeKey * | 83 | struct GNUNET_ABE_AbeKey * |
84 | GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, | 84 | GNUNET_ABE_cpabe_create_key(struct GNUNET_ABE_AbeMasterKey *key, |
85 | char **attrs); | 85 | char **attrs); |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * @ingroup abe | 88 | * @ingroup abe |
@@ -93,8 +93,8 @@ GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, | |||
93 | * @return fresh private key; free using #GNUNET_free | 93 | * @return fresh private key; free using #GNUNET_free |
94 | */ | 94 | */ |
95 | void | 95 | void |
96 | GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | 96 | GNUNET_ABE_cpabe_delete_key(struct GNUNET_ABE_AbeKey *key, |
97 | int delete_pub); | 97 | int delete_pub); |
98 | 98 | ||
99 | 99 | ||
100 | /** | 100 | /** |
@@ -109,11 +109,11 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | |||
109 | * @return the size of the encrypted block, -1 for errors | 109 | * @return the size of the encrypted block, -1 for errors |
110 | */ | 110 | */ |
111 | ssize_t | 111 | ssize_t |
112 | GNUNET_ABE_cpabe_encrypt (const void *block, | 112 | GNUNET_ABE_cpabe_encrypt(const void *block, |
113 | size_t size, | 113 | size_t size, |
114 | const char *policy, | 114 | const char *policy, |
115 | const struct GNUNET_ABE_AbeMasterKey *key, | 115 | const struct GNUNET_ABE_AbeMasterKey *key, |
116 | void **result); | 116 | void **result); |
117 | 117 | ||
118 | /** | 118 | /** |
119 | * @ingroup abe | 119 | * @ingroup abe |
@@ -126,10 +126,10 @@ GNUNET_ABE_cpabe_encrypt (const void *block, | |||
126 | * @return the size of the encrypted block, -1 for errors | 126 | * @return the size of the encrypted block, -1 for errors |
127 | */ | 127 | */ |
128 | ssize_t | 128 | ssize_t |
129 | GNUNET_ABE_cpabe_decrypt (const void *block, | 129 | GNUNET_ABE_cpabe_decrypt(const void *block, |
130 | size_t size, | 130 | size_t size, |
131 | const struct GNUNET_ABE_AbeKey *key, | 131 | const struct GNUNET_ABE_AbeKey *key, |
132 | void **result); | 132 | void **result); |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * @ingroup abe | 135 | * @ingroup abe |
@@ -140,8 +140,8 @@ GNUNET_ABE_cpabe_decrypt (const void *block, | |||
140 | * @return the size of the encrypted block, -1 for errors | 140 | * @return the size of the encrypted block, -1 for errors |
141 | */ | 141 | */ |
142 | ssize_t | 142 | ssize_t |
143 | GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, | 143 | GNUNET_ABE_cpabe_serialize_key(const struct GNUNET_ABE_AbeKey *key, |
144 | void **result); | 144 | void **result); |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * @ingroup abe | 147 | * @ingroup abe |
@@ -152,8 +152,8 @@ GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, | |||
152 | * @return the ABE key. NULL of unsuccessful | 152 | * @return the ABE key. NULL of unsuccessful |
153 | */ | 153 | */ |
154 | struct GNUNET_ABE_AbeKey* | 154 | struct GNUNET_ABE_AbeKey* |
155 | GNUNET_ABE_cpabe_deserialize_key (const void *data, | 155 | GNUNET_ABE_cpabe_deserialize_key(const void *data, |
156 | size_t len); | 156 | size_t len); |
157 | 157 | ||
158 | /** | 158 | /** |
159 | * @ingroup abe | 159 | * @ingroup abe |
@@ -164,8 +164,8 @@ GNUNET_ABE_cpabe_deserialize_key (const void *data, | |||
164 | * @return the size of the encrypted block, -1 for errors | 164 | * @return the size of the encrypted block, -1 for errors |
165 | */ | 165 | */ |
166 | ssize_t | 166 | ssize_t |
167 | GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, | 167 | GNUNET_ABE_cpabe_serialize_master_key(const struct GNUNET_ABE_AbeMasterKey *key, |
168 | void **result); | 168 | void **result); |
169 | 169 | ||
170 | /** | 170 | /** |
171 | * @ingroup abe | 171 | * @ingroup abe |
@@ -176,8 +176,8 @@ GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key | |||
176 | * @return the ABE key. NULL of unsuccessful | 176 | * @return the ABE key. NULL of unsuccessful |
177 | */ | 177 | */ |
178 | struct GNUNET_ABE_AbeMasterKey* | 178 | struct GNUNET_ABE_AbeMasterKey* |
179 | GNUNET_ABE_cpabe_deserialize_master_key (const void *data, | 179 | GNUNET_ABE_cpabe_deserialize_master_key(const void *data, |
180 | size_t len); | 180 | size_t len); |
181 | 181 | ||
182 | 182 | ||
183 | #if 0 /* keep Emacsens' auto-indent happy */ | 183 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_applications.h b/src/include/gnunet_applications.h index 493e1f53e..1e2ac59f7 100644 --- a/src/include/gnunet_applications.h +++ b/src/include/gnunet_applications.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 1f9d250d0..faf89128f 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -54,8 +54,7 @@ extern "C" | |||
54 | /** | 54 | /** |
55 | * Statuses of the requests that client can send to ARM. | 55 | * Statuses of the requests that client can send to ARM. |
56 | */ | 56 | */ |
57 | enum GNUNET_ARM_RequestStatus | 57 | enum GNUNET_ARM_RequestStatus { |
58 | { | ||
59 | /** | 58 | /** |
60 | * Message was sent successfully. | 59 | * Message was sent successfully. |
61 | */ | 60 | */ |
@@ -65,15 +64,13 @@ enum GNUNET_ARM_RequestStatus | |||
65 | * We disconnected from ARM, and request was not sent. | 64 | * We disconnected from ARM, and request was not sent. |
66 | */ | 65 | */ |
67 | GNUNET_ARM_REQUEST_DISCONNECTED = 2 | 66 | GNUNET_ARM_REQUEST_DISCONNECTED = 2 |
68 | |||
69 | }; | 67 | }; |
70 | 68 | ||
71 | 69 | ||
72 | /** | 70 | /** |
73 | * Statuses of services. | 71 | * Statuses of services. |
74 | */ | 72 | */ |
75 | enum GNUNET_ARM_ServiceStatus | 73 | enum GNUNET_ARM_ServiceStatus { |
76 | { | ||
77 | /** | 74 | /** |
78 | * Dummy message. | 75 | * Dummy message. |
79 | */ | 76 | */ |
@@ -99,8 +96,7 @@ enum GNUNET_ARM_ServiceStatus | |||
99 | /** | 96 | /** |
100 | * Replies to ARM requests | 97 | * Replies to ARM requests |
101 | */ | 98 | */ |
102 | enum GNUNET_ARM_Result | 99 | enum GNUNET_ARM_Result { |
103 | { | ||
104 | /** | 100 | /** |
105 | * Service was stopped (never sent for ARM itself). | 101 | * Service was stopped (never sent for ARM itself). |
106 | */ | 102 | */ |
@@ -222,9 +218,9 @@ typedef void | |||
222 | * @return context to use for further ARM operations, NULL on error. | 218 | * @return context to use for further ARM operations, NULL on error. |
223 | */ | 219 | */ |
224 | struct GNUNET_ARM_Handle * | 220 | struct GNUNET_ARM_Handle * |
225 | GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 221 | GNUNET_ARM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
226 | GNUNET_ARM_ConnectionStatusCallback conn_status, | 222 | GNUNET_ARM_ConnectionStatusCallback conn_status, |
227 | void *conn_status_cls); | 223 | void *conn_status_cls); |
228 | 224 | ||
229 | 225 | ||
230 | /** | 226 | /** |
@@ -233,7 +229,7 @@ GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
233 | * @param h the handle that was being used | 229 | * @param h the handle that was being used |
234 | */ | 230 | */ |
235 | void | 231 | void |
236 | GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | 232 | GNUNET_ARM_disconnect(struct GNUNET_ARM_Handle *h); |
237 | 233 | ||
238 | 234 | ||
239 | /** | 235 | /** |
@@ -243,7 +239,7 @@ GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | |||
243 | * @param op operation to cancel | 239 | * @param op operation to cancel |
244 | */ | 240 | */ |
245 | void | 241 | void |
246 | GNUNET_ARM_operation_cancel (struct GNUNET_ARM_Operation *op); | 242 | GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op); |
247 | 243 | ||
248 | 244 | ||
249 | /** | 245 | /** |
@@ -255,9 +251,9 @@ GNUNET_ARM_operation_cancel (struct GNUNET_ARM_Operation *op); | |||
255 | * @return handle for the operation, NULL on error | 251 | * @return handle for the operation, NULL on error |
256 | */ | 252 | */ |
257 | struct GNUNET_ARM_Operation * | 253 | struct GNUNET_ARM_Operation * |
258 | GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, | 254 | GNUNET_ARM_request_service_list(struct GNUNET_ARM_Handle *h, |
259 | GNUNET_ARM_ServiceListCallback cont, | 255 | GNUNET_ARM_ServiceListCallback cont, |
260 | void *cont_cls); | 256 | void *cont_cls); |
261 | 257 | ||
262 | 258 | ||
263 | /** | 259 | /** |
@@ -275,10 +271,10 @@ GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, | |||
275 | * @return handle for the operation, NULL on error | 271 | * @return handle for the operation, NULL on error |
276 | */ | 272 | */ |
277 | struct GNUNET_ARM_Operation * | 273 | struct GNUNET_ARM_Operation * |
278 | GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, | 274 | GNUNET_ARM_request_service_stop(struct GNUNET_ARM_Handle *h, |
279 | const char *service_name, | 275 | const char *service_name, |
280 | GNUNET_ARM_ResultCallback cont, | 276 | GNUNET_ARM_ResultCallback cont, |
281 | void *cont_cls); | 277 | void *cont_cls); |
282 | 278 | ||
283 | 279 | ||
284 | /** | 280 | /** |
@@ -292,11 +288,11 @@ GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, | |||
292 | * @return handle for the operation, NULL on error | 288 | * @return handle for the operation, NULL on error |
293 | */ | 289 | */ |
294 | struct GNUNET_ARM_Operation * | 290 | struct GNUNET_ARM_Operation * |
295 | GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, | 291 | GNUNET_ARM_request_service_start(struct GNUNET_ARM_Handle *h, |
296 | const char *service_name, | 292 | const char *service_name, |
297 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 293 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
298 | GNUNET_ARM_ResultCallback cont, | 294 | GNUNET_ARM_ResultCallback cont, |
299 | void *cont_cls); | 295 | void *cont_cls); |
300 | 296 | ||
301 | 297 | ||
302 | /** | 298 | /** |
@@ -330,9 +326,9 @@ typedef void | |||
330 | * @return context to use for further ARM monitor operations, NULL on error. | 326 | * @return context to use for further ARM monitor operations, NULL on error. |
331 | */ | 327 | */ |
332 | struct GNUNET_ARM_MonitorHandle * | 328 | struct GNUNET_ARM_MonitorHandle * |
333 | GNUNET_ARM_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 329 | GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
334 | GNUNET_ARM_ServiceStatusCallback cont, | 330 | GNUNET_ARM_ServiceStatusCallback cont, |
335 | void *cont_cls); | 331 | void *cont_cls); |
336 | 332 | ||
337 | 333 | ||
338 | /** | 334 | /** |
@@ -341,7 +337,7 @@ GNUNET_ARM_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
341 | * @param h the handle that was being used | 337 | * @param h the handle that was being used |
342 | */ | 338 | */ |
343 | void | 339 | void |
344 | GNUNET_ARM_monitor_stop (struct GNUNET_ARM_MonitorHandle *h); | 340 | GNUNET_ARM_monitor_stop(struct GNUNET_ARM_MonitorHandle *h); |
345 | 341 | ||
346 | #if 0 /* keep Emacsens' auto-indent happy */ | 342 | #if 0 /* keep Emacsens' auto-indent happy */ |
347 | { | 343 | { |
diff --git a/src/include/gnunet_ats_application_service.h b/src/include/gnunet_ats_application_service.h index fbc6f48ac..f11807f22 100644 --- a/src/include/gnunet_ats_application_service.h +++ b/src/include/gnunet_ats_application_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. | 3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -51,7 +51,7 @@ struct GNUNET_ATS_ApplicationHandle; | |||
51 | * @return ats application handle, NULL on error | 51 | * @return ats application handle, NULL on error |
52 | */ | 52 | */ |
53 | struct GNUNET_ATS_ApplicationHandle * | 53 | struct GNUNET_ATS_ApplicationHandle * |
54 | GNUNET_ATS_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg); | 54 | GNUNET_ATS_application_init(const struct GNUNET_CONFIGURATION_Handle *cfg); |
55 | 55 | ||
56 | 56 | ||
57 | /** | 57 | /** |
@@ -60,7 +60,7 @@ GNUNET_ATS_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
60 | * @param ch handle to destroy | 60 | * @param ch handle to destroy |
61 | */ | 61 | */ |
62 | void | 62 | void |
63 | GNUNET_ATS_application_done (struct GNUNET_ATS_ApplicationHandle *ch); | 63 | GNUNET_ATS_application_done(struct GNUNET_ATS_ApplicationHandle *ch); |
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
@@ -82,10 +82,10 @@ struct GNUNET_ATS_ApplicationSuggestHandle; | |||
82 | * @return suggestion handle, NULL if request is already pending | 82 | * @return suggestion handle, NULL if request is already pending |
83 | */ | 83 | */ |
84 | struct GNUNET_ATS_ApplicationSuggestHandle * | 84 | struct GNUNET_ATS_ApplicationSuggestHandle * |
85 | GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch, | 85 | GNUNET_ATS_application_suggest(struct GNUNET_ATS_ApplicationHandle *ch, |
86 | const struct GNUNET_PeerIdentity *peer, | 86 | const struct GNUNET_PeerIdentity *peer, |
87 | enum GNUNET_MQ_PreferenceKind pk, | 87 | enum GNUNET_MQ_PreferenceKind pk, |
88 | struct GNUNET_BANDWIDTH_Value32NBO bw); | 88 | struct GNUNET_BANDWIDTH_Value32NBO bw); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
@@ -94,7 +94,7 @@ GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch, | |||
94 | * @param sh handle | 94 | * @param sh handle |
95 | */ | 95 | */ |
96 | void | 96 | void |
97 | GNUNET_ATS_application_suggest_cancel (struct GNUNET_ATS_ApplicationSuggestHandle *sh); | 97 | GNUNET_ATS_application_suggest_cancel(struct GNUNET_ATS_ApplicationSuggestHandle *sh); |
98 | 98 | ||
99 | /** @} */ /* end of group */ | 99 | /** @} */ /* end of group */ |
100 | 100 | ||
diff --git a/src/include/gnunet_ats_plugin.h b/src/include/gnunet_ats_plugin.h index da00f277c..e2f052678 100644 --- a/src/include/gnunet_ats_plugin.h +++ b/src/include/gnunet_ats_plugin.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2009-2015 GNUnet e.V. | 3 | Copyright (C) 2009-2015 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -163,9 +163,7 @@ typedef void | |||
163 | * Each solver is required to set up and return an instance | 163 | * Each solver is required to set up and return an instance |
164 | * of this struct during initialization. | 164 | * of this struct during initialization. |
165 | */ | 165 | */ |
166 | struct GNUNET_ATS_SolverFunctions | 166 | struct GNUNET_ATS_SolverFunctions { |
167 | { | ||
168 | |||
169 | /** | 167 | /** |
170 | * Closure to pass to all solver functions in this struct. | 168 | * Closure to pass to all solver functions in this struct. |
171 | */ | 169 | */ |
@@ -248,8 +246,7 @@ struct GNUNET_ATS_SolverFunctions | |||
248 | * #GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP | 246 | * #GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP |
249 | * | 247 | * |
250 | */ | 248 | */ |
251 | enum GAS_Solver_Operation | 249 | enum GAS_Solver_Operation { |
252 | { | ||
253 | /** | 250 | /** |
254 | * A solution iteration has been started | 251 | * A solution iteration has been started |
255 | */ | 252 | */ |
@@ -311,8 +308,7 @@ enum GAS_Solver_Operation | |||
311 | /** | 308 | /** |
312 | * Status of a GAS_Solver_Operation operation | 309 | * Status of a GAS_Solver_Operation operation |
313 | */ | 310 | */ |
314 | enum GAS_Solver_Status | 311 | enum GAS_Solver_Status { |
315 | { | ||
316 | /** | 312 | /** |
317 | * Success | 313 | * Success |
318 | */ | 314 | */ |
@@ -328,8 +324,7 @@ enum GAS_Solver_Status | |||
328 | /** | 324 | /** |
329 | * Status of the operation | 325 | * Status of the operation |
330 | */ | 326 | */ |
331 | enum GAS_Solver_Additional_Information | 327 | enum GAS_Solver_Additional_Information { |
332 | { | ||
333 | /** | 328 | /** |
334 | * No more specific information | 329 | * No more specific information |
335 | */ | 330 | */ |
@@ -416,8 +411,7 @@ typedef unsigned int | |||
416 | * of this type as to the initialization function | 411 | * of this type as to the initialization function |
417 | * of the ATS plugins. | 412 | * of the ATS plugins. |
418 | */ | 413 | */ |
419 | struct GNUNET_ATS_PluginEnvironment | 414 | struct GNUNET_ATS_PluginEnvironment { |
420 | { | ||
421 | /** | 415 | /** |
422 | * Configuration handle to be used by the solver | 416 | * Configuration handle to be used by the solver |
423 | */ | 417 | */ |
diff --git a/src/include/gnunet_ats_plugin_new.h b/src/include/gnunet_ats_plugin_new.h index 633343272..f9005ee73 100644 --- a/src/include/gnunet_ats_plugin_new.h +++ b/src/include/gnunet_ats_plugin_new.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2009-2015, 2018 GNUnet e.V. | 3 | Copyright (C) 2009-2015, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -47,7 +47,6 @@ | |||
47 | * Preference being expressed by an application client. | 47 | * Preference being expressed by an application client. |
48 | */ | 48 | */ |
49 | struct GNUNET_ATS_Preference { | 49 | struct GNUNET_ATS_Preference { |
50 | |||
51 | /** | 50 | /** |
52 | * Peer to get address suggestions for. | 51 | * Peer to get address suggestions for. |
53 | */ | 52 | */ |
@@ -74,7 +73,6 @@ struct GNUNET_ATS_Session; | |||
74 | * Plugin-relevant information about a session. | 73 | * Plugin-relevant information about a session. |
75 | */ | 74 | */ |
76 | struct GNUNET_ATS_SessionData { | 75 | struct GNUNET_ATS_SessionData { |
77 | |||
78 | /** | 76 | /** |
79 | * Peer the session is with. | 77 | * Peer the session is with. |
80 | */ | 78 | */ |
@@ -89,12 +87,11 @@ struct GNUNET_ATS_SessionData { | |||
89 | * Handle to the session that has the given properties. | 87 | * Handle to the session that has the given properties. |
90 | */ | 88 | */ |
91 | struct GNUNET_ATS_Session *session; | 89 | struct GNUNET_ATS_Session *session; |
92 | 90 | ||
93 | /** | 91 | /** |
94 | * Is the session inbound only? | 92 | * Is the session inbound only? |
95 | */ | 93 | */ |
96 | int inbound_only; | 94 | int inbound_only; |
97 | |||
98 | }; | 95 | }; |
99 | 96 | ||
100 | /** | 97 | /** |
@@ -116,9 +113,7 @@ struct GNUNET_ATS_SessionHandle; | |||
116 | * Each solver is required to set up and return an instance | 113 | * Each solver is required to set up and return an instance |
117 | * of this struct during initialization. | 114 | * of this struct during initialization. |
118 | */ | 115 | */ |
119 | struct GNUNET_ATS_SolverFunctions | 116 | struct GNUNET_ATS_SolverFunctions { |
120 | { | ||
121 | |||
122 | /** | 117 | /** |
123 | * Closure to pass to all solver functions in this struct. | 118 | * Closure to pass to all solver functions in this struct. |
124 | */ | 119 | */ |
@@ -133,20 +128,20 @@ struct GNUNET_ATS_SolverFunctions | |||
133 | */ | 128 | */ |
134 | struct GNUNET_ATS_PreferenceHandle * | 129 | struct GNUNET_ATS_PreferenceHandle * |
135 | (*preference_add)(void *cls, | 130 | (*preference_add)(void *cls, |
136 | const struct GNUNET_ATS_Preference *pref); | 131 | const struct GNUNET_ATS_Preference *pref); |
137 | 132 | ||
138 | /** | 133 | /** |
139 | * The plugin should end respecting a preference. | 134 | * The plugin should end respecting a preference. |
140 | * | 135 | * |
141 | * @param cls the closure | 136 | * @param cls the closure |
142 | * @param ph whatever @e preference_add returned | 137 | * @param ph whatever @e preference_add returned |
143 | * @param pref the preference to delete | 138 | * @param pref the preference to delete |
144 | * @return plugin's internal representation, or NULL | 139 | * @return plugin's internal representation, or NULL |
145 | */ | 140 | */ |
146 | void | 141 | void |
147 | (*preference_del)(void *cls, | 142 | (*preference_del)(void *cls, |
148 | struct GNUNET_ATS_PreferenceHandle *ph, | 143 | struct GNUNET_ATS_PreferenceHandle *ph, |
149 | const struct GNUNET_ATS_Preference *pref); | 144 | const struct GNUNET_ATS_Preference *pref); |
150 | 145 | ||
151 | /** | 146 | /** |
152 | * Transport established a new session with performance | 147 | * Transport established a new session with performance |
@@ -159,8 +154,8 @@ struct GNUNET_ATS_SolverFunctions | |||
159 | */ | 154 | */ |
160 | struct GNUNET_ATS_SessionHandle * | 155 | struct GNUNET_ATS_SessionHandle * |
161 | (*session_add)(void *cls, | 156 | (*session_add)(void *cls, |
162 | const struct GNUNET_ATS_SessionData *data, | 157 | const struct GNUNET_ATS_SessionData *data, |
163 | const char *address); | 158 | const char *address); |
164 | 159 | ||
165 | /** | 160 | /** |
166 | * @a data changed for a given @a sh, solver should consider | 161 | * @a data changed for a given @a sh, solver should consider |
@@ -172,8 +167,8 @@ struct GNUNET_ATS_SolverFunctions | |||
172 | */ | 167 | */ |
173 | void | 168 | void |
174 | (*session_update)(void *cls, | 169 | (*session_update)(void *cls, |
175 | struct GNUNET_ATS_SessionHandle *sh, | 170 | struct GNUNET_ATS_SessionHandle *sh, |
176 | const struct GNUNET_ATS_SessionData *data); | 171 | const struct GNUNET_ATS_SessionData *data); |
177 | 172 | ||
178 | /** | 173 | /** |
179 | * A session went away. Solver should update accordingly. | 174 | * A session went away. Solver should update accordingly. |
@@ -184,9 +179,8 @@ struct GNUNET_ATS_SolverFunctions | |||
184 | */ | 179 | */ |
185 | void | 180 | void |
186 | (*session_del)(void *cls, | 181 | (*session_del)(void *cls, |
187 | struct GNUNET_ATS_SessionHandle *sh, | 182 | struct GNUNET_ATS_SessionHandle *sh, |
188 | const struct GNUNET_ATS_SessionData *data); | 183 | const struct GNUNET_ATS_SessionData *data); |
189 | |||
190 | }; | 184 | }; |
191 | 185 | ||
192 | 186 | ||
@@ -195,8 +189,7 @@ struct GNUNET_ATS_SolverFunctions | |||
195 | * of this type as to the initialization function | 189 | * of this type as to the initialization function |
196 | * of the ATS plugins. | 190 | * of the ATS plugins. |
197 | */ | 191 | */ |
198 | struct GNUNET_ATS_PluginEnvironment | 192 | struct GNUNET_ATS_PluginEnvironment { |
199 | { | ||
200 | /** | 193 | /** |
201 | * Configuration handle to be used by the solver | 194 | * Configuration handle to be used by the solver |
202 | */ | 195 | */ |
@@ -222,11 +215,11 @@ struct GNUNET_ATS_PluginEnvironment | |||
222 | */ | 215 | */ |
223 | void | 216 | void |
224 | (*suggest_cb) (void *cls, | 217 | (*suggest_cb) (void *cls, |
225 | const struct GNUNET_PeerIdentity *pid, | 218 | const struct GNUNET_PeerIdentity *pid, |
226 | const char *address); | 219 | const char *address); |
227 | 220 | ||
228 | /** | 221 | /** |
229 | * Tell the transport that it should allocate the given | 222 | * Tell the transport that it should allocate the given |
230 | * bandwidth to the specified session. | 223 | * bandwidth to the specified session. |
231 | * | 224 | * |
232 | * @param cls closure, NULL | 225 | * @param cls closure, NULL |
@@ -237,15 +230,14 @@ struct GNUNET_ATS_PluginEnvironment | |||
237 | */ | 230 | */ |
238 | void | 231 | void |
239 | (*allocate_cb) (void *cls, | 232 | (*allocate_cb) (void *cls, |
240 | struct GNUNET_ATS_Session *session, | 233 | struct GNUNET_ATS_Session *session, |
241 | const struct GNUNET_PeerIdentity *peer, | 234 | const struct GNUNET_PeerIdentity *peer, |
242 | struct GNUNET_BANDWIDTH_Value32NBO bw_in, | 235 | struct GNUNET_BANDWIDTH_Value32NBO bw_in, |
243 | struct GNUNET_BANDWIDTH_Value32NBO bw_out); | 236 | struct GNUNET_BANDWIDTH_Value32NBO bw_out); |
244 | |||
245 | }; | 237 | }; |
246 | 238 | ||
247 | 239 | ||
248 | 240 | ||
249 | #endif | 241 | #endif |
250 | 242 | ||
251 | /** @} */ /* end of group */ | 243 | /** @} */ /* end of group */ |
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 7ea624f5e..a226c7b55 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015 GNUnet e.V. | 3 | Copyright (C) 2010-2015 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -68,9 +68,7 @@ | |||
68 | /** | 68 | /** |
69 | * ATS performance characteristics for an address. | 69 | * ATS performance characteristics for an address. |
70 | */ | 70 | */ |
71 | struct GNUNET_ATS_Properties | 71 | struct GNUNET_ATS_Properties { |
72 | { | ||
73 | |||
74 | /** | 72 | /** |
75 | * Delay. Time between when the time packet is sent and the packet | 73 | * Delay. Time between when the time packet is sent and the packet |
76 | * arrives. FOREVER if we did not measure yet. | 74 | * arrives. FOREVER if we did not measure yet. |
@@ -104,7 +102,6 @@ struct GNUNET_ATS_Properties | |||
104 | * This property does not change. | 102 | * This property does not change. |
105 | */ | 103 | */ |
106 | enum GNUNET_NetworkType scope; | 104 | enum GNUNET_NetworkType scope; |
107 | |||
108 | }; | 105 | }; |
109 | 106 | ||
110 | 107 | ||
@@ -112,9 +109,7 @@ struct GNUNET_ATS_Properties | |||
112 | * ATS performance characteristics for an address in | 109 | * ATS performance characteristics for an address in |
113 | * network byte order (for IPC). | 110 | * network byte order (for IPC). |
114 | */ | 111 | */ |
115 | struct GNUNET_ATS_PropertiesNBO | 112 | struct GNUNET_ATS_PropertiesNBO { |
116 | { | ||
117 | |||
118 | /** | 113 | /** |
119 | * Actual traffic on this connection from this peer to the other peer. | 114 | * Actual traffic on this connection from this peer to the other peer. |
120 | * Includes transport overhead. | 115 | * Includes transport overhead. |
@@ -148,7 +143,6 @@ struct GNUNET_ATS_PropertiesNBO | |||
148 | * arrives. FOREVER if we did not measure yet. | 143 | * arrives. FOREVER if we did not measure yet. |
149 | */ | 144 | */ |
150 | struct GNUNET_TIME_RelativeNBO delay; | 145 | struct GNUNET_TIME_RelativeNBO delay; |
151 | |||
152 | }; | 146 | }; |
153 | 147 | ||
154 | 148 | ||
@@ -164,8 +158,8 @@ struct GNUNET_ATS_PropertiesNBO | |||
164 | * @param hbo value read | 158 | * @param hbo value read |
165 | */ | 159 | */ |
166 | void | 160 | void |
167 | GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo, | 161 | GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo, |
168 | const struct GNUNET_ATS_Properties *hbo); | 162 | const struct GNUNET_ATS_Properties *hbo); |
169 | 163 | ||
170 | 164 | ||
171 | /** | 165 | /** |
@@ -175,8 +169,8 @@ GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo, | |||
175 | * @param nbo value read | 169 | * @param nbo value read |
176 | */ | 170 | */ |
177 | void | 171 | void |
178 | GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo, | 172 | GNUNET_ATS_properties_ntoh(struct GNUNET_ATS_Properties *hbo, |
179 | const struct GNUNET_ATS_PropertiesNBO *nbo); | 173 | const struct GNUNET_ATS_PropertiesNBO *nbo); |
180 | 174 | ||
181 | 175 | ||
182 | 176 | ||
@@ -201,7 +195,7 @@ struct GNUNET_ATS_ConnectivitySuggestHandle; | |||
201 | * @return ats connectivity handle, NULL on error | 195 | * @return ats connectivity handle, NULL on error |
202 | */ | 196 | */ |
203 | struct GNUNET_ATS_ConnectivityHandle * | 197 | struct GNUNET_ATS_ConnectivityHandle * |
204 | GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg); | 198 | GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg); |
205 | 199 | ||
206 | 200 | ||
207 | /** | 201 | /** |
@@ -210,7 +204,7 @@ GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
210 | * @param ch handle to destroy | 204 | * @param ch handle to destroy |
211 | */ | 205 | */ |
212 | void | 206 | void |
213 | GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch); | 207 | GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch); |
214 | 208 | ||
215 | 209 | ||
216 | /** | 210 | /** |
@@ -223,9 +217,9 @@ GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch); | |||
223 | * @return suggestion handle, NULL if request is already pending | 217 | * @return suggestion handle, NULL if request is already pending |
224 | */ | 218 | */ |
225 | struct GNUNET_ATS_ConnectivitySuggestHandle * | 219 | struct GNUNET_ATS_ConnectivitySuggestHandle * |
226 | GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, | 220 | GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, |
227 | const struct GNUNET_PeerIdentity *peer, | 221 | const struct GNUNET_PeerIdentity *peer, |
228 | uint32_t strength); | 222 | uint32_t strength); |
229 | 223 | ||
230 | 224 | ||
231 | /** | 225 | /** |
@@ -234,7 +228,7 @@ GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, | |||
234 | * @param sh handle | 228 | * @param sh handle |
235 | */ | 229 | */ |
236 | void | 230 | void |
237 | GNUNET_ATS_connectivity_suggest_cancel (struct GNUNET_ATS_ConnectivitySuggestHandle *sh); | 231 | GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh); |
238 | 232 | ||
239 | 233 | ||
240 | /* ******************************** Scheduling API ***************************** */ | 234 | /* ******************************** Scheduling API ***************************** */ |
@@ -284,9 +278,9 @@ typedef void | |||
284 | * @return ats context | 278 | * @return ats context |
285 | */ | 279 | */ |
286 | struct GNUNET_ATS_SchedulingHandle * | 280 | struct GNUNET_ATS_SchedulingHandle * |
287 | GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 281 | GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg, |
288 | GNUNET_ATS_AddressSuggestionCallback suggest_cb, | 282 | GNUNET_ATS_AddressSuggestionCallback suggest_cb, |
289 | void *suggest_cb_cls); | 283 | void *suggest_cb_cls); |
290 | 284 | ||
291 | 285 | ||
292 | /** | 286 | /** |
@@ -295,7 +289,7 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
295 | * @param sh handle to release | 289 | * @param sh handle to release |
296 | */ | 290 | */ |
297 | void | 291 | void |
298 | GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh); | 292 | GNUNET_ATS_scheduling_done(struct GNUNET_ATS_SchedulingHandle *sh); |
299 | 293 | ||
300 | 294 | ||
301 | /** | 295 | /** |
@@ -317,10 +311,10 @@ struct GNUNET_ATS_AddressRecord; | |||
317 | * address is invalid) | 311 | * address is invalid) |
318 | */ | 312 | */ |
319 | struct GNUNET_ATS_AddressRecord * | 313 | struct GNUNET_ATS_AddressRecord * |
320 | GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, | 314 | GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh, |
321 | const struct GNUNET_HELLO_Address *address, | 315 | const struct GNUNET_HELLO_Address *address, |
322 | struct GNUNET_ATS_Session *session, | 316 | struct GNUNET_ATS_Session *session, |
323 | const struct GNUNET_ATS_Properties *prop); | 317 | const struct GNUNET_ATS_Properties *prop); |
324 | 318 | ||
325 | 319 | ||
326 | /** | 320 | /** |
@@ -330,8 +324,8 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, | |||
330 | * @param session session handle | 324 | * @param session session handle |
331 | */ | 325 | */ |
332 | void | 326 | void |
333 | GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, | 327 | GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar, |
334 | struct GNUNET_ATS_Session *session); | 328 | struct GNUNET_ATS_Session *session); |
335 | 329 | ||
336 | 330 | ||
337 | /** | 331 | /** |
@@ -347,8 +341,8 @@ GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, | |||
347 | * use it still to establish a new session | 341 | * use it still to establish a new session |
348 | */ | 342 | */ |
349 | int | 343 | int |
350 | GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, | 344 | GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar, |
351 | struct GNUNET_ATS_Session *session); | 345 | struct GNUNET_ATS_Session *session); |
352 | 346 | ||
353 | 347 | ||
354 | /** | 348 | /** |
@@ -365,8 +359,8 @@ GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, | |||
365 | * @param prop performance data for the address | 359 | * @param prop performance data for the address |
366 | */ | 360 | */ |
367 | void | 361 | void |
368 | GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, | 362 | GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar, |
369 | const struct GNUNET_ATS_Properties *prop); | 363 | const struct GNUNET_ATS_Properties *prop); |
370 | 364 | ||
371 | 365 | ||
372 | /** | 366 | /** |
@@ -376,7 +370,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, | |||
376 | * expired and ATS may no longer use it | 370 | * expired and ATS may no longer use it |
377 | */ | 371 | */ |
378 | void | 372 | void |
379 | GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar); | 373 | GNUNET_ATS_address_destroy(struct GNUNET_ATS_AddressRecord *ar); |
380 | 374 | ||
381 | 375 | ||
382 | 376 | ||
@@ -422,14 +416,14 @@ struct GNUNET_ATS_AddressListHandle; | |||
422 | * | 416 | * |
423 | * @param cfg configuration to use | 417 | * @param cfg configuration to use |
424 | * @param addr_info_cb callback called when performance characteristics for | 418 | * @param addr_info_cb callback called when performance characteristics for |
425 | * an address change | 419 | * an address change |
426 | * @param addr_info_cb_cls closure for @a addr_info_cb | 420 | * @param addr_info_cb_cls closure for @a addr_info_cb |
427 | * @return ats performance context | 421 | * @return ats performance context |
428 | */ | 422 | */ |
429 | struct GNUNET_ATS_PerformanceHandle * | 423 | struct GNUNET_ATS_PerformanceHandle * |
430 | GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 424 | GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, |
431 | GNUNET_ATS_AddressInformationCallback addr_info_cb, | 425 | GNUNET_ATS_AddressInformationCallback addr_info_cb, |
432 | void *addr_info_cb_cls); | 426 | void *addr_info_cb_cls); |
433 | 427 | ||
434 | 428 | ||
435 | /** | 429 | /** |
@@ -445,11 +439,11 @@ GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
445 | * @return handle to abort the operation | 439 | * @return handle to abort the operation |
446 | */ | 440 | */ |
447 | struct GNUNET_ATS_AddressListHandle * | 441 | struct GNUNET_ATS_AddressListHandle * |
448 | GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph, | 442 | GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph, |
449 | const struct GNUNET_PeerIdentity *peer, | 443 | const struct GNUNET_PeerIdentity *peer, |
450 | int all, | 444 | int all, |
451 | GNUNET_ATS_AddressInformationCallback infocb, | 445 | GNUNET_ATS_AddressInformationCallback infocb, |
452 | void *infocb_cls); | 446 | void *infocb_cls); |
453 | 447 | ||
454 | 448 | ||
455 | /** | 449 | /** |
@@ -458,7 +452,7 @@ GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph, | |||
458 | * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel | 452 | * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel |
459 | */ | 453 | */ |
460 | void | 454 | void |
461 | GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *alh); | 455 | GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle *alh); |
462 | 456 | ||
463 | 457 | ||
464 | /** | 458 | /** |
@@ -467,7 +461,7 @@ GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandl | |||
467 | * @param ph handle | 461 | * @param ph handle |
468 | */ | 462 | */ |
469 | void | 463 | void |
470 | GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph); | 464 | GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph); |
471 | 465 | ||
472 | 466 | ||
473 | /** | 467 | /** |
@@ -508,11 +502,11 @@ struct GNUNET_ATS_ReservationContext; | |||
508 | * @deprecated will be replaced soon | 502 | * @deprecated will be replaced soon |
509 | */ | 503 | */ |
510 | struct GNUNET_ATS_ReservationContext * | 504 | struct GNUNET_ATS_ReservationContext * |
511 | GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, | 505 | GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph, |
512 | const struct GNUNET_PeerIdentity *peer, | 506 | const struct GNUNET_PeerIdentity *peer, |
513 | int32_t amount, | 507 | int32_t amount, |
514 | GNUNET_ATS_ReservationCallback rcb, | 508 | GNUNET_ATS_ReservationCallback rcb, |
515 | void *rcb_cls); | 509 | void *rcb_cls); |
516 | 510 | ||
517 | 511 | ||
518 | /** | 512 | /** |
@@ -521,25 +515,23 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, | |||
521 | * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call | 515 | * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call |
522 | */ | 516 | */ |
523 | void | 517 | void |
524 | GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc); | 518 | GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc); |
525 | 519 | ||
526 | 520 | ||
527 | /** | 521 | /** |
528 | * ATS preference types as array initializer | 522 | * ATS preference types as array initializer |
529 | */ | 523 | */ |
530 | #define GNUNET_ATS_PreferenceType {GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END} | 524 | #define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END } |
531 | 525 | ||
532 | /** | 526 | /** |
533 | * ATS preference types as string array initializer | 527 | * ATS preference types as string array initializer |
534 | */ | 528 | */ |
535 | #define GNUNET_ATS_PreferenceTypeString {"BANDWIDTH", "LATENCY", "END" } | 529 | #define GNUNET_ATS_PreferenceTypeString { "BANDWIDTH", "LATENCY", "END" } |
536 | 530 | ||
537 | /** | 531 | /** |
538 | * Enum defining all known preference categories. | 532 | * Enum defining all known preference categories. |
539 | */ | 533 | */ |
540 | enum GNUNET_ATS_PreferenceKind | 534 | enum GNUNET_ATS_PreferenceKind { |
541 | { | ||
542 | |||
543 | /** | 535 | /** |
544 | * Change the peer's bandwidth value (value per byte of bandwidth in | 536 | * Change the peer's bandwidth value (value per byte of bandwidth in |
545 | * the goal function) to the given amount. The argument is followed | 537 | * the goal function) to the given amount. The argument is followed |
@@ -561,7 +553,6 @@ enum GNUNET_ATS_PreferenceKind | |||
561 | * End of preference list. | 553 | * End of preference list. |
562 | */ | 554 | */ |
563 | GNUNET_ATS_PREFERENCE_END = 2 | 555 | GNUNET_ATS_PREFERENCE_END = 2 |
564 | |||
565 | }; | 556 | }; |
566 | 557 | ||
567 | 558 | ||
@@ -572,7 +563,7 @@ enum GNUNET_ATS_PreferenceKind | |||
572 | * @return a string or NULL if invalid | 563 | * @return a string or NULL if invalid |
573 | */ | 564 | */ |
574 | const char * | 565 | const char * |
575 | GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type); | 566 | GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type); |
576 | 567 | ||
577 | 568 | ||
578 | /** | 569 | /** |
@@ -584,9 +575,9 @@ GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type); | |||
584 | * desired changes | 575 | * desired changes |
585 | */ | 576 | */ |
586 | void | 577 | void |
587 | GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *ph, | 578 | GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph, |
588 | const struct GNUNET_PeerIdentity *peer, | 579 | const struct GNUNET_PeerIdentity *peer, |
589 | ...); | 580 | ...); |
590 | 581 | ||
591 | 582 | ||
592 | /** | 583 | /** |
@@ -607,10 +598,10 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p | |||
607 | * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes | 598 | * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes |
608 | */ | 599 | */ |
609 | void | 600 | void |
610 | GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, | 601 | GNUNET_ATS_performance_give_feedback(struct GNUNET_ATS_PerformanceHandle *ph, |
611 | const struct GNUNET_PeerIdentity *peer, | 602 | const struct GNUNET_PeerIdentity *peer, |
612 | const struct GNUNET_TIME_Relative scope, | 603 | const struct GNUNET_TIME_Relative scope, |
613 | ...); | 604 | ...); |
614 | 605 | ||
615 | #endif | 606 | #endif |
616 | 607 | ||
diff --git a/src/include/gnunet_ats_transport_service.h b/src/include/gnunet_ats_transport_service.h index 287f0600d..67138ae92 100644 --- a/src/include/gnunet_ats_transport_service.h +++ b/src/include/gnunet_ats_transport_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. | 3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -43,9 +43,7 @@ | |||
43 | /** | 43 | /** |
44 | * ATS performance characteristics for a session. | 44 | * ATS performance characteristics for a session. |
45 | */ | 45 | */ |
46 | struct GNUNET_ATS_Properties | 46 | struct GNUNET_ATS_Properties { |
47 | { | ||
48 | |||
49 | /** | 47 | /** |
50 | * Delay. Time between when the time packet is sent and the packet | 48 | * Delay. Time between when the time packet is sent and the packet |
51 | * arrives. FOREVER if we did not (successfully) measure yet. | 49 | * arrives. FOREVER if we did not (successfully) measure yet. |
@@ -106,7 +104,6 @@ struct GNUNET_ATS_Properties | |||
106 | * What characteristics does this communicator have? | 104 | * What characteristics does this communicator have? |
107 | */ | 105 | */ |
108 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc; | 106 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc; |
109 | |||
110 | }; | 107 | }; |
111 | 108 | ||
112 | 109 | ||
@@ -166,11 +163,11 @@ typedef void | |||
166 | * @return ats context | 163 | * @return ats context |
167 | */ | 164 | */ |
168 | struct GNUNET_ATS_TransportHandle * | 165 | struct GNUNET_ATS_TransportHandle * |
169 | GNUNET_ATS_transport_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 166 | GNUNET_ATS_transport_init(const struct GNUNET_CONFIGURATION_Handle *cfg, |
170 | GNUNET_ATS_AllocationCallback alloc_cb, | 167 | GNUNET_ATS_AllocationCallback alloc_cb, |
171 | void *alloc_cb_cls, | 168 | void *alloc_cb_cls, |
172 | GNUNET_ATS_SuggestionCallback suggest_cb, | 169 | GNUNET_ATS_SuggestionCallback suggest_cb, |
173 | void *suggest_cb_cls); | 170 | void *suggest_cb_cls); |
174 | 171 | ||
175 | 172 | ||
176 | /** | 173 | /** |
@@ -179,7 +176,7 @@ GNUNET_ATS_transport_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
179 | * @param ath handle to release | 176 | * @param ath handle to release |
180 | */ | 177 | */ |
181 | void | 178 | void |
182 | GNUNET_ATS_transport_done (struct GNUNET_ATS_TransportHandle *ath); | 179 | GNUNET_ATS_transport_done(struct GNUNET_ATS_TransportHandle *ath); |
183 | 180 | ||
184 | 181 | ||
185 | /** | 182 | /** |
@@ -203,11 +200,11 @@ struct GNUNET_ATS_SessionRecord; | |||
203 | * session is invalid) | 200 | * session is invalid) |
204 | */ | 201 | */ |
205 | struct GNUNET_ATS_SessionRecord * | 202 | struct GNUNET_ATS_SessionRecord * |
206 | GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath, | 203 | GNUNET_ATS_session_add(struct GNUNET_ATS_TransportHandle *ath, |
207 | const struct GNUNET_PeerIdentity *pid, | 204 | const struct GNUNET_PeerIdentity *pid, |
208 | const char *address, | 205 | const char *address, |
209 | struct GNUNET_ATS_Session *session, | 206 | struct GNUNET_ATS_Session *session, |
210 | const struct GNUNET_ATS_Properties *prop); | 207 | const struct GNUNET_ATS_Properties *prop); |
211 | 208 | ||
212 | 209 | ||
213 | /** | 210 | /** |
@@ -218,8 +215,8 @@ GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath, | |||
218 | * @param prop performance data for the session | 215 | * @param prop performance data for the session |
219 | */ | 216 | */ |
220 | void | 217 | void |
221 | GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar, | 218 | GNUNET_ATS_session_update(struct GNUNET_ATS_SessionRecord *ar, |
222 | const struct GNUNET_ATS_Properties *prop); | 219 | const struct GNUNET_ATS_Properties *prop); |
223 | 220 | ||
224 | 221 | ||
225 | /** | 222 | /** |
@@ -230,7 +227,7 @@ GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar, | |||
230 | * @param ar session record to drop | 227 | * @param ar session record to drop |
231 | */ | 228 | */ |
232 | void | 229 | void |
233 | GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar); | 230 | GNUNET_ATS_session_del(struct GNUNET_ATS_SessionRecord *ar); |
234 | 231 | ||
235 | 232 | ||
236 | #endif | 233 | #endif |
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index f941624af..945c0321a 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -47,8 +47,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
47 | /** | 47 | /** |
48 | * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second. | 48 | * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second. |
49 | */ | 49 | */ |
50 | struct GNUNET_BANDWIDTH_Value32NBO | 50 | struct GNUNET_BANDWIDTH_Value32NBO { |
51 | { | ||
52 | /** | 51 | /** |
53 | * The actual value (bytes per second). | 52 | * The actual value (bytes per second). |
54 | */ | 53 | */ |
@@ -83,8 +82,7 @@ typedef void (*GNUNET_BANDWIDTH_ExcessNotificationCallback) (void *cls); | |||
83 | * structures (reducing malloc-ing); however, values should not be | 82 | * structures (reducing malloc-ing); however, values should not be |
84 | * accessed directly by clients (hence the '__'). | 83 | * accessed directly by clients (hence the '__'). |
85 | */ | 84 | */ |
86 | struct GNUNET_BANDWIDTH_Tracker | 85 | struct GNUNET_BANDWIDTH_Tracker { |
87 | { | ||
88 | /** | 86 | /** |
89 | * Closure for @e update_cb. | 87 | * Closure for @e update_cb. |
90 | */ | 88 | */ |
@@ -140,7 +138,7 @@ struct GNUNET_BANDWIDTH_Tracker | |||
140 | /** | 138 | /** |
141 | * Convenience definition to use for 0-bandwidth. | 139 | * Convenience definition to use for 0-bandwidth. |
142 | */ | 140 | */ |
143 | #define GNUNET_BANDWIDTH_ZERO GNUNET_BANDWIDTH_value_init (0) | 141 | #define GNUNET_BANDWIDTH_ZERO GNUNET_BANDWIDTH_value_init(0) |
144 | 142 | ||
145 | 143 | ||
146 | /** | 144 | /** |
@@ -150,13 +148,13 @@ struct GNUNET_BANDWIDTH_Tracker | |||
150 | * @return the new bandwidth value | 148 | * @return the new bandwidth value |
151 | */ | 149 | */ |
152 | struct GNUNET_BANDWIDTH_Value32NBO | 150 | struct GNUNET_BANDWIDTH_Value32NBO |
153 | GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | 151 | GNUNET_BANDWIDTH_value_init(uint32_t bytes_per_second); |
154 | 152 | ||
155 | 153 | ||
156 | /** | 154 | /** |
157 | * Maximum possible bandwidth value. | 155 | * Maximum possible bandwidth value. |
158 | */ | 156 | */ |
159 | #define GNUNET_BANDWIDTH_VALUE_MAX GNUNET_BANDWIDTH_value_init (UINT32_MAX) | 157 | #define GNUNET_BANDWIDTH_VALUE_MAX GNUNET_BANDWIDTH_value_init(UINT32_MAX) |
160 | 158 | ||
161 | 159 | ||
162 | /** | 160 | /** |
@@ -168,7 +166,7 @@ GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | |||
168 | * @return number of bytes available at bps until deadline | 166 | * @return number of bytes available at bps until deadline |
169 | */ | 167 | */ |
170 | uint64_t | 168 | uint64_t |
171 | GNUNET_BANDWIDTH_value_get_available_until ( | 169 | GNUNET_BANDWIDTH_value_get_available_until( |
172 | struct GNUNET_BANDWIDTH_Value32NBO bps, | 170 | struct GNUNET_BANDWIDTH_Value32NBO bps, |
173 | struct GNUNET_TIME_Relative deadline); | 171 | struct GNUNET_TIME_Relative deadline); |
174 | 172 | ||
@@ -182,8 +180,8 @@ GNUNET_BANDWIDTH_value_get_available_until ( | |||
182 | * @return how long it would take | 180 | * @return how long it would take |
183 | */ | 181 | */ |
184 | struct GNUNET_TIME_Relative | 182 | struct GNUNET_TIME_Relative |
185 | GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | 183 | GNUNET_BANDWIDTH_value_get_delay_for(struct GNUNET_BANDWIDTH_Value32NBO bps, |
186 | uint64_t size); | 184 | uint64_t size); |
187 | 185 | ||
188 | 186 | ||
189 | /** | 187 | /** |
@@ -194,8 +192,8 @@ GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | |||
194 | * @return the min of b1 and b2 | 192 | * @return the min of b1 and b2 |
195 | */ | 193 | */ |
196 | struct GNUNET_BANDWIDTH_Value32NBO | 194 | struct GNUNET_BANDWIDTH_Value32NBO |
197 | GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | 195 | GNUNET_BANDWIDTH_value_min(struct GNUNET_BANDWIDTH_Value32NBO b1, |
198 | struct GNUNET_BANDWIDTH_Value32NBO b2); | 196 | struct GNUNET_BANDWIDTH_Value32NBO b2); |
199 | 197 | ||
200 | 198 | ||
201 | /** | 199 | /** |
@@ -206,8 +204,8 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
206 | * @return the min of b1 and b2 | 204 | * @return the min of b1 and b2 |
207 | */ | 205 | */ |
208 | struct GNUNET_BANDWIDTH_Value32NBO | 206 | struct GNUNET_BANDWIDTH_Value32NBO |
209 | GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1, | 207 | GNUNET_BANDWIDTH_value_max(struct GNUNET_BANDWIDTH_Value32NBO b1, |
210 | struct GNUNET_BANDWIDTH_Value32NBO b2); | 208 | struct GNUNET_BANDWIDTH_Value32NBO b2); |
211 | 209 | ||
212 | 210 | ||
213 | /** | 211 | /** |
@@ -218,8 +216,8 @@ GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
218 | * @return the sum of b1 and b2 | 216 | * @return the sum of b1 and b2 |
219 | */ | 217 | */ |
220 | struct GNUNET_BANDWIDTH_Value32NBO | 218 | struct GNUNET_BANDWIDTH_Value32NBO |
221 | GNUNET_BANDWIDTH_value_sum (struct GNUNET_BANDWIDTH_Value32NBO b1, | 219 | GNUNET_BANDWIDTH_value_sum(struct GNUNET_BANDWIDTH_Value32NBO b1, |
222 | struct GNUNET_BANDWIDTH_Value32NBO b2); | 220 | struct GNUNET_BANDWIDTH_Value32NBO b2); |
223 | 221 | ||
224 | 222 | ||
225 | /** | 223 | /** |
@@ -239,7 +237,7 @@ GNUNET_BANDWIDTH_value_sum (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
239 | * may accumulate before it expires | 237 | * may accumulate before it expires |
240 | */ | 238 | */ |
241 | void | 239 | void |
242 | GNUNET_BANDWIDTH_tracker_init ( | 240 | GNUNET_BANDWIDTH_tracker_init( |
243 | struct GNUNET_BANDWIDTH_Tracker *av, | 241 | struct GNUNET_BANDWIDTH_Tracker *av, |
244 | GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, | 242 | GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, |
245 | void *update_cb_cls, | 243 | void *update_cb_cls, |
@@ -266,7 +264,7 @@ GNUNET_BANDWIDTH_tracker_init ( | |||
266 | * @param excess_cb_cls closure for @a excess_cb | 264 | * @param excess_cb_cls closure for @a excess_cb |
267 | */ | 265 | */ |
268 | void | 266 | void |
269 | GNUNET_BANDWIDTH_tracker_init2 ( | 267 | GNUNET_BANDWIDTH_tracker_init2( |
270 | struct GNUNET_BANDWIDTH_Tracker *av, | 268 | struct GNUNET_BANDWIDTH_Tracker *av, |
271 | GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, | 269 | GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, |
272 | void *update_cb_cls, | 270 | void *update_cb_cls, |
@@ -282,7 +280,7 @@ GNUNET_BANDWIDTH_tracker_init2 ( | |||
282 | * @param av the respective trackers | 280 | * @param av the respective trackers |
283 | */ | 281 | */ |
284 | void | 282 | void |
285 | GNUNET_BANDWIDTH_tracker_notification_stop ( | 283 | GNUNET_BANDWIDTH_tracker_notification_stop( |
286 | struct GNUNET_BANDWIDTH_Tracker *av); | 284 | struct GNUNET_BANDWIDTH_Tracker *av); |
287 | 285 | ||
288 | 286 | ||
@@ -298,8 +296,8 @@ GNUNET_BANDWIDTH_tracker_notification_stop ( | |||
298 | * @return #GNUNET_YES if this consumption is above the limit | 296 | * @return #GNUNET_YES if this consumption is above the limit |
299 | */ | 297 | */ |
300 | int | 298 | int |
301 | GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | 299 | GNUNET_BANDWIDTH_tracker_consume(struct GNUNET_BANDWIDTH_Tracker *av, |
302 | ssize_t size); | 300 | ssize_t size); |
303 | 301 | ||
304 | 302 | ||
305 | /** | 303 | /** |
@@ -312,8 +310,8 @@ GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | |||
312 | * @return time to wait for consumption to be OK | 310 | * @return time to wait for consumption to be OK |
313 | */ | 311 | */ |
314 | struct GNUNET_TIME_Relative | 312 | struct GNUNET_TIME_Relative |
315 | GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | 313 | GNUNET_BANDWIDTH_tracker_get_delay(struct GNUNET_BANDWIDTH_Tracker *av, |
316 | size_t size); | 314 | size_t size); |
317 | 315 | ||
318 | 316 | ||
319 | /** | 317 | /** |
@@ -324,7 +322,7 @@ GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | |||
324 | * @return number of bytes available for consumption right now | 322 | * @return number of bytes available for consumption right now |
325 | */ | 323 | */ |
326 | int64_t | 324 | int64_t |
327 | GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); | 325 | GNUNET_BANDWIDTH_tracker_get_available(struct GNUNET_BANDWIDTH_Tracker *av); |
328 | 326 | ||
329 | 327 | ||
330 | /** | 328 | /** |
@@ -334,7 +332,7 @@ GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); | |||
334 | * @param bytes_per_second_limit new limit to assume | 332 | * @param bytes_per_second_limit new limit to assume |
335 | */ | 333 | */ |
336 | void | 334 | void |
337 | GNUNET_BANDWIDTH_tracker_update_quota ( | 335 | GNUNET_BANDWIDTH_tracker_update_quota( |
338 | struct GNUNET_BANDWIDTH_Tracker *av, | 336 | struct GNUNET_BANDWIDTH_Tracker *av, |
339 | struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit); | 337 | struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit); |
340 | 338 | ||
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index e90e85832..a1fd0e6ac 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -55,7 +55,7 @@ struct GNUNET_BIO_ReadHandle; | |||
55 | * @return IO handle on success, NULL on error | 55 | * @return IO handle on success, NULL on error |
56 | */ | 56 | */ |
57 | struct GNUNET_BIO_ReadHandle * | 57 | struct GNUNET_BIO_ReadHandle * |
58 | GNUNET_BIO_read_open (const char *fn); | 58 | GNUNET_BIO_read_open(const char *fn); |
59 | 59 | ||
60 | 60 | ||
61 | /** | 61 | /** |
@@ -67,7 +67,7 @@ GNUNET_BIO_read_open (const char *fn); | |||
67 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 67 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
68 | */ | 68 | */ |
69 | int | 69 | int |
70 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | 70 | GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg); |
71 | 71 | ||
72 | 72 | ||
73 | /** | 73 | /** |
@@ -80,8 +80,8 @@ GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
80 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 80 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
81 | */ | 81 | */ |
82 | int | 82 | int |
83 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | 83 | GNUNET_BIO_read(struct GNUNET_BIO_ReadHandle *h, const char *what, |
84 | void *result, size_t len); | 84 | void *result, size_t len); |
85 | 85 | ||
86 | 86 | ||
87 | /** | 87 | /** |
@@ -95,9 +95,9 @@ GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
95 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 95 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
96 | */ | 96 | */ |
97 | int | 97 | int |
98 | GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, | 98 | GNUNET_BIO_read_fn(struct GNUNET_BIO_ReadHandle *h, |
99 | const char *file, int line, | 99 | const char *file, int line, |
100 | void *result, size_t len); | 100 | void *result, size_t len); |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Read 0-terminated string from a file. | 103 | * Read 0-terminated string from a file. |
@@ -110,8 +110,8 @@ GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, | |||
110 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 110 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
111 | */ | 111 | */ |
112 | int | 112 | int |
113 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | 113 | GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, |
114 | char **result, size_t max_length); | 114 | char **result, size_t max_length); |
115 | 115 | ||
116 | 116 | ||
117 | /** | 117 | /** |
@@ -123,8 +123,8 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
123 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 123 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
124 | */ | 124 | */ |
125 | int | 125 | int |
126 | GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, | 126 | GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, |
127 | struct GNUNET_CONTAINER_MetaData **result); | 127 | struct GNUNET_CONTAINER_MetaData **result); |
128 | 128 | ||
129 | 129 | ||
130 | /** | 130 | /** |
@@ -133,7 +133,7 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
133 | * @param h hande to open file | 133 | * @param h hande to open file |
134 | * @param f address of float to read | 134 | * @param f address of float to read |
135 | */ | 135 | */ |
136 | #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(float))) | 136 | #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(float))) |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
@@ -143,7 +143,7 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
143 | * @param h hande to open file | 143 | * @param h hande to open file |
144 | * @param f address of double to read | 144 | * @param f address of double to read |
145 | */ | 145 | */ |
146 | #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(double))) | 146 | #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(double))) |
147 | 147 | ||
148 | 148 | ||
149 | /** | 149 | /** |
@@ -156,8 +156,8 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
156 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 156 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
157 | */ | 157 | */ |
158 | int | 158 | int |
159 | GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 159 | GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file, |
160 | int line, int32_t * i); | 160 | int line, int32_t * i); |
161 | 161 | ||
162 | 162 | ||
163 | /** | 163 | /** |
@@ -166,7 +166,7 @@ GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
166 | * @param h hande to open file | 166 | * @param h hande to open file |
167 | * @param i address of 32-bit integer to read | 167 | * @param i address of 32-bit integer to read |
168 | */ | 168 | */ |
169 | #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__ (h, __FILE__, __LINE__, (int32_t*) i) | 169 | #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__(h, __FILE__, __LINE__, (int32_t*)i) |
170 | 170 | ||
171 | 171 | ||
172 | /** | 172 | /** |
@@ -179,8 +179,8 @@ GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
179 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 179 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
180 | */ | 180 | */ |
181 | int | 181 | int |
182 | GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 182 | GNUNET_BIO_read_int64__(struct GNUNET_BIO_ReadHandle *h, const char *file, |
183 | int line, int64_t * i); | 183 | int line, int64_t * i); |
184 | 184 | ||
185 | 185 | ||
186 | /** | 186 | /** |
@@ -189,7 +189,7 @@ GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
189 | * @param h hande to open file | 189 | * @param h hande to open file |
190 | * @param i address of 64-bit integer to read | 190 | * @param i address of 64-bit integer to read |
191 | */ | 191 | */ |
192 | #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__ (h, __FILE__, __LINE__, (int64_t*) i) | 192 | #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__(h, __FILE__, __LINE__, (int64_t*)i) |
193 | 193 | ||
194 | 194 | ||
195 | /** | 195 | /** |
@@ -204,7 +204,7 @@ struct GNUNET_BIO_WriteHandle; | |||
204 | * @return IO handle on success, NULL on error | 204 | * @return IO handle on success, NULL on error |
205 | */ | 205 | */ |
206 | struct GNUNET_BIO_WriteHandle * | 206 | struct GNUNET_BIO_WriteHandle * |
207 | GNUNET_BIO_write_open (const char *fn); | 207 | GNUNET_BIO_write_open(const char *fn); |
208 | 208 | ||
209 | 209 | ||
210 | /** | 210 | /** |
@@ -214,7 +214,7 @@ GNUNET_BIO_write_open (const char *fn); | |||
214 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 214 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
215 | */ | 215 | */ |
216 | int | 216 | int |
217 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | 217 | GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h); |
218 | 218 | ||
219 | 219 | ||
220 | /** | 220 | /** |
@@ -226,8 +226,8 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
226 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 226 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
227 | */ | 227 | */ |
228 | int | 228 | int |
229 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | 229 | GNUNET_BIO_write(struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
230 | size_t n); | 230 | size_t n); |
231 | 231 | ||
232 | 232 | ||
233 | /** | 233 | /** |
@@ -238,7 +238,7 @@ GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
238 | * the file is closed | 238 | * the file is closed |
239 | */ | 239 | */ |
240 | int | 240 | int |
241 | GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); | 241 | GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h); |
242 | 242 | ||
243 | 243 | ||
244 | /** | 244 | /** |
@@ -249,7 +249,7 @@ GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); | |||
249 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 249 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
250 | */ | 250 | */ |
251 | int | 251 | int |
252 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | 252 | GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *s); |
253 | 253 | ||
254 | 254 | ||
255 | /** | 255 | /** |
@@ -260,8 +260,8 @@ GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | |||
260 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 260 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
261 | */ | 261 | */ |
262 | int | 262 | int |
263 | GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | 263 | GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, |
264 | const struct GNUNET_CONTAINER_MetaData *m); | 264 | const struct GNUNET_CONTAINER_MetaData *m); |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
@@ -271,7 +271,7 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
271 | * @param h hande to open file | 271 | * @param h hande to open file |
272 | * @param f float to write (must be a variable) | 272 | * @param f float to write (must be a variable) |
273 | */ | 273 | */ |
274 | #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float)) | 274 | #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write(h, &f, sizeof(float)) |
275 | 275 | ||
276 | 276 | ||
277 | 277 | ||
@@ -281,7 +281,7 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
281 | * @param h hande to open file | 281 | * @param h hande to open file |
282 | * @param f double to write (must be a variable) | 282 | * @param f double to write (must be a variable) |
283 | */ | 283 | */ |
284 | #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(double)) | 284 | #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write(h, &f, sizeof(double)) |
285 | 285 | ||
286 | 286 | ||
287 | /** | 287 | /** |
@@ -292,7 +292,7 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
292 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 292 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
293 | */ | 293 | */ |
294 | int | 294 | int |
295 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | 295 | GNUNET_BIO_write_int32(struct GNUNET_BIO_WriteHandle *h, int32_t i); |
296 | 296 | ||
297 | 297 | ||
298 | /** | 298 | /** |
@@ -303,7 +303,7 @@ GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
303 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 303 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
304 | */ | 304 | */ |
305 | int | 305 | int |
306 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | 306 | GNUNET_BIO_write_int64(struct GNUNET_BIO_WriteHandle *h, int64_t i); |
307 | 307 | ||
308 | 308 | ||
309 | #if 0 /* keep Emacsens' auto-indent happy */ | 309 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_group_lib.h b/src/include/gnunet_block_group_lib.h index 777ef7dd6..91d193015 100644 --- a/src/include/gnunet_block_group_lib.h +++ b/src/include/gnunet_block_group_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -57,8 +57,8 @@ extern "C" | |||
57 | * @return must be a power of two and smaller or equal to 2^15. | 57 | * @return must be a power of two and smaller or equal to 2^15. |
58 | */ | 58 | */ |
59 | size_t | 59 | size_t |
60 | GNUNET_BLOCK_GROUP_compute_bloomfilter_size (unsigned int entry_count, | 60 | GNUNET_BLOCK_GROUP_compute_bloomfilter_size(unsigned int entry_count, |
61 | unsigned int k); | 61 | unsigned int k); |
62 | 62 | ||
63 | 63 | ||
64 | /** | 64 | /** |
@@ -75,13 +75,13 @@ GNUNET_BLOCK_GROUP_compute_bloomfilter_size (unsigned int entry_count, | |||
75 | * by this @a type of block (this is not an error) | 75 | * by this @a type of block (this is not an error) |
76 | */ | 76 | */ |
77 | struct GNUNET_BLOCK_Group * | 77 | struct GNUNET_BLOCK_Group * |
78 | GNUNET_BLOCK_GROUP_bf_create (void *cls, | 78 | GNUNET_BLOCK_GROUP_bf_create(void *cls, |
79 | size_t bf_size, | 79 | size_t bf_size, |
80 | unsigned int bf_k, | 80 | unsigned int bf_k, |
81 | enum GNUNET_BLOCK_Type type, | 81 | enum GNUNET_BLOCK_Type type, |
82 | uint32_t nonce, | 82 | uint32_t nonce, |
83 | const void *raw_data, | 83 | const void *raw_data, |
84 | size_t raw_data_size); | 84 | size_t raw_data_size); |
85 | 85 | ||
86 | 86 | ||
87 | /** | 87 | /** |
@@ -95,8 +95,8 @@ GNUNET_BLOCK_GROUP_bf_create (void *cls, | |||
95 | * #GNUNET_NO if @a hc was definitively not in @bg (but now is) | 95 | * #GNUNET_NO if @a hc was definitively not in @bg (but now is) |
96 | */ | 96 | */ |
97 | int | 97 | int |
98 | GNUNET_BLOCK_GROUP_bf_test_and_set (struct GNUNET_BLOCK_Group *bg, | 98 | GNUNET_BLOCK_GROUP_bf_test_and_set(struct GNUNET_BLOCK_Group *bg, |
99 | const struct GNUNET_HashCode *hc); | 99 | const struct GNUNET_HashCode *hc); |
100 | 100 | ||
101 | 101 | ||
102 | #if 0 /* keep Emacsens' auto-indent happy */ | 102 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index c85d3702b..29b64759c 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -44,8 +44,7 @@ extern "C" | |||
44 | /** | 44 | /** |
45 | * Blocks in the datastore and the datacache must have a unique type. | 45 | * Blocks in the datastore and the datacache must have a unique type. |
46 | */ | 46 | */ |
47 | enum GNUNET_BLOCK_Type | 47 | enum GNUNET_BLOCK_Type { |
48 | { | ||
49 | /** | 48 | /** |
50 | * Any type of block, used as a wildcard when searching. Should | 49 | * Any type of block, used as a wildcard when searching. Should |
51 | * never be attached to a specific block. | 50 | * never be attached to a specific block. |
@@ -143,9 +142,7 @@ enum GNUNET_BLOCK_Type | |||
143 | /** | 142 | /** |
144 | * Flags that can be set to control the evaluation. | 143 | * Flags that can be set to control the evaluation. |
145 | */ | 144 | */ |
146 | enum GNUNET_BLOCK_EvaluationOptions | 145 | enum GNUNET_BLOCK_EvaluationOptions { |
147 | { | ||
148 | |||
149 | /** | 146 | /** |
150 | * Default behavior. | 147 | * Default behavior. |
151 | */ | 148 | */ |
@@ -162,8 +159,7 @@ enum GNUNET_BLOCK_EvaluationOptions | |||
162 | /** | 159 | /** |
163 | * Possible ways for how a block may relate to a query. | 160 | * Possible ways for how a block may relate to a query. |
164 | */ | 161 | */ |
165 | enum GNUNET_BLOCK_EvaluationResult | 162 | enum GNUNET_BLOCK_EvaluationResult { |
166 | { | ||
167 | /** | 163 | /** |
168 | * Valid result, and there may be more. | 164 | * Valid result, and there may be more. |
169 | */ | 165 | */ |
@@ -222,9 +218,9 @@ struct GNUNET_BLOCK_Context; | |||
222 | * @param hc where to store the result. | 218 | * @param hc where to store the result. |
223 | */ | 219 | */ |
224 | void | 220 | void |
225 | GNUNET_BLOCK_mingle_hash (const struct GNUNET_HashCode *in, | 221 | GNUNET_BLOCK_mingle_hash(const struct GNUNET_HashCode *in, |
226 | uint32_t mingle_number, | 222 | uint32_t mingle_number, |
227 | struct GNUNET_HashCode *hc); | 223 | struct GNUNET_HashCode *hc); |
228 | 224 | ||
229 | 225 | ||
230 | /** | 226 | /** |
@@ -234,7 +230,7 @@ GNUNET_BLOCK_mingle_hash (const struct GNUNET_HashCode *in, | |||
234 | * @return NULL on error | 230 | * @return NULL on error |
235 | */ | 231 | */ |
236 | struct GNUNET_BLOCK_Context * | 232 | struct GNUNET_BLOCK_Context * |
237 | GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); | 233 | GNUNET_BLOCK_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg); |
238 | 234 | ||
239 | 235 | ||
240 | /** | 236 | /** |
@@ -243,7 +239,7 @@ GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
243 | * @param ctx context to destroy | 239 | * @param ctx context to destroy |
244 | */ | 240 | */ |
245 | void | 241 | void |
246 | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | 242 | GNUNET_BLOCK_context_destroy(struct GNUNET_BLOCK_Context *ctx); |
247 | 243 | ||
248 | 244 | ||
249 | /** | 245 | /** |
@@ -267,12 +263,12 @@ struct GNUNET_BLOCK_Group; | |||
267 | * by this @a type of block (this is not an error) | 263 | * by this @a type of block (this is not an error) |
268 | */ | 264 | */ |
269 | struct GNUNET_BLOCK_Group * | 265 | struct GNUNET_BLOCK_Group * |
270 | GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx, | 266 | GNUNET_BLOCK_group_create(struct GNUNET_BLOCK_Context *ctx, |
271 | enum GNUNET_BLOCK_Type type, | 267 | enum GNUNET_BLOCK_Type type, |
272 | uint32_t nonce, | 268 | uint32_t nonce, |
273 | const void *raw_data, | 269 | const void *raw_data, |
274 | size_t raw_data_size, | 270 | size_t raw_data_size, |
275 | ...); | 271 | ...); |
276 | 272 | ||
277 | 273 | ||
278 | /** | 274 | /** |
@@ -286,10 +282,10 @@ GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx, | |||
286 | * supported, #GNUNET_SYSERR on error | 282 | * supported, #GNUNET_SYSERR on error |
287 | */ | 283 | */ |
288 | int | 284 | int |
289 | GNUNET_BLOCK_group_serialize (struct GNUNET_BLOCK_Group *bg, | 285 | GNUNET_BLOCK_group_serialize(struct GNUNET_BLOCK_Group *bg, |
290 | uint32_t *nonce, | 286 | uint32_t *nonce, |
291 | void **raw_data, | 287 | void **raw_data, |
292 | size_t *raw_data_size); | 288 | size_t *raw_data_size); |
293 | 289 | ||
294 | 290 | ||
295 | /** | 291 | /** |
@@ -298,7 +294,7 @@ GNUNET_BLOCK_group_serialize (struct GNUNET_BLOCK_Group *bg, | |||
298 | * @param bg group to destroy, NULL is allowed | 294 | * @param bg group to destroy, NULL is allowed |
299 | */ | 295 | */ |
300 | void | 296 | void |
301 | GNUNET_BLOCK_group_destroy (struct GNUNET_BLOCK_Group *bg); | 297 | GNUNET_BLOCK_group_destroy(struct GNUNET_BLOCK_Group *bg); |
302 | 298 | ||
303 | 299 | ||
304 | /** | 300 | /** |
@@ -320,15 +316,15 @@ GNUNET_BLOCK_group_destroy (struct GNUNET_BLOCK_Group *bg); | |||
320 | * @return characterization of result | 316 | * @return characterization of result |
321 | */ | 317 | */ |
322 | enum GNUNET_BLOCK_EvaluationResult | 318 | enum GNUNET_BLOCK_EvaluationResult |
323 | GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, | 319 | GNUNET_BLOCK_evaluate(struct GNUNET_BLOCK_Context *ctx, |
324 | enum GNUNET_BLOCK_Type type, | 320 | enum GNUNET_BLOCK_Type type, |
325 | struct GNUNET_BLOCK_Group *group, | 321 | struct GNUNET_BLOCK_Group *group, |
326 | enum GNUNET_BLOCK_EvaluationOptions eo, | 322 | enum GNUNET_BLOCK_EvaluationOptions eo, |
327 | const struct GNUNET_HashCode *query, | 323 | const struct GNUNET_HashCode *query, |
328 | const void *xquery, | 324 | const void *xquery, |
329 | size_t xquery_size, | 325 | size_t xquery_size, |
330 | const void *reply_block, | 326 | const void *reply_block, |
331 | size_t reply_block_size); | 327 | size_t reply_block_size); |
332 | 328 | ||
333 | 329 | ||
334 | /** | 330 | /** |
@@ -345,11 +341,11 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, | |||
345 | * (or if extracting a key from a block of this type does not work) | 341 | * (or if extracting a key from a block of this type does not work) |
346 | */ | 342 | */ |
347 | int | 343 | int |
348 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | 344 | GNUNET_BLOCK_get_key(struct GNUNET_BLOCK_Context *ctx, |
349 | enum GNUNET_BLOCK_Type type, | 345 | enum GNUNET_BLOCK_Type type, |
350 | const void *block, | 346 | const void *block, |
351 | size_t block_size, | 347 | size_t block_size, |
352 | struct GNUNET_HashCode *key); | 348 | struct GNUNET_HashCode *key); |
353 | 349 | ||
354 | 350 | ||
355 | /** | 351 | /** |
@@ -364,9 +360,9 @@ GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | |||
364 | * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success | 360 | * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success |
365 | */ | 361 | */ |
366 | int | 362 | int |
367 | GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, | 363 | GNUNET_BLOCK_group_set_seen(struct GNUNET_BLOCK_Group *bg, |
368 | const struct GNUNET_HashCode *seen_results, | 364 | const struct GNUNET_HashCode *seen_results, |
369 | unsigned int seen_results_count); | 365 | unsigned int seen_results_count); |
370 | 366 | ||
371 | 367 | ||
372 | /** | 368 | /** |
@@ -382,8 +378,8 @@ GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, | |||
382 | * #GNUNET_SYSERR if merging is not supported | 378 | * #GNUNET_SYSERR if merging is not supported |
383 | */ | 379 | */ |
384 | int | 380 | int |
385 | GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1, | 381 | GNUNET_BLOCK_group_merge(struct GNUNET_BLOCK_Group *bg1, |
386 | struct GNUNET_BLOCK_Group *bg2); | 382 | struct GNUNET_BLOCK_Group *bg2); |
387 | 383 | ||
388 | 384 | ||
389 | #if 0 /* keep Emacsens' auto-indent happy */ | 385 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h index f0438c82f..025d33c45 100644 --- a/src/include/gnunet_block_plugin.h +++ b/src/include/gnunet_block_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -97,9 +97,7 @@ typedef void | |||
97 | * Block group data. The plugin must initialize the callbacks | 97 | * Block group data. The plugin must initialize the callbacks |
98 | * and can use the @e internal_cls as it likes. | 98 | * and can use the @e internal_cls as it likes. |
99 | */ | 99 | */ |
100 | struct GNUNET_BLOCK_Group | 100 | struct GNUNET_BLOCK_Group { |
101 | { | ||
102 | |||
103 | /** | 101 | /** |
104 | * Context owning the block group. Set by the main block library. | 102 | * Context owning the block group. Set by the main block library. |
105 | */ | 103 | */ |
@@ -138,7 +136,6 @@ struct GNUNET_BLOCK_Group | |||
138 | * Internal data structure of the plugin. | 136 | * Internal data structure of the plugin. |
139 | */ | 137 | */ |
140 | void *internal_cls; | 138 | void *internal_cls; |
141 | |||
142 | }; | 139 | }; |
143 | 140 | ||
144 | 141 | ||
@@ -183,16 +180,16 @@ typedef struct GNUNET_BLOCK_Group * | |||
183 | * @return characterization of result | 180 | * @return characterization of result |
184 | */ | 181 | */ |
185 | typedef enum GNUNET_BLOCK_EvaluationResult | 182 | typedef enum GNUNET_BLOCK_EvaluationResult |
186 | (*GNUNET_BLOCK_EvaluationFunction) (void *cls, | 183 | (*GNUNET_BLOCK_EvaluationFunction)(void *cls, |
187 | struct GNUNET_BLOCK_Context *ctx, | 184 | struct GNUNET_BLOCK_Context *ctx, |
188 | enum GNUNET_BLOCK_Type type, | 185 | enum GNUNET_BLOCK_Type type, |
189 | struct GNUNET_BLOCK_Group *group, | 186 | struct GNUNET_BLOCK_Group *group, |
190 | enum GNUNET_BLOCK_EvaluationOptions eo, | 187 | enum GNUNET_BLOCK_EvaluationOptions eo, |
191 | const struct GNUNET_HashCode *query, | 188 | const struct GNUNET_HashCode *query, |
192 | const void *xquery, | 189 | const void *xquery, |
193 | size_t xquery_size, | 190 | size_t xquery_size, |
194 | const void *reply_block, | 191 | const void *reply_block, |
195 | size_t reply_block_size); | 192 | size_t reply_block_size); |
196 | 193 | ||
197 | 194 | ||
198 | /** | 195 | /** |
@@ -221,9 +218,7 @@ typedef int | |||
221 | * Each plugin is required to return a pointer to a struct of this | 218 | * Each plugin is required to return a pointer to a struct of this |
222 | * type as the return value from its entry point. | 219 | * type as the return value from its entry point. |
223 | */ | 220 | */ |
224 | struct GNUNET_BLOCK_PluginFunctions | 221 | struct GNUNET_BLOCK_PluginFunctions { |
225 | { | ||
226 | |||
227 | /** | 222 | /** |
228 | * Closure for all of the callbacks. | 223 | * Closure for all of the callbacks. |
229 | */ | 224 | */ |
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h index 819e39353..dccc51464 100644 --- a/src/include/gnunet_cadet_service.h +++ b/src/include/gnunet_cadet_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * @author Bart Polot | 22 | * @author Bart Polot |
@@ -70,8 +70,7 @@ struct GNUNET_CADET_Port; | |||
70 | /** | 70 | /** |
71 | * Hash uniquely identifying a connection below a tunnel. | 71 | * Hash uniquely identifying a connection below a tunnel. |
72 | */ | 72 | */ |
73 | struct GNUNET_CADET_ConnectionTunnelIdentifier | 73 | struct GNUNET_CADET_ConnectionTunnelIdentifier { |
74 | { | ||
75 | struct GNUNET_ShortHashCode connection_of_tunnel; | 74 | struct GNUNET_ShortHashCode connection_of_tunnel; |
76 | }; | 75 | }; |
77 | 76 | ||
@@ -79,8 +78,7 @@ struct GNUNET_CADET_ConnectionTunnelIdentifier | |||
79 | /** | 78 | /** |
80 | * Number identifying a CADET channel within a tunnel. | 79 | * Number identifying a CADET channel within a tunnel. |
81 | */ | 80 | */ |
82 | struct GNUNET_CADET_ChannelTunnelNumber | 81 | struct GNUNET_CADET_ChannelTunnelNumber { |
83 | { | ||
84 | /** | 82 | /** |
85 | * Which number does this channel have that uniquely identfies | 83 | * Which number does this channel have that uniquely identfies |
86 | * it within its tunnel, in network byte order. | 84 | * it within its tunnel, in network byte order. |
@@ -154,7 +152,7 @@ typedef void (*GNUNET_CADET_WindowSizeEventHandler) ( | |||
154 | * @return Handle to the cadet service NULL on error. | 152 | * @return Handle to the cadet service NULL on error. |
155 | */ | 153 | */ |
156 | struct GNUNET_CADET_Handle * | 154 | struct GNUNET_CADET_Handle * |
157 | GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 155 | GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
158 | 156 | ||
159 | 157 | ||
160 | /** | 158 | /** |
@@ -166,7 +164,7 @@ GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
166 | * @param handle connection to cadet to disconnect | 164 | * @param handle connection to cadet to disconnect |
167 | */ | 165 | */ |
168 | void | 166 | void |
169 | GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle); | 167 | GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle); |
170 | 168 | ||
171 | 169 | ||
172 | /** | 170 | /** |
@@ -183,13 +181,13 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle); | |||
183 | * @return Port handle, NULL if port is in use | 181 | * @return Port handle, NULL if port is in use |
184 | */ | 182 | */ |
185 | struct GNUNET_CADET_Port * | 183 | struct GNUNET_CADET_Port * |
186 | GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, | 184 | GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, |
187 | const struct GNUNET_HashCode *port, | 185 | const struct GNUNET_HashCode *port, |
188 | GNUNET_CADET_ConnectEventHandler connects, | 186 | GNUNET_CADET_ConnectEventHandler connects, |
189 | void *connects_cls, | 187 | void *connects_cls, |
190 | GNUNET_CADET_WindowSizeEventHandler window_changes, | 188 | GNUNET_CADET_WindowSizeEventHandler window_changes, |
191 | GNUNET_CADET_DisconnectEventHandler disconnects, | 189 | GNUNET_CADET_DisconnectEventHandler disconnects, |
192 | const struct GNUNET_MQ_MessageHandler *handlers); | 190 | const struct GNUNET_MQ_MessageHandler *handlers); |
193 | 191 | ||
194 | 192 | ||
195 | /** | 193 | /** |
@@ -199,7 +197,7 @@ GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, | |||
199 | * @param p Port handle. | 197 | * @param p Port handle. |
200 | */ | 198 | */ |
201 | void | 199 | void |
202 | GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p); | 200 | GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p); |
203 | 201 | ||
204 | 202 | ||
205 | /** | 203 | /** |
@@ -223,13 +221,13 @@ GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p); | |||
223 | * @return Handle to the channel. | 221 | * @return Handle to the channel. |
224 | */ | 222 | */ |
225 | struct GNUNET_CADET_Channel * | 223 | struct GNUNET_CADET_Channel * |
226 | GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | 224 | GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, |
227 | void *channel_cls, | 225 | void *channel_cls, |
228 | const struct GNUNET_PeerIdentity *destination, | 226 | const struct GNUNET_PeerIdentity *destination, |
229 | const struct GNUNET_HashCode *port, | 227 | const struct GNUNET_HashCode *port, |
230 | GNUNET_CADET_WindowSizeEventHandler window_changes, | 228 | GNUNET_CADET_WindowSizeEventHandler window_changes, |
231 | GNUNET_CADET_DisconnectEventHandler disconnects, | 229 | GNUNET_CADET_DisconnectEventHandler disconnects, |
232 | const struct GNUNET_MQ_MessageHandler *handlers); | 230 | const struct GNUNET_MQ_MessageHandler *handlers); |
233 | 231 | ||
234 | 232 | ||
235 | /** | 233 | /** |
@@ -242,7 +240,7 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
242 | * @param channel Channel handle, becomes invalid after this call. | 240 | * @param channel Channel handle, becomes invalid after this call. |
243 | */ | 241 | */ |
244 | void | 242 | void |
245 | GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel); | 243 | GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel); |
246 | 244 | ||
247 | 245 | ||
248 | /** | 246 | /** |
@@ -252,7 +250,7 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel); | |||
252 | * @return The message queue of the channel. | 250 | * @return The message queue of the channel. |
253 | */ | 251 | */ |
254 | struct GNUNET_MQ_Handle * | 252 | struct GNUNET_MQ_Handle * |
255 | GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel); | 253 | GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel); |
256 | 254 | ||
257 | 255 | ||
258 | /** | 256 | /** |
@@ -263,7 +261,7 @@ GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel); | |||
263 | * @param channel Channel that will be allowed to call another handler. | 261 | * @param channel Channel that will be allowed to call another handler. |
264 | */ | 262 | */ |
265 | void | 263 | void |
266 | GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel); | 264 | GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel); |
267 | 265 | ||
268 | 266 | ||
269 | /** | 267 | /** |
@@ -276,25 +274,21 @@ GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel); | |||
276 | * @return A GNUNET_HashCode usable for the new CADET API. | 274 | * @return A GNUNET_HashCode usable for the new CADET API. |
277 | */ | 275 | */ |
278 | const struct GNUNET_HashCode * | 276 | const struct GNUNET_HashCode * |
279 | GC_u2h (uint32_t port); | 277 | GC_u2h(uint32_t port); |
280 | 278 | ||
281 | enum GNUNET_CADET_ChannelInfoOption | 279 | enum GNUNET_CADET_ChannelInfoOption { |
282 | { | ||
283 | /** | 280 | /** |
284 | * Who is the peer at the other end of the channel. | 281 | * Who is the peer at the other end of the channel. |
285 | * Only for use in @c GNUNET_CADET_channel_get_info | 282 | * Only for use in @c GNUNET_CADET_channel_get_info |
286 | * struct GNUNET_PeerIdentity *peer | 283 | * struct GNUNET_PeerIdentity *peer |
287 | */ | 284 | */ |
288 | GNUNET_CADET_OPTION_PEER = 0x0 | 285 | GNUNET_CADET_OPTION_PEER = 0x0 |
289 | |||
290 | }; | 286 | }; |
291 | 287 | ||
292 | /** | 288 | /** |
293 | * Union to retrieve info about a channel. | 289 | * Union to retrieve info about a channel. |
294 | */ | 290 | */ |
295 | union GNUNET_CADET_ChannelInfo | 291 | union GNUNET_CADET_ChannelInfo { |
296 | { | ||
297 | |||
298 | /** | 292 | /** |
299 | * #GNUNET_YES / #GNUNET_NO, for binary flags. | 293 | * #GNUNET_YES / #GNUNET_NO, for binary flags. |
300 | */ | 294 | */ |
@@ -315,9 +309,9 @@ union GNUNET_CADET_ChannelInfo | |||
315 | * @return Union with an answer to the query. | 309 | * @return Union with an answer to the query. |
316 | */ | 310 | */ |
317 | const union GNUNET_CADET_ChannelInfo * | 311 | const union GNUNET_CADET_ChannelInfo * |
318 | GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, | 312 | GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, |
319 | enum GNUNET_CADET_ChannelInfoOption option, | 313 | enum GNUNET_CADET_ChannelInfoOption option, |
320 | ...); | 314 | ...); |
321 | 315 | ||
322 | 316 | ||
323 | /******************************************************************************/ | 317 | /******************************************************************************/ |
@@ -334,8 +328,7 @@ GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, | |||
334 | /** | 328 | /** |
335 | * Internal details about a channel. | 329 | * Internal details about a channel. |
336 | */ | 330 | */ |
337 | struct GNUNET_CADET_ChannelInternals | 331 | struct GNUNET_CADET_ChannelInternals { |
338 | { | ||
339 | /** | 332 | /** |
340 | * Root of the channel | 333 | * Root of the channel |
341 | */ | 334 | */ |
@@ -377,10 +370,10 @@ struct GNUNET_CADET_ChannelMonitor; | |||
377 | * @param callback_cls Closure for @c callback. | 370 | * @param callback_cls Closure for @c callback. |
378 | */ | 371 | */ |
379 | struct GNUNET_CADET_ChannelMonitor * | 372 | struct GNUNET_CADET_ChannelMonitor * |
380 | GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg, | 373 | GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, |
381 | struct GNUNET_PeerIdentity *peer, | 374 | struct GNUNET_PeerIdentity *peer, |
382 | GNUNET_CADET_ChannelCB callback, | 375 | GNUNET_CADET_ChannelCB callback, |
383 | void *callback_cls); | 376 | void *callback_cls); |
384 | 377 | ||
385 | 378 | ||
386 | /** | 379 | /** |
@@ -390,14 +383,13 @@ GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
390 | * @return Closure that was given to #GNUNET_CADET_get_channel(). | 383 | * @return Closure that was given to #GNUNET_CADET_get_channel(). |
391 | */ | 384 | */ |
392 | void * | 385 | void * |
393 | GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm); | 386 | GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm); |
394 | 387 | ||
395 | 388 | ||
396 | /** | 389 | /** |
397 | * Information we return per peer. | 390 | * Information we return per peer. |
398 | */ | 391 | */ |
399 | struct GNUNET_CADET_PeerListEntry | 392 | struct GNUNET_CADET_PeerListEntry { |
400 | { | ||
401 | /** | 393 | /** |
402 | * Which peer is the information about? | 394 | * Which peer is the information about? |
403 | */ | 395 | */ |
@@ -451,9 +443,9 @@ struct GNUNET_CADET_PeersLister; | |||
451 | * @return NULL on error | 443 | * @return NULL on error |
452 | */ | 444 | */ |
453 | struct GNUNET_CADET_PeersLister * | 445 | struct GNUNET_CADET_PeersLister * |
454 | GNUNET_CADET_list_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | 446 | GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, |
455 | GNUNET_CADET_PeersCB callback, | 447 | GNUNET_CADET_PeersCB callback, |
456 | void *callback_cls); | 448 | void *callback_cls); |
457 | 449 | ||
458 | 450 | ||
459 | /** | 451 | /** |
@@ -463,14 +455,13 @@ GNUNET_CADET_list_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
463 | * @return Closure that was given to #GNUNET_CADET_list_peers(). | 455 | * @return Closure that was given to #GNUNET_CADET_list_peers(). |
464 | */ | 456 | */ |
465 | void * | 457 | void * |
466 | GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl); | 458 | GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl); |
467 | 459 | ||
468 | 460 | ||
469 | /** | 461 | /** |
470 | * Detailed information we return per peer. | 462 | * Detailed information we return per peer. |
471 | */ | 463 | */ |
472 | struct GNUNET_CADET_PeerPathDetail | 464 | struct GNUNET_CADET_PeerPathDetail { |
473 | { | ||
474 | /** | 465 | /** |
475 | * Peer this is about. | 466 | * Peer this is about. |
476 | */ | 467 | */ |
@@ -523,10 +514,10 @@ struct GNUNET_CADET_GetPath; | |||
523 | * @return NULL on error | 514 | * @return NULL on error |
524 | */ | 515 | */ |
525 | struct GNUNET_CADET_GetPath * | 516 | struct GNUNET_CADET_GetPath * |
526 | GNUNET_CADET_get_path (const struct GNUNET_CONFIGURATION_Handle *cfg, | 517 | GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, |
527 | const struct GNUNET_PeerIdentity *id, | 518 | const struct GNUNET_PeerIdentity *id, |
528 | GNUNET_CADET_PathCB callback, | 519 | GNUNET_CADET_PathCB callback, |
529 | void *callback_cls); | 520 | void *callback_cls); |
530 | 521 | ||
531 | 522 | ||
532 | /** | 523 | /** |
@@ -536,14 +527,13 @@ GNUNET_CADET_get_path (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
536 | * @return closure from #GNUNET_CADET_get_path(). | 527 | * @return closure from #GNUNET_CADET_get_path(). |
537 | */ | 528 | */ |
538 | void * | 529 | void * |
539 | GNUNET_CADET_get_path_cancel (struct GNUNET_CADET_GetPath *gp); | 530 | GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp); |
540 | 531 | ||
541 | 532 | ||
542 | /** | 533 | /** |
543 | * Details about a tunnel managed by CADET. | 534 | * Details about a tunnel managed by CADET. |
544 | */ | 535 | */ |
545 | struct GNUNET_CADET_TunnelDetails | 536 | struct GNUNET_CADET_TunnelDetails { |
546 | { | ||
547 | /** | 537 | /** |
548 | * Target of the tunnel. | 538 | * Target of the tunnel. |
549 | */ | 539 | */ |
@@ -602,9 +592,9 @@ struct GNUNET_CADET_ListTunnels; | |||
602 | * @return NULL on error | 592 | * @return NULL on error |
603 | */ | 593 | */ |
604 | struct GNUNET_CADET_ListTunnels * | 594 | struct GNUNET_CADET_ListTunnels * |
605 | GNUNET_CADET_list_tunnels (const struct GNUNET_CONFIGURATION_Handle *cfg, | 595 | GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, |
606 | GNUNET_CADET_TunnelsCB callback, | 596 | GNUNET_CADET_TunnelsCB callback, |
607 | void *callback_cls); | 597 | void *callback_cls); |
608 | 598 | ||
609 | 599 | ||
610 | /** | 600 | /** |
@@ -614,7 +604,7 @@ GNUNET_CADET_list_tunnels (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
614 | * @return Closure given to #GNUNET_CADET_list_tunnels(), if any. | 604 | * @return Closure given to #GNUNET_CADET_list_tunnels(), if any. |
615 | */ | 605 | */ |
616 | void * | 606 | void * |
617 | GNUNET_CADET_list_tunnels_cancel (struct GNUNET_CADET_ListTunnels *lt); | 607 | GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt); |
618 | 608 | ||
619 | 609 | ||
620 | #if 0 /* keep Emacsens' auto-indent happy */ | 610 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index c8c5c2885..8e4984124 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -57,11 +57,11 @@ extern "C" | |||
57 | * @return the message queue, NULL on error | 57 | * @return the message queue, NULL on error |
58 | */ | 58 | */ |
59 | struct GNUNET_MQ_Handle * | 59 | struct GNUNET_MQ_Handle * |
60 | GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 60 | GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
61 | const char *service_name, | 61 | const char *service_name, |
62 | const struct GNUNET_MQ_MessageHandler *handlers, | 62 | const struct GNUNET_MQ_MessageHandler *handlers, |
63 | GNUNET_MQ_ErrorHandler error_handler, | 63 | GNUNET_MQ_ErrorHandler error_handler, |
64 | void *error_handler_cls); | 64 | void *error_handler_cls); |
65 | 65 | ||
66 | 66 | ||
67 | #if 0 /* keep Emacsens' auto-indent happy */ | 67 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 6eed12ddb..afaf3a4de 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_common.h | 22 | * @file include/gnunet_common.h |
@@ -116,7 +116,7 @@ extern "C" { | |||
116 | /** | 116 | /** |
117 | * wrap va_arg for enums | 117 | * wrap va_arg for enums |
118 | */ | 118 | */ |
119 | #define GNUNET_VA_ARG_ENUM(va, X) ((enum X) va_arg (va, int)) | 119 | #define GNUNET_VA_ARG_ENUM(va, X) ((enum X)va_arg(va, int)) |
120 | 120 | ||
121 | 121 | ||
122 | /** | 122 | /** |
@@ -133,36 +133,36 @@ extern "C" { | |||
133 | */ | 133 | */ |
134 | 134 | ||
135 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 135 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
136 | #define GNUNET_htobe16(x) __bswap_16 (x) | 136 | #define GNUNET_htobe16(x) __bswap_16(x) |
137 | #define GNUNET_htole16(x) (x) | 137 | #define GNUNET_htole16(x) (x) |
138 | #define GNUNET_be16toh(x) __bswap_16 (x) | 138 | #define GNUNET_be16toh(x) __bswap_16(x) |
139 | #define GNUNET_le16toh(x) (x) | 139 | #define GNUNET_le16toh(x) (x) |
140 | 140 | ||
141 | #define GNUNET_htobe32(x) __bswap_32 (x) | 141 | #define GNUNET_htobe32(x) __bswap_32(x) |
142 | #define GNUNET_htole32(x) (x) | 142 | #define GNUNET_htole32(x) (x) |
143 | #define GNUNET_be32toh(x) __bswap_32 (x) | 143 | #define GNUNET_be32toh(x) __bswap_32(x) |
144 | #define GNUNET_le32toh(x) (x) | 144 | #define GNUNET_le32toh(x) (x) |
145 | 145 | ||
146 | #define GNUNET_htobe64(x) __bswap_64 (x) | 146 | #define GNUNET_htobe64(x) __bswap_64(x) |
147 | #define GNUNET_htole64(x) (x) | 147 | #define GNUNET_htole64(x) (x) |
148 | #define GNUNET_be64toh(x) __bswap_64 (x) | 148 | #define GNUNET_be64toh(x) __bswap_64(x) |
149 | #define GNUNET_le64toh(x) (x) | 149 | #define GNUNET_le64toh(x) (x) |
150 | #endif | 150 | #endif |
151 | #if __BYTE_ORDER == __BIG_ENDIAN | 151 | #if __BYTE_ORDER == __BIG_ENDIAN |
152 | #define GNUNET_htobe16(x) (x) | 152 | #define GNUNET_htobe16(x) (x) |
153 | #define GNUNET_htole16(x) __bswap_16 (x) | 153 | #define GNUNET_htole16(x) __bswap_16(x) |
154 | #define GNUNET_be16toh(x) (x) | 154 | #define GNUNET_be16toh(x) (x) |
155 | #define GNUNET_le16toh(x) __bswap_16 (x) | 155 | #define GNUNET_le16toh(x) __bswap_16(x) |
156 | 156 | ||
157 | #define GNUNET_htobe32(x) (x) | 157 | #define GNUNET_htobe32(x) (x) |
158 | #define GNUNET_htole32(x) __bswap_32 (x) | 158 | #define GNUNET_htole32(x) __bswap_32(x) |
159 | #define GNUNET_be32toh(x) (x) | 159 | #define GNUNET_be32toh(x) (x) |
160 | #define GNUNET_le32toh(x) __bswap_32 (x) | 160 | #define GNUNET_le32toh(x) __bswap_32(x) |
161 | 161 | ||
162 | #define GNUNET_htobe64(x) (x) | 162 | #define GNUNET_htobe64(x) (x) |
163 | #define GNUNET_htole64(x) __bswap_64 (x) | 163 | #define GNUNET_htole64(x) __bswap_64(x) |
164 | #define GNUNET_be64toh(x) (x) | 164 | #define GNUNET_be64toh(x) (x) |
165 | #define GNUNET_le64toh(x) __bswap_64 (x) | 165 | #define GNUNET_le64toh(x) __bswap_64(x) |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | 168 | ||
@@ -178,7 +178,7 @@ extern "C" { | |||
178 | * on the stack with a variable-length that might be zero, write | 178 | * on the stack with a variable-length that might be zero, write |
179 | * "int[GNUNET_NZL(n)] x;" instead of "int[n] x". | 179 | * "int[GNUNET_NZL(n)] x;" instead of "int[n] x". |
180 | */ | 180 | */ |
181 | #define GNUNET_NZL(l) GNUNET_MAX (1, l) | 181 | #define GNUNET_NZL(l) GNUNET_MAX(1, l) |
182 | 182 | ||
183 | 183 | ||
184 | /** | 184 | /** |
@@ -201,9 +201,9 @@ extern "C" { | |||
201 | * bug #33594. | 201 | * bug #33594. |
202 | */ | 202 | */ |
203 | #ifdef __BIGGEST_ALIGNMENT__ | 203 | #ifdef __BIGGEST_ALIGNMENT__ |
204 | #define GNUNET_ALIGN __attribute__ ((aligned (__BIGGEST_ALIGNMENT__))) | 204 | #define GNUNET_ALIGN __attribute__ ((aligned(__BIGGEST_ALIGNMENT__))) |
205 | #else | 205 | #else |
206 | #define GNUNET_ALIGN __attribute__ ((aligned (8))) | 206 | #define GNUNET_ALIGN __attribute__ ((aligned(8))) |
207 | #endif | 207 | #endif |
208 | 208 | ||
209 | /** | 209 | /** |
@@ -224,7 +224,7 @@ extern "C" { | |||
224 | * so we *only* use this on W32 (see #670578 from Debian); fortunately, | 224 | * so we *only* use this on W32 (see #670578 from Debian); fortunately, |
225 | * W32 doesn't run on sparc anyway. | 225 | * W32 doesn't run on sparc anyway. |
226 | */ | 226 | */ |
227 | #define GNUNET_NETWORK_STRUCT_BEGIN _Pragma ("pack(push)") _Pragma ("pack(1)") | 227 | #define GNUNET_NETWORK_STRUCT_BEGIN _Pragma("pack(push)") _Pragma ("pack(1)") |
228 | 228 | ||
229 | /** | 229 | /** |
230 | * gcc 4.x-ism to pack structures even on W32 (to be used after structs) | 230 | * gcc 4.x-ism to pack structures even on W32 (to be used after structs) |
@@ -232,7 +232,7 @@ extern "C" { | |||
232 | * so we *only* use this on W32 (see #670578 from Debian); fortunately, | 232 | * so we *only* use this on W32 (see #670578 from Debian); fortunately, |
233 | * W32 doesn't run on sparc anyway. | 233 | * W32 doesn't run on sparc anyway. |
234 | */ | 234 | */ |
235 | #define GNUNET_NETWORK_STRUCT_END _Pragma ("pack(pop)") | 235 | #define GNUNET_NETWORK_STRUCT_END _Pragma("pack(pop)") |
236 | 236 | ||
237 | #else | 237 | #else |
238 | #error gcc 4.x or higher required on W32 systems | 238 | #error gcc 4.x or higher required on W32 systems |
@@ -256,9 +256,8 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
256 | /** | 256 | /** |
257 | * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512. | 257 | * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512. |
258 | */ | 258 | */ |
259 | struct GNUNET_HashCode | 259 | struct GNUNET_HashCode { |
260 | { | 260 | uint32_t bits[512 / 8 / sizeof(uint32_t)]; /* = 16 */ |
261 | uint32_t bits[512 / 8 / sizeof (uint32_t)]; /* = 16 */ | ||
262 | }; | 261 | }; |
263 | 262 | ||
264 | 263 | ||
@@ -266,17 +265,15 @@ struct GNUNET_HashCode | |||
266 | * @brief A 256-bit hashcode. Used under special conditions, like when space | 265 | * @brief A 256-bit hashcode. Used under special conditions, like when space |
267 | * is critical and security is not impacted by it. | 266 | * is critical and security is not impacted by it. |
268 | */ | 267 | */ |
269 | struct GNUNET_ShortHashCode | 268 | struct GNUNET_ShortHashCode { |
270 | { | 269 | uint32_t bits[256 / 8 / sizeof(uint32_t)]; /* = 8 */ |
271 | uint32_t bits[256 / 8 / sizeof (uint32_t)]; /* = 8 */ | ||
272 | }; | 270 | }; |
273 | 271 | ||
274 | 272 | ||
275 | /** | 273 | /** |
276 | * A UUID, a 128 bit random value. | 274 | * A UUID, a 128 bit random value. |
277 | */ | 275 | */ |
278 | struct GNUNET_Uuid | 276 | struct GNUNET_Uuid { |
279 | { | ||
280 | /** | 277 | /** |
281 | * 128 random bits. | 278 | * 128 random bits. |
282 | */ | 279 | */ |
@@ -287,9 +284,7 @@ struct GNUNET_Uuid | |||
287 | /** | 284 | /** |
288 | * Header for all communications. | 285 | * Header for all communications. |
289 | */ | 286 | */ |
290 | struct GNUNET_MessageHeader | 287 | struct GNUNET_MessageHeader { |
291 | { | ||
292 | |||
293 | /** | 288 | /** |
294 | * The length of the struct (in bytes, including the length field itself), | 289 | * The length of the struct (in bytes, including the length field itself), |
295 | * in big-endian format. | 290 | * in big-endian format. |
@@ -306,8 +301,7 @@ struct GNUNET_MessageHeader | |||
306 | /** | 301 | /** |
307 | * Answer from service to client about last operation. | 302 | * Answer from service to client about last operation. |
308 | */ | 303 | */ |
309 | struct GNUNET_OperationResultMessage | 304 | struct GNUNET_OperationResultMessage { |
310 | { | ||
311 | struct GNUNET_MessageHeader header; | 305 | struct GNUNET_MessageHeader header; |
312 | 306 | ||
313 | uint32_t reserved GNUNET_PACKED; | 307 | uint32_t reserved GNUNET_PACKED; |
@@ -329,9 +323,8 @@ struct GNUNET_OperationResultMessage | |||
329 | /** | 323 | /** |
330 | * Identifier for an asynchronous execution context. | 324 | * Identifier for an asynchronous execution context. |
331 | */ | 325 | */ |
332 | struct GNUNET_AsyncScopeId | 326 | struct GNUNET_AsyncScopeId { |
333 | { | 327 | uint32_t bits[16 / sizeof(uint32_t)]; /* = 16 bytes */ |
334 | uint32_t bits[16 / sizeof (uint32_t)]; /* = 16 bytes */ | ||
335 | }; | 328 | }; |
336 | 329 | ||
337 | GNUNET_NETWORK_STRUCT_END | 330 | GNUNET_NETWORK_STRUCT_END |
@@ -340,8 +333,7 @@ GNUNET_NETWORK_STRUCT_END | |||
340 | /** | 333 | /** |
341 | * Saved async scope identifier or root scope. | 334 | * Saved async scope identifier or root scope. |
342 | */ | 335 | */ |
343 | struct GNUNET_AsyncScopeSave | 336 | struct GNUNET_AsyncScopeSave { |
344 | { | ||
345 | /** | 337 | /** |
346 | * Saved scope. Unused if 'have_scope==GNUNET_NO'. | 338 | * Saved scope. Unused if 'have_scope==GNUNET_NO'. |
347 | */ | 339 | */ |
@@ -398,8 +390,7 @@ typedef void (*GNUNET_ResultCallback) (void *cls, | |||
398 | * @ingroup logging | 390 | * @ingroup logging |
399 | * Types of errors. | 391 | * Types of errors. |
400 | */ | 392 | */ |
401 | enum GNUNET_ErrorType | 393 | enum GNUNET_ErrorType { |
402 | { | ||
403 | GNUNET_ERROR_TYPE_UNSPECIFIED = -1, | 394 | GNUNET_ERROR_TYPE_UNSPECIFIED = -1, |
404 | GNUNET_ERROR_TYPE_NONE = 0, | 395 | GNUNET_ERROR_TYPE_NONE = 0, |
405 | GNUNET_ERROR_TYPE_ERROR = 1, | 396 | GNUNET_ERROR_TYPE_ERROR = 1, |
@@ -439,16 +430,16 @@ typedef void (*GNUNET_Logger) (void *cls, | |||
439 | * @return number of log calls to be ignored | 430 | * @return number of log calls to be ignored |
440 | */ | 431 | */ |
441 | int | 432 | int |
442 | GNUNET_get_log_skip (void); | 433 | GNUNET_get_log_skip(void); |
443 | 434 | ||
444 | 435 | ||
445 | #if ! defined(GNUNET_CULL_LOGGING) | 436 | #if !defined(GNUNET_CULL_LOGGING) |
446 | int | 437 | int |
447 | GNUNET_get_log_call_status (int caller_level, | 438 | GNUNET_get_log_call_status(int caller_level, |
448 | const char *comp, | 439 | const char *comp, |
449 | const char *file, | 440 | const char *file, |
450 | const char *function, | 441 | const char *function, |
451 | int line); | 442 | int line); |
452 | #endif | 443 | #endif |
453 | 444 | ||
454 | 445 | ||
@@ -461,8 +452,8 @@ GNUNET_get_log_call_status (int caller_level, | |||
461 | * @param ... arguments for format string | 452 | * @param ... arguments for format string |
462 | */ | 453 | */ |
463 | void | 454 | void |
464 | GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...) | 455 | GNUNET_log_nocheck(enum GNUNET_ErrorType kind, const char *message, ...) |
465 | __attribute__ ((format (printf, 2, 3))); | 456 | __attribute__ ((format(printf, 2, 3))); |
466 | 457 | ||
467 | /* from glib */ | 458 | /* from glib */ |
468 | #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) | 459 | #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) |
@@ -470,19 +461,19 @@ GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...) | |||
470 | __extension__({ \ | 461 | __extension__({ \ |
471 | int _gnunet_boolean_var_; \ | 462 | int _gnunet_boolean_var_; \ |
472 | if (expr) \ | 463 | if (expr) \ |
473 | _gnunet_boolean_var_ = 1; \ | 464 | _gnunet_boolean_var_ = 1; \ |
474 | else \ | 465 | else \ |
475 | _gnunet_boolean_var_ = 0; \ | 466 | _gnunet_boolean_var_ = 0; \ |
476 | _gnunet_boolean_var_; \ | 467 | _gnunet_boolean_var_; \ |
477 | }) | 468 | }) |
478 | #define GN_LIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 1)) | 469 | #define GN_LIKELY(expr) (__builtin_expect(_GNUNET_BOOLEAN_EXPR(expr), 1)) |
479 | #define GN_UNLIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 0)) | 470 | #define GN_UNLIKELY(expr) (__builtin_expect(_GNUNET_BOOLEAN_EXPR(expr), 0)) |
480 | #else | 471 | #else |
481 | #define GN_LIKELY(expr) (expr) | 472 | #define GN_LIKELY(expr) (expr) |
482 | #define GN_UNLIKELY(expr) (expr) | 473 | #define GN_UNLIKELY(expr) (expr) |
483 | #endif | 474 | #endif |
484 | 475 | ||
485 | #if ! defined(GNUNET_LOG_CALL_STATUS) | 476 | #if !defined(GNUNET_LOG_CALL_STATUS) |
486 | #define GNUNET_LOG_CALL_STATUS -1 | 477 | #define GNUNET_LOG_CALL_STATUS -1 |
487 | #endif | 478 | #endif |
488 | 479 | ||
@@ -498,12 +489,12 @@ GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...) | |||
498 | * @param ... arguments for format string | 489 | * @param ... arguments for format string |
499 | */ | 490 | */ |
500 | void | 491 | void |
501 | GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, | 492 | GNUNET_log_from_nocheck(enum GNUNET_ErrorType kind, |
502 | const char *comp, | 493 | const char *comp, |
503 | const char *message, | 494 | const char *message, |
504 | ...); | 495 | ...); |
505 | 496 | ||
506 | #if ! defined(GNUNET_CULL_LOGGING) | 497 | #if !defined(GNUNET_CULL_LOGGING) |
507 | #define GNUNET_log_from(kind, comp, ...) \ | 498 | #define GNUNET_log_from(kind, comp, ...) \ |
508 | do \ | 499 | do \ |
509 | { \ | 500 | { \ |
@@ -511,21 +502,21 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, | |||
511 | if ((GNUNET_EXTRA_LOGGING > 0) || \ | 502 | if ((GNUNET_EXTRA_LOGGING > 0) || \ |
512 | ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ | 503 | ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ |
513 | { \ | 504 | { \ |
514 | if (GN_UNLIKELY (log_call_enabled == -1)) \ | 505 | if (GN_UNLIKELY(log_call_enabled == -1)) \ |
515 | log_call_enabled = \ | 506 | log_call_enabled = \ |
516 | GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ | 507 | GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ |
517 | (comp), \ | 508 | (comp), \ |
518 | __FILE__, \ | 509 | __FILE__, \ |
519 | __FUNCTION__, \ | 510 | __FUNCTION__, \ |
520 | __LINE__); \ | 511 | __LINE__); \ |
521 | if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ | 512 | if (GN_UNLIKELY(GNUNET_get_log_skip() > 0)) \ |
522 | { \ | 513 | { \ |
523 | GNUNET_log_skip (-1, GNUNET_NO); \ | 514 | GNUNET_log_skip(-1, GNUNET_NO); \ |
524 | } \ | 515 | } \ |
525 | else \ | 516 | else \ |
526 | { \ | 517 | { \ |
527 | if (GN_UNLIKELY (log_call_enabled)) \ | 518 | if (GN_UNLIKELY(log_call_enabled)) \ |
528 | GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ | 519 | GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ |
529 | } \ | 520 | } \ |
530 | } \ | 521 | } \ |
531 | } while (0) | 522 | } while (0) |
@@ -537,21 +528,21 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, | |||
537 | if ((GNUNET_EXTRA_LOGGING > 0) || \ | 528 | if ((GNUNET_EXTRA_LOGGING > 0) || \ |
538 | ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ | 529 | ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ |
539 | { \ | 530 | { \ |
540 | if (GN_UNLIKELY (log_call_enabled == -1)) \ | 531 | if (GN_UNLIKELY(log_call_enabled == -1)) \ |
541 | log_call_enabled = \ | 532 | log_call_enabled = \ |
542 | GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ | 533 | GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ |
543 | NULL, \ | 534 | NULL, \ |
544 | __FILE__, \ | 535 | __FILE__, \ |
545 | __FUNCTION__, \ | 536 | __FUNCTION__, \ |
546 | __LINE__); \ | 537 | __LINE__); \ |
547 | if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ | 538 | if (GN_UNLIKELY(GNUNET_get_log_skip() > 0)) \ |
548 | { \ | 539 | { \ |
549 | GNUNET_log_skip (-1, GNUNET_NO); \ | 540 | GNUNET_log_skip(-1, GNUNET_NO); \ |
550 | } \ | 541 | } \ |
551 | else \ | 542 | else \ |
552 | { \ | 543 | { \ |
553 | if (GN_UNLIKELY (log_call_enabled)) \ | 544 | if (GN_UNLIKELY(log_call_enabled)) \ |
554 | GNUNET_log_nocheck ((kind), __VA_ARGS__); \ | 545 | GNUNET_log_nocheck ((kind), __VA_ARGS__); \ |
555 | } \ | 546 | } \ |
556 | } \ | 547 | } \ |
557 | } while (0) | 548 | } while (0) |
@@ -570,9 +561,9 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, | |||
570 | * @param option name of missing option | 561 | * @param option name of missing option |
571 | */ | 562 | */ |
572 | void | 563 | void |
573 | GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | 564 | GNUNET_log_config_missing(enum GNUNET_ErrorType kind, |
574 | const char *section, | 565 | const char *section, |
575 | const char *option); | 566 | const char *option); |
576 | 567 | ||
577 | 568 | ||
578 | /** | 569 | /** |
@@ -585,10 +576,10 @@ GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | |||
585 | * @param required what is required that is invalid about the option | 576 | * @param required what is required that is invalid about the option |
586 | */ | 577 | */ |
587 | void | 578 | void |
588 | GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, | 579 | GNUNET_log_config_invalid(enum GNUNET_ErrorType kind, |
589 | const char *section, | 580 | const char *section, |
590 | const char *option, | 581 | const char *option, |
591 | const char *required); | 582 | const char *required); |
592 | 583 | ||
593 | 584 | ||
594 | /** | 585 | /** |
@@ -598,7 +589,7 @@ GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, | |||
598 | * first log the location of the failure. | 589 | * first log the location of the failure. |
599 | */ | 590 | */ |
600 | void | 591 | void |
601 | GNUNET_abort_ (void) GNUNET_NORETURN; | 592 | GNUNET_abort_(void) GNUNET_NORETURN; |
602 | 593 | ||
603 | 594 | ||
604 | /** | 595 | /** |
@@ -609,7 +600,7 @@ GNUNET_abort_ (void) GNUNET_NORETURN; | |||
609 | * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero | 600 | * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero |
610 | */ | 601 | */ |
611 | void | 602 | void |
612 | GNUNET_log_skip (int n, int check_reset); | 603 | GNUNET_log_skip(int n, int check_reset); |
613 | 604 | ||
614 | 605 | ||
615 | /** | 606 | /** |
@@ -622,7 +613,7 @@ GNUNET_log_skip (int n, int check_reset); | |||
622 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened | 613 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened |
623 | */ | 614 | */ |
624 | int | 615 | int |
625 | GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); | 616 | GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile); |
626 | 617 | ||
627 | 618 | ||
628 | /** | 619 | /** |
@@ -636,7 +627,7 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); | |||
636 | * @param logger_cls closure for @a logger | 627 | * @param logger_cls closure for @a logger |
637 | */ | 628 | */ |
638 | void | 629 | void |
639 | GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | 630 | GNUNET_logger_add(GNUNET_Logger logger, void *logger_cls); |
640 | 631 | ||
641 | 632 | ||
642 | /** | 633 | /** |
@@ -647,7 +638,7 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | |||
647 | * @param logger_cls closure for @a logger | 638 | * @param logger_cls closure for @a logger |
648 | */ | 639 | */ |
649 | void | 640 | void |
650 | GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | 641 | GNUNET_logger_remove(GNUNET_Logger logger, void *logger_cls); |
651 | 642 | ||
652 | 643 | ||
653 | /** | 644 | /** |
@@ -660,7 +651,7 @@ GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | |||
660 | * @return string | 651 | * @return string |
661 | */ | 652 | */ |
662 | const char * | 653 | const char * |
663 | GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc); | 654 | GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc); |
664 | 655 | ||
665 | 656 | ||
666 | /** | 657 | /** |
@@ -673,7 +664,7 @@ GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc); | |||
673 | * @return string | 664 | * @return string |
674 | */ | 665 | */ |
675 | const char * | 666 | const char * |
676 | GNUNET_uuid2s (const struct GNUNET_Uuid *uuid); | 667 | GNUNET_uuid2s(const struct GNUNET_Uuid *uuid); |
677 | 668 | ||
678 | 669 | ||
679 | /** | 670 | /** |
@@ -686,7 +677,7 @@ GNUNET_uuid2s (const struct GNUNET_Uuid *uuid); | |||
686 | * @return string | 677 | * @return string |
687 | */ | 678 | */ |
688 | const char * | 679 | const char * |
689 | GNUNET_h2s (const struct GNUNET_HashCode *hc); | 680 | GNUNET_h2s(const struct GNUNET_HashCode *hc); |
690 | 681 | ||
691 | 682 | ||
692 | /** | 683 | /** |
@@ -701,7 +692,7 @@ GNUNET_h2s (const struct GNUNET_HashCode *hc); | |||
701 | * @return string | 692 | * @return string |
702 | */ | 693 | */ |
703 | const char * | 694 | const char * |
704 | GNUNET_h2s2 (const struct GNUNET_HashCode *hc); | 695 | GNUNET_h2s2(const struct GNUNET_HashCode *hc); |
705 | 696 | ||
706 | 697 | ||
707 | /** | 698 | /** |
@@ -715,7 +706,7 @@ GNUNET_h2s2 (const struct GNUNET_HashCode *hc); | |||
715 | * @return string | 706 | * @return string |
716 | */ | 707 | */ |
717 | const char * | 708 | const char * |
718 | GNUNET_h2s_full (const struct GNUNET_HashCode *hc); | 709 | GNUNET_h2s_full(const struct GNUNET_HashCode *hc); |
719 | 710 | ||
720 | 711 | ||
721 | /** | 712 | /** |
@@ -740,7 +731,7 @@ struct GNUNET_CRYPTO_EcdhePublicKey; | |||
740 | * @return string | 731 | * @return string |
741 | */ | 732 | */ |
742 | const char * | 733 | const char * |
743 | GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p); | 734 | GNUNET_p2s(const struct GNUNET_CRYPTO_EddsaPublicKey *p); |
744 | 735 | ||
745 | 736 | ||
746 | /** | 737 | /** |
@@ -753,7 +744,7 @@ GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p); | |||
753 | * @return string | 744 | * @return string |
754 | */ | 745 | */ |
755 | const char * | 746 | const char * |
756 | GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p); | 747 | GNUNET_p2s2(const struct GNUNET_CRYPTO_EddsaPublicKey *p); |
757 | 748 | ||
758 | 749 | ||
759 | /** | 750 | /** |
@@ -766,7 +757,7 @@ GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p); | |||
766 | * @return string | 757 | * @return string |
767 | */ | 758 | */ |
768 | const char * | 759 | const char * |
769 | GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p); | 760 | GNUNET_e2s(const struct GNUNET_CRYPTO_EcdhePublicKey *p); |
770 | 761 | ||
771 | 762 | ||
772 | /** | 763 | /** |
@@ -779,7 +770,7 @@ GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p); | |||
779 | * @return string | 770 | * @return string |
780 | */ | 771 | */ |
781 | const char * | 772 | const char * |
782 | GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p); | 773 | GNUNET_e2s2(const struct GNUNET_CRYPTO_EcdhePublicKey *p); |
783 | 774 | ||
784 | 775 | ||
785 | /** | 776 | /** |
@@ -793,7 +784,7 @@ GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p); | |||
793 | * call to #GNUNET_i2s(). | 784 | * call to #GNUNET_i2s(). |
794 | */ | 785 | */ |
795 | const char * | 786 | const char * |
796 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | 787 | GNUNET_i2s(const struct GNUNET_PeerIdentity *pid); |
797 | 788 | ||
798 | 789 | ||
799 | /** | 790 | /** |
@@ -809,7 +800,7 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | |||
809 | * call to #GNUNET_i2s(). | 800 | * call to #GNUNET_i2s(). |
810 | */ | 801 | */ |
811 | const char * | 802 | const char * |
812 | GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid); | 803 | GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid); |
813 | 804 | ||
814 | 805 | ||
815 | /** | 806 | /** |
@@ -823,7 +814,7 @@ GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid); | |||
823 | * call to #GNUNET_i2s_full(). | 814 | * call to #GNUNET_i2s_full(). |
824 | */ | 815 | */ |
825 | const char * | 816 | const char * |
826 | GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid); | 817 | GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid); |
827 | 818 | ||
828 | 819 | ||
829 | /** | 820 | /** |
@@ -838,7 +829,7 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid); | |||
838 | * will be overwritten by next call to #GNUNET_a2s(). | 829 | * will be overwritten by next call to #GNUNET_a2s(). |
839 | */ | 830 | */ |
840 | const char * | 831 | const char * |
841 | GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | 832 | GNUNET_a2s(const struct sockaddr *addr, socklen_t addrlen); |
842 | 833 | ||
843 | 834 | ||
844 | /** | 835 | /** |
@@ -849,7 +840,7 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | |||
849 | * @return string corresponding to the type | 840 | * @return string corresponding to the type |
850 | */ | 841 | */ |
851 | const char * | 842 | const char * |
852 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | 843 | GNUNET_error_type_to_string(enum GNUNET_ErrorType kind); |
853 | 844 | ||
854 | 845 | ||
855 | /** | 846 | /** |
@@ -859,13 +850,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
859 | #define GNUNET_assert(cond) \ | 850 | #define GNUNET_assert(cond) \ |
860 | do \ | 851 | do \ |
861 | { \ | 852 | { \ |
862 | if (! (cond)) \ | 853 | if (!(cond)) \ |
863 | { \ | 854 | { \ |
864 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ | 855 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ |
865 | _ ("Assertion failed at %s:%d. Aborting.\n"), \ | 856 | _("Assertion failed at %s:%d. Aborting.\n"), \ |
866 | __FILE__, \ | 857 | __FILE__, \ |
867 | __LINE__); \ | 858 | __LINE__); \ |
868 | GNUNET_abort_ (); \ | 859 | GNUNET_abort_(); \ |
869 | } \ | 860 | } \ |
870 | } while (0) | 861 | } while (0) |
871 | 862 | ||
@@ -877,13 +868,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
877 | #define GNUNET_assert_at(cond, f, l) \ | 868 | #define GNUNET_assert_at(cond, f, l) \ |
878 | do \ | 869 | do \ |
879 | { \ | 870 | { \ |
880 | if (! (cond)) \ | 871 | if (!(cond)) \ |
881 | { \ | 872 | { \ |
882 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ | 873 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ |
883 | _ ("Assertion failed at %s:%d. Aborting.\n"), \ | 874 | _("Assertion failed at %s:%d. Aborting.\n"), \ |
884 | f, \ | 875 | f, \ |
885 | l); \ | 876 | l); \ |
886 | GNUNET_abort_ (); \ | 877 | GNUNET_abort_(); \ |
887 | } \ | 878 | } \ |
888 | } while (0) | 879 | } while (0) |
889 | 880 | ||
@@ -898,14 +889,14 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
898 | #define GNUNET_assert_from(cond, comp) \ | 889 | #define GNUNET_assert_from(cond, comp) \ |
899 | do \ | 890 | do \ |
900 | { \ | 891 | { \ |
901 | if (! (cond)) \ | 892 | if (!(cond)) \ |
902 | { \ | 893 | { \ |
903 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, \ | 894 | GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, \ |
904 | comp, \ | 895 | comp, \ |
905 | _ ("Assertion failed at %s:%d. Aborting.\n"), \ | 896 | _("Assertion failed at %s:%d. Aborting.\n"), \ |
906 | __FILE__, \ | 897 | __FILE__, \ |
907 | __LINE__); \ | 898 | __LINE__); \ |
908 | GNUNET_abort_ (); \ | 899 | GNUNET_abort_(); \ |
909 | } \ | 900 | } \ |
910 | } while (0) | 901 | } while (0) |
911 | 902 | ||
@@ -918,12 +909,12 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
918 | #define GNUNET_break(cond) \ | 909 | #define GNUNET_break(cond) \ |
919 | do \ | 910 | do \ |
920 | { \ | 911 | { \ |
921 | if (! (cond)) \ | 912 | if (!(cond)) \ |
922 | { \ | 913 | { \ |
923 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ | 914 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ |
924 | _ ("Assertion failed at %s:%d.\n"), \ | 915 | _("Assertion failed at %s:%d.\n"), \ |
925 | __FILE__, \ | 916 | __FILE__, \ |
926 | __LINE__); \ | 917 | __LINE__); \ |
927 | } \ | 918 | } \ |
928 | } while (0) | 919 | } while (0) |
929 | 920 | ||
@@ -940,12 +931,12 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
940 | #define GNUNET_break_op(cond) \ | 931 | #define GNUNET_break_op(cond) \ |
941 | do \ | 932 | do \ |
942 | { \ | 933 | { \ |
943 | if (! (cond)) \ | 934 | if (!(cond)) \ |
944 | { \ | 935 | { \ |
945 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, \ | 936 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, \ |
946 | _ ("External protocol violation detected at %s:%d.\n"), \ | 937 | _("External protocol violation detected at %s:%d.\n"), \ |
947 | __FILE__, \ | 938 | __FILE__, \ |
948 | __LINE__); \ | 939 | __LINE__); \ |
949 | } \ | 940 | } \ |
950 | } while (0) | 941 | } while (0) |
951 | 942 | ||
@@ -959,12 +950,12 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
959 | #define GNUNET_log_strerror(level, cmd) \ | 950 | #define GNUNET_log_strerror(level, cmd) \ |
960 | do \ | 951 | do \ |
961 | { \ | 952 | { \ |
962 | GNUNET_log (level, \ | 953 | GNUNET_log(level, \ |
963 | _ ("`%s' failed at %s:%d with error: %s\n"), \ | 954 | _("`%s' failed at %s:%d with error: %s\n"), \ |
964 | cmd, \ | 955 | cmd, \ |
965 | __FILE__, \ | 956 | __FILE__, \ |
966 | __LINE__, \ | 957 | __LINE__, \ |
967 | strerror (errno)); \ | 958 | strerror(errno)); \ |
968 | } while (0) | 959 | } while (0) |
969 | 960 | ||
970 | 961 | ||
@@ -977,13 +968,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
977 | #define GNUNET_log_from_strerror(level, component, cmd) \ | 968 | #define GNUNET_log_from_strerror(level, component, cmd) \ |
978 | do \ | 969 | do \ |
979 | { \ | 970 | { \ |
980 | GNUNET_log_from (level, \ | 971 | GNUNET_log_from(level, \ |
981 | component, \ | 972 | component, \ |
982 | _ ("`%s' failed at %s:%d with error: %s\n"), \ | 973 | _("`%s' failed at %s:%d with error: %s\n"), \ |
983 | cmd, \ | 974 | cmd, \ |
984 | __FILE__, \ | 975 | __FILE__, \ |
985 | __LINE__, \ | 976 | __LINE__, \ |
986 | strerror (errno)); \ | 977 | strerror(errno)); \ |
987 | } while (0) | 978 | } while (0) |
988 | 979 | ||
989 | 980 | ||
@@ -996,13 +987,13 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
996 | #define GNUNET_log_strerror_file(level, cmd, filename) \ | 987 | #define GNUNET_log_strerror_file(level, cmd, filename) \ |
997 | do \ | 988 | do \ |
998 | { \ | 989 | { \ |
999 | GNUNET_log (level, \ | 990 | GNUNET_log(level, \ |
1000 | _ ("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ | 991 | _("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ |
1001 | cmd, \ | 992 | cmd, \ |
1002 | filename, \ | 993 | filename, \ |
1003 | __FILE__, \ | 994 | __FILE__, \ |
1004 | __LINE__, \ | 995 | __LINE__, \ |
1005 | strerror (errno)); \ | 996 | strerror(errno)); \ |
1006 | } while (0) | 997 | } while (0) |
1007 | 998 | ||
1008 | 999 | ||
@@ -1015,14 +1006,14 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
1015 | #define GNUNET_log_from_strerror_file(level, component, cmd, filename) \ | 1006 | #define GNUNET_log_from_strerror_file(level, component, cmd, filename) \ |
1016 | do \ | 1007 | do \ |
1017 | { \ | 1008 | { \ |
1018 | GNUNET_log_from (level, \ | 1009 | GNUNET_log_from(level, \ |
1019 | component, \ | 1010 | component, \ |
1020 | _ ("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ | 1011 | _("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ |
1021 | cmd, \ | 1012 | cmd, \ |
1022 | filename, \ | 1013 | filename, \ |
1023 | __FILE__, \ | 1014 | __FILE__, \ |
1024 | __LINE__, \ | 1015 | __LINE__, \ |
1025 | strerror (errno)); \ | 1016 | strerror(errno)); \ |
1026 | } while (0) | 1017 | } while (0) |
1027 | 1018 | ||
1028 | /* ************************* endianess conversion ****************** */ | 1019 | /* ************************* endianess conversion ****************** */ |
@@ -1036,7 +1027,7 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
1036 | * @return The same value in network byte order. | 1027 | * @return The same value in network byte order. |
1037 | */ | 1028 | */ |
1038 | uint64_t | 1029 | uint64_t |
1039 | GNUNET_htonll (uint64_t n); | 1030 | GNUNET_htonll(uint64_t n); |
1040 | 1031 | ||
1041 | 1032 | ||
1042 | /** | 1033 | /** |
@@ -1048,7 +1039,7 @@ GNUNET_htonll (uint64_t n); | |||
1048 | * @return The same value in host byte order. | 1039 | * @return The same value in host byte order. |
1049 | */ | 1040 | */ |
1050 | uint64_t | 1041 | uint64_t |
1051 | GNUNET_ntohll (uint64_t n); | 1042 | GNUNET_ntohll(uint64_t n); |
1052 | 1043 | ||
1053 | 1044 | ||
1054 | /** | 1045 | /** |
@@ -1060,7 +1051,7 @@ GNUNET_ntohll (uint64_t n); | |||
1060 | * @return The same value in network byte order. | 1051 | * @return The same value in network byte order. |
1061 | */ | 1052 | */ |
1062 | double | 1053 | double |
1063 | GNUNET_hton_double (double d); | 1054 | GNUNET_hton_double(double d); |
1064 | 1055 | ||
1065 | 1056 | ||
1066 | /** | 1057 | /** |
@@ -1072,7 +1063,7 @@ GNUNET_hton_double (double d); | |||
1072 | * @return The same value in host byte order. | 1063 | * @return The same value in host byte order. |
1073 | */ | 1064 | */ |
1074 | double | 1065 | double |
1075 | GNUNET_ntoh_double (double d); | 1066 | GNUNET_ntoh_double(double d); |
1076 | 1067 | ||
1077 | 1068 | ||
1078 | /* ************************* allocation functions ****************** */ | 1069 | /* ************************* allocation functions ****************** */ |
@@ -1091,7 +1082,7 @@ GNUNET_ntoh_double (double d); | |||
1091 | * | 1082 | * |
1092 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 1083 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
1093 | */ | 1084 | */ |
1094 | #define GNUNET_new(type) (type *) GNUNET_malloc (sizeof (type)) | 1085 | #define GNUNET_new(type) (type *)GNUNET_malloc(sizeof(type)) |
1095 | 1086 | ||
1096 | 1087 | ||
1097 | /** | 1088 | /** |
@@ -1100,9 +1091,9 @@ GNUNET_ntoh_double (double d); | |||
1100 | */ | 1091 | */ |
1101 | #define GNUNET_memcmp(a, b) \ | 1092 | #define GNUNET_memcmp(a, b) \ |
1102 | ({ \ | 1093 | ({ \ |
1103 | const typeof (*b) *_a = (a); \ | 1094 | const typeof (*b) * _a = (a); \ |
1104 | const typeof (*a) *_b = (b); \ | 1095 | const typeof (*a) * _b = (b); \ |
1105 | memcmp (_a, _b, sizeof (*a)); \ | 1096 | memcmp(_a, _b, sizeof(*a)); \ |
1106 | }) | 1097 | }) |
1107 | 1098 | ||
1108 | 1099 | ||
@@ -1115,7 +1106,7 @@ GNUNET_ntoh_double (double d); | |||
1115 | #define GNUNET_is_zero(a) \ | 1106 | #define GNUNET_is_zero(a) \ |
1116 | ({ \ | 1107 | ({ \ |
1117 | static const typeof (*a) _z; \ | 1108 | static const typeof (*a) _z; \ |
1118 | memcmp ((a), &_z, sizeof (_z)); \ | 1109 | memcmp((a), &_z, sizeof(_z)); \ |
1119 | }) | 1110 | }) |
1120 | 1111 | ||
1121 | 1112 | ||
@@ -1133,7 +1124,7 @@ GNUNET_ntoh_double (double d); | |||
1133 | { \ | 1124 | { \ |
1134 | if (0 != n) \ | 1125 | if (0 != n) \ |
1135 | { \ | 1126 | { \ |
1136 | (void) memcpy (dst, src, n); \ | 1127 | (void)memcpy(dst, src, n); \ |
1137 | } \ | 1128 | } \ |
1138 | } while (0) | 1129 | } while (0) |
1139 | 1130 | ||
@@ -1147,7 +1138,7 @@ GNUNET_ntoh_double (double d); | |||
1147 | * @param n number of elements in the array | 1138 | * @param n number of elements in the array |
1148 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 1139 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
1149 | */ | 1140 | */ |
1150 | #define GNUNET_new_array(n, type) (type *) GNUNET_malloc ((n) * sizeof (type)) | 1141 | #define GNUNET_new_array(n, type) (type *)GNUNET_malloc((n) * sizeof(type)) |
1151 | 1142 | ||
1152 | /** | 1143 | /** |
1153 | * @ingroup memory | 1144 | * @ingroup memory |
@@ -1159,7 +1150,7 @@ GNUNET_ntoh_double (double d); | |||
1159 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 1150 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
1160 | */ | 1151 | */ |
1161 | #define GNUNET_new_array_2d(n, m, type) \ | 1152 | #define GNUNET_new_array_2d(n, m, type) \ |
1162 | (type **) GNUNET_xnew_array_2d_ (n, m, sizeof (type), __FILE__, __LINE__) | 1153 | (type **)GNUNET_xnew_array_2d_(n, m, sizeof(type), __FILE__, __LINE__) |
1163 | 1154 | ||
1164 | /** | 1155 | /** |
1165 | * @ingroup memory | 1156 | * @ingroup memory |
@@ -1172,7 +1163,7 @@ GNUNET_ntoh_double (double d); | |||
1172 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 1163 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
1173 | */ | 1164 | */ |
1174 | #define GNUNET_new_array_3d(n, m, o, type) \ | 1165 | #define GNUNET_new_array_3d(n, m, o, type) \ |
1175 | (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof (type), __FILE__, __LINE__) | 1166 | (type ***)GNUNET_xnew_array_3d_(n, m, o, sizeof(type), __FILE__, __LINE__) |
1176 | 1167 | ||
1177 | /** | 1168 | /** |
1178 | * @ingroup memory | 1169 | * @ingroup memory |
@@ -1183,7 +1174,7 @@ GNUNET_ntoh_double (double d); | |||
1183 | * smaller than 40 MB. | 1174 | * smaller than 40 MB. |
1184 | * @return pointer to size bytes of memory, never NULL (!) | 1175 | * @return pointer to size bytes of memory, never NULL (!) |
1185 | */ | 1176 | */ |
1186 | #define GNUNET_malloc(size) GNUNET_xmalloc_ (size, __FILE__, __LINE__) | 1177 | #define GNUNET_malloc(size) GNUNET_xmalloc_(size, __FILE__, __LINE__) |
1187 | 1178 | ||
1188 | /** | 1179 | /** |
1189 | * @ingroup memory | 1180 | * @ingroup memory |
@@ -1193,7 +1184,7 @@ GNUNET_ntoh_double (double d); | |||
1193 | * @param size the number of bytes in buf (and size of the allocation) | 1184 | * @param size the number of bytes in buf (and size of the allocation) |
1194 | * @return pointer to size bytes of memory, never NULL (!) | 1185 | * @return pointer to size bytes of memory, never NULL (!) |
1195 | */ | 1186 | */ |
1196 | #define GNUNET_memdup(buf, size) GNUNET_xmemdup_ (buf, size, __FILE__, __LINE__) | 1187 | #define GNUNET_memdup(buf, size) GNUNET_xmemdup_(buf, size, __FILE__, __LINE__) |
1197 | 1188 | ||
1198 | /** | 1189 | /** |
1199 | * @ingroup memory | 1190 | * @ingroup memory |
@@ -1204,7 +1195,7 @@ GNUNET_ntoh_double (double d); | |||
1204 | * @return pointer to size bytes of memory, NULL if we do not have enough memory | 1195 | * @return pointer to size bytes of memory, NULL if we do not have enough memory |
1205 | */ | 1196 | */ |
1206 | #define GNUNET_malloc_large(size) \ | 1197 | #define GNUNET_malloc_large(size) \ |
1207 | GNUNET_xmalloc_unchecked_ (size, __FILE__, __LINE__) | 1198 | GNUNET_xmalloc_unchecked_(size, __FILE__, __LINE__) |
1208 | 1199 | ||
1209 | /** | 1200 | /** |
1210 | * @ingroup memory | 1201 | * @ingroup memory |
@@ -1216,7 +1207,7 @@ GNUNET_ntoh_double (double d); | |||
1216 | * @return pointer to size bytes of memory | 1207 | * @return pointer to size bytes of memory |
1217 | */ | 1208 | */ |
1218 | #define GNUNET_realloc(ptr, size) \ | 1209 | #define GNUNET_realloc(ptr, size) \ |
1219 | GNUNET_xrealloc_ (ptr, size, __FILE__, __LINE__) | 1210 | GNUNET_xrealloc_(ptr, size, __FILE__, __LINE__) |
1220 | 1211 | ||
1221 | /** | 1212 | /** |
1222 | * @ingroup memory | 1213 | * @ingroup memory |
@@ -1227,7 +1218,7 @@ GNUNET_ntoh_double (double d); | |||
1227 | * @param ptr location where to free the memory. ptr must have | 1218 | * @param ptr location where to free the memory. ptr must have |
1228 | * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. | 1219 | * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. |
1229 | */ | 1220 | */ |
1230 | #define GNUNET_free(ptr) GNUNET_xfree_ (ptr, __FILE__, __LINE__) | 1221 | #define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__) |
1231 | 1222 | ||
1232 | /** | 1223 | /** |
1233 | * @ingroup memory | 1224 | * @ingroup memory |
@@ -1242,7 +1233,7 @@ GNUNET_ntoh_double (double d); | |||
1242 | void *__x__ = ptr; \ | 1233 | void *__x__ = ptr; \ |
1243 | if (__x__ != NULL) \ | 1234 | if (__x__ != NULL) \ |
1244 | { \ | 1235 | { \ |
1245 | GNUNET_free (__x__); \ | 1236 | GNUNET_free(__x__); \ |
1246 | } \ | 1237 | } \ |
1247 | } while (0) | 1238 | } while (0) |
1248 | 1239 | ||
@@ -1254,7 +1245,7 @@ GNUNET_ntoh_double (double d); | |||
1254 | * @param a pointer to a zero-terminated string | 1245 | * @param a pointer to a zero-terminated string |
1255 | * @return a copy of the string including zero-termination | 1246 | * @return a copy of the string including zero-termination |
1256 | */ | 1247 | */ |
1257 | #define GNUNET_strdup(a) GNUNET_xstrdup_ (a, __FILE__, __LINE__) | 1248 | #define GNUNET_strdup(a) GNUNET_xstrdup_(a, __FILE__, __LINE__) |
1258 | 1249 | ||
1259 | /** | 1250 | /** |
1260 | * @ingroup memory | 1251 | * @ingroup memory |
@@ -1266,7 +1257,7 @@ GNUNET_ntoh_double (double d); | |||
1266 | * @return a partial copy of the string including zero-termination | 1257 | * @return a partial copy of the string including zero-termination |
1267 | */ | 1258 | */ |
1268 | #define GNUNET_strndup(a, length) \ | 1259 | #define GNUNET_strndup(a, length) \ |
1269 | GNUNET_xstrndup_ (a, length, __FILE__, __LINE__) | 1260 | GNUNET_xstrndup_(a, length, __FILE__, __LINE__) |
1270 | 1261 | ||
1271 | /** | 1262 | /** |
1272 | * @ingroup memory | 1263 | * @ingroup memory |
@@ -1304,12 +1295,12 @@ GNUNET_ntoh_double (double d); | |||
1304 | * free the vector (then, arr will be NULL afterwards). | 1295 | * free the vector (then, arr will be NULL afterwards). |
1305 | */ | 1296 | */ |
1306 | #define GNUNET_array_grow(arr, size, tsize) \ | 1297 | #define GNUNET_array_grow(arr, size, tsize) \ |
1307 | GNUNET_xgrow_ ((void **) &(arr), \ | 1298 | GNUNET_xgrow_((void **)&(arr), \ |
1308 | sizeof ((arr)[0]), \ | 1299 | sizeof((arr)[0]), \ |
1309 | &size, \ | 1300 | &size, \ |
1310 | tsize, \ | 1301 | tsize, \ |
1311 | __FILE__, \ | 1302 | __FILE__, \ |
1312 | __LINE__) | 1303 | __LINE__) |
1313 | 1304 | ||
1314 | /** | 1305 | /** |
1315 | * @ingroup memory | 1306 | * @ingroup memory |
@@ -1327,7 +1318,7 @@ GNUNET_ntoh_double (double d); | |||
1327 | #define GNUNET_array_append(arr, size, element) \ | 1318 | #define GNUNET_array_append(arr, size, element) \ |
1328 | do \ | 1319 | do \ |
1329 | { \ | 1320 | { \ |
1330 | GNUNET_array_grow (arr, size, size + 1); \ | 1321 | GNUNET_array_grow(arr, size, size + 1); \ |
1331 | (arr)[size - 1] = element; \ | 1322 | (arr)[size - 1] = element; \ |
1332 | } while (0) | 1323 | } while (0) |
1333 | 1324 | ||
@@ -1342,7 +1333,7 @@ GNUNET_ntoh_double (double d); | |||
1342 | * @return number of bytes written to buf or negative value on error | 1333 | * @return number of bytes written to buf or negative value on error |
1343 | */ | 1334 | */ |
1344 | int | 1335 | int |
1345 | GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | 1336 | GNUNET_snprintf(char *buf, size_t size, const char *format, ...); |
1346 | 1337 | ||
1347 | 1338 | ||
1348 | /** | 1339 | /** |
@@ -1355,7 +1346,7 @@ GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | |||
1355 | * @return number of bytes in "*buf" excluding 0-termination | 1346 | * @return number of bytes in "*buf" excluding 0-termination |
1356 | */ | 1347 | */ |
1357 | int | 1348 | int |
1358 | GNUNET_asprintf (char **buf, const char *format, ...); | 1349 | GNUNET_asprintf(char **buf, const char *format, ...); |
1359 | 1350 | ||
1360 | 1351 | ||
1361 | /* ************** internal implementations, use macros above! ************** */ | 1352 | /* ************** internal implementations, use macros above! ************** */ |
@@ -1372,7 +1363,7 @@ GNUNET_asprintf (char **buf, const char *format, ...); | |||
1372 | * @return allocated memory, never NULL | 1363 | * @return allocated memory, never NULL |
1373 | */ | 1364 | */ |
1374 | void * | 1365 | void * |
1375 | GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | 1366 | GNUNET_xmalloc_(size_t size, const char *filename, int linenumber); |
1376 | 1367 | ||
1377 | 1368 | ||
1378 | /** | 1369 | /** |
@@ -1390,11 +1381,11 @@ GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | |||
1390 | * @return allocated memory, never NULL | 1381 | * @return allocated memory, never NULL |
1391 | */ | 1382 | */ |
1392 | void ** | 1383 | void ** |
1393 | GNUNET_xnew_array_2d_ (size_t n, | 1384 | GNUNET_xnew_array_2d_(size_t n, |
1394 | size_t m, | 1385 | size_t m, |
1395 | size_t elementSize, | 1386 | size_t elementSize, |
1396 | const char *filename, | 1387 | const char *filename, |
1397 | int linenumber); | 1388 | int linenumber); |
1398 | 1389 | ||
1399 | 1390 | ||
1400 | /** | 1391 | /** |
@@ -1413,12 +1404,12 @@ GNUNET_xnew_array_2d_ (size_t n, | |||
1413 | * @return allocated memory, never NULL | 1404 | * @return allocated memory, never NULL |
1414 | */ | 1405 | */ |
1415 | void *** | 1406 | void *** |
1416 | GNUNET_xnew_array_3d_ (size_t n, | 1407 | GNUNET_xnew_array_3d_(size_t n, |
1417 | size_t m, | 1408 | size_t m, |
1418 | size_t o, | 1409 | size_t o, |
1419 | size_t elementSize, | 1410 | size_t elementSize, |
1420 | const char *filename, | 1411 | const char *filename, |
1421 | int linenumber); | 1412 | int linenumber); |
1422 | 1413 | ||
1423 | 1414 | ||
1424 | /** | 1415 | /** |
@@ -1433,10 +1424,10 @@ GNUNET_xnew_array_3d_ (size_t n, | |||
1433 | * @return allocated memory, never NULL | 1424 | * @return allocated memory, never NULL |
1434 | */ | 1425 | */ |
1435 | void * | 1426 | void * |
1436 | GNUNET_xmemdup_ (const void *buf, | 1427 | GNUNET_xmemdup_(const void *buf, |
1437 | size_t size, | 1428 | size_t size, |
1438 | const char *filename, | 1429 | const char *filename, |
1439 | int linenumber); | 1430 | int linenumber); |
1440 | 1431 | ||
1441 | 1432 | ||
1442 | /** | 1433 | /** |
@@ -1452,7 +1443,7 @@ GNUNET_xmemdup_ (const void *buf, | |||
1452 | * @return pointer to size bytes of memory, NULL if we do not have enough memory | 1443 | * @return pointer to size bytes of memory, NULL if we do not have enough memory |
1453 | */ | 1444 | */ |
1454 | void * | 1445 | void * |
1455 | GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); | 1446 | GNUNET_xmalloc_unchecked_(size_t size, const char *filename, int linenumber); |
1456 | 1447 | ||
1457 | 1448 | ||
1458 | /** | 1449 | /** |
@@ -1460,7 +1451,7 @@ GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); | |||
1460 | * memory is available. | 1451 | * memory is available. |
1461 | */ | 1452 | */ |
1462 | void * | 1453 | void * |
1463 | GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); | 1454 | GNUNET_xrealloc_(void *ptr, size_t n, const char *filename, int linenumber); |
1464 | 1455 | ||
1465 | 1456 | ||
1466 | /** | 1457 | /** |
@@ -1473,7 +1464,7 @@ GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); | |||
1473 | * @param linenumber line where this call is being made (for debugging) | 1464 | * @param linenumber line where this call is being made (for debugging) |
1474 | */ | 1465 | */ |
1475 | void | 1466 | void |
1476 | GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | 1467 | GNUNET_xfree_(void *ptr, const char *filename, int linenumber); |
1477 | 1468 | ||
1478 | 1469 | ||
1479 | /** | 1470 | /** |
@@ -1484,7 +1475,7 @@ GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | |||
1484 | * @return the duplicated string | 1475 | * @return the duplicated string |
1485 | */ | 1476 | */ |
1486 | char * | 1477 | char * |
1487 | GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | 1478 | GNUNET_xstrdup_(const char *str, const char *filename, int linenumber); |
1488 | 1479 | ||
1489 | /** | 1480 | /** |
1490 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the #GNUNET_strndup macro. | 1481 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the #GNUNET_strndup macro. |
@@ -1496,10 +1487,10 @@ GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | |||
1496 | * @return the duplicated string | 1487 | * @return the duplicated string |
1497 | */ | 1488 | */ |
1498 | char * | 1489 | char * |
1499 | GNUNET_xstrndup_ (const char *str, | 1490 | GNUNET_xstrndup_(const char *str, |
1500 | size_t len, | 1491 | size_t len, |
1501 | const char *filename, | 1492 | const char *filename, |
1502 | int linenumber); | 1493 | int linenumber); |
1503 | 1494 | ||
1504 | /** | 1495 | /** |
1505 | * Grow an array, the new elements are zeroed out. | 1496 | * Grow an array, the new elements are zeroed out. |
@@ -1517,12 +1508,12 @@ GNUNET_xstrndup_ (const char *str, | |||
1517 | * @param linenumber line where this call is being made (for debugging) | 1508 | * @param linenumber line where this call is being made (for debugging) |
1518 | */ | 1509 | */ |
1519 | void | 1510 | void |
1520 | GNUNET_xgrow_ (void **old, | 1511 | GNUNET_xgrow_(void **old, |
1521 | size_t elementSize, | 1512 | size_t elementSize, |
1522 | unsigned int *oldCount, | 1513 | unsigned int *oldCount, |
1523 | unsigned int newCount, | 1514 | unsigned int newCount, |
1524 | const char *filename, | 1515 | const char *filename, |
1525 | int linenumber); | 1516 | int linenumber); |
1526 | 1517 | ||
1527 | 1518 | ||
1528 | /** | 1519 | /** |
@@ -1533,7 +1524,7 @@ GNUNET_xgrow_ (void **old, | |||
1533 | * @return duplicate of the message | 1524 | * @return duplicate of the message |
1534 | */ | 1525 | */ |
1535 | struct GNUNET_MessageHeader * | 1526 | struct GNUNET_MessageHeader * |
1536 | GNUNET_copy_message (const struct GNUNET_MessageHeader *msg); | 1527 | GNUNET_copy_message(const struct GNUNET_MessageHeader *msg); |
1537 | 1528 | ||
1538 | 1529 | ||
1539 | /** | 1530 | /** |
@@ -1543,8 +1534,8 @@ GNUNET_copy_message (const struct GNUNET_MessageHeader *msg); | |||
1543 | * @param old_scope[out] location to save the old scope | 1534 | * @param old_scope[out] location to save the old scope |
1544 | */ | 1535 | */ |
1545 | void | 1536 | void |
1546 | GNUNET_async_scope_enter (const struct GNUNET_AsyncScopeId *aid, | 1537 | GNUNET_async_scope_enter(const struct GNUNET_AsyncScopeId *aid, |
1547 | struct GNUNET_AsyncScopeSave *old_scope); | 1538 | struct GNUNET_AsyncScopeSave *old_scope); |
1548 | 1539 | ||
1549 | 1540 | ||
1550 | /** | 1541 | /** |
@@ -1553,7 +1544,7 @@ GNUNET_async_scope_enter (const struct GNUNET_AsyncScopeId *aid, | |||
1553 | * @param old_scope scope to restore | 1544 | * @param old_scope scope to restore |
1554 | */ | 1545 | */ |
1555 | void | 1546 | void |
1556 | GNUNET_async_scope_restore (struct GNUNET_AsyncScopeSave *old_scope); | 1547 | GNUNET_async_scope_restore(struct GNUNET_AsyncScopeSave *old_scope); |
1557 | 1548 | ||
1558 | 1549 | ||
1559 | /** | 1550 | /** |
@@ -1562,7 +1553,7 @@ GNUNET_async_scope_restore (struct GNUNET_AsyncScopeSave *old_scope); | |||
1562 | * @param[out] scope_ret pointer to where the result is stored | 1553 | * @param[out] scope_ret pointer to where the result is stored |
1563 | */ | 1554 | */ |
1564 | void | 1555 | void |
1565 | GNUNET_async_scope_get (struct GNUNET_AsyncScopeSave *scope_ret); | 1556 | GNUNET_async_scope_get(struct GNUNET_AsyncScopeSave *scope_ret); |
1566 | 1557 | ||
1567 | 1558 | ||
1568 | /** | 1559 | /** |
@@ -1571,7 +1562,7 @@ GNUNET_async_scope_get (struct GNUNET_AsyncScopeSave *scope_ret); | |||
1571 | * @param[out] aid_ret pointer to where the result is stored | 1562 | * @param[out] aid_ret pointer to where the result is stored |
1572 | */ | 1563 | */ |
1573 | void | 1564 | void |
1574 | GNUNET_async_scope_fresh (struct GNUNET_AsyncScopeId *aid_ret); | 1565 | GNUNET_async_scope_fresh(struct GNUNET_AsyncScopeId *aid_ret); |
1575 | 1566 | ||
1576 | 1567 | ||
1577 | #if __STDC_VERSION__ < 199901L | 1568 | #if __STDC_VERSION__ < 199901L |
@@ -1590,8 +1581,7 @@ GNUNET_async_scope_fresh (struct GNUNET_AsyncScopeId *aid_ret); | |||
1590 | * be in gnunet_scheduler_lib.h, but it works if we declare it here. | 1581 | * be in gnunet_scheduler_lib.h, but it works if we declare it here. |
1591 | * Naturally, logically this is part of the scheduler. | 1582 | * Naturally, logically this is part of the scheduler. |
1592 | */ | 1583 | */ |
1593 | enum GNUNET_SCHEDULER_Priority | 1584 | enum GNUNET_SCHEDULER_Priority { |
1594 | { | ||
1595 | /** | 1585 | /** |
1596 | * Run with the same priority as the current job. | 1586 | * Run with the same priority as the current job. |
1597 | */ | 1587 | */ |
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index a0e73f474..4d1bb6b79 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -51,7 +51,7 @@ struct GNUNET_CONFIGURATION_Handle; | |||
51 | * @return fresh configuration object | 51 | * @return fresh configuration object |
52 | */ | 52 | */ |
53 | struct GNUNET_CONFIGURATION_Handle * | 53 | struct GNUNET_CONFIGURATION_Handle * |
54 | GNUNET_CONFIGURATION_create (void); | 54 | GNUNET_CONFIGURATION_create(void); |
55 | 55 | ||
56 | 56 | ||
57 | /** | 57 | /** |
@@ -61,7 +61,7 @@ GNUNET_CONFIGURATION_create (void); | |||
61 | * @return duplicate configuration | 61 | * @return duplicate configuration |
62 | */ | 62 | */ |
63 | struct GNUNET_CONFIGURATION_Handle * | 63 | struct GNUNET_CONFIGURATION_Handle * |
64 | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg); | 64 | GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg); |
65 | 65 | ||
66 | 66 | ||
67 | /** | 67 | /** |
@@ -70,7 +70,7 @@ GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
70 | * @param cfg configuration to destroy | 70 | * @param cfg configuration to destroy |
71 | */ | 71 | */ |
72 | void | 72 | void |
73 | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | 73 | GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg); |
74 | 74 | ||
75 | 75 | ||
76 | /** | 76 | /** |
@@ -83,8 +83,8 @@ GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | |||
83 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 83 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
84 | */ | 84 | */ |
85 | int | 85 | int |
86 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 86 | GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, |
87 | const char *filename); | 87 | const char *filename); |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
@@ -96,8 +96,8 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
96 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 96 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
97 | */ | 97 | */ |
98 | int | 98 | int |
99 | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, | 99 | GNUNET_CONFIGURATION_load_from(struct GNUNET_CONFIGURATION_Handle *cfg, |
100 | const char *defaults_d); | 100 | const char *defaults_d); |
101 | 101 | ||
102 | 102 | ||
103 | /** | 103 | /** |
@@ -109,8 +109,8 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
109 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 109 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
110 | */ | 110 | */ |
111 | int | 111 | int |
112 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | 112 | GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg, |
113 | const char *filename); | 113 | const char *filename); |
114 | 114 | ||
115 | 115 | ||
116 | /** | 116 | /** |
@@ -122,8 +122,8 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
122 | * present. This memory should be freed by the caller | 122 | * present. This memory should be freed by the caller |
123 | */ | 123 | */ |
124 | char * | 124 | char * |
125 | GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | 125 | GNUNET_CONFIGURATION_serialize(const struct GNUNET_CONFIGURATION_Handle *cfg, |
126 | size_t *size); | 126 | size_t *size); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -138,10 +138,10 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
138 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 138 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
139 | */ | 139 | */ |
140 | int | 140 | int |
141 | GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, | 141 | GNUNET_CONFIGURATION_deserialize(struct GNUNET_CONFIGURATION_Handle *cfg, |
142 | const char *mem, | 142 | const char *mem, |
143 | size_t size, | 143 | size_t size, |
144 | const char *basedir); | 144 | const char *basedir); |
145 | 145 | ||
146 | 146 | ||
147 | /** | 147 | /** |
@@ -152,8 +152,8 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
152 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 152 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
153 | */ | 153 | */ |
154 | int | 154 | int |
155 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | 155 | GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg, |
156 | const char *filename); | 156 | const char *filename); |
157 | 157 | ||
158 | 158 | ||
159 | /** | 159 | /** |
@@ -164,9 +164,9 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
164 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 164 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
165 | */ | 165 | */ |
166 | int | 166 | int |
167 | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_default, | 167 | GNUNET_CONFIGURATION_write_diffs(const struct GNUNET_CONFIGURATION_Handle *cfg_default, |
168 | const struct GNUNET_CONFIGURATION_Handle *cfg_new, | 168 | const struct GNUNET_CONFIGURATION_Handle *cfg_new, |
169 | const char *filename); | 169 | const char *filename); |
170 | 170 | ||
171 | 171 | ||
172 | /** | 172 | /** |
@@ -177,8 +177,8 @@ GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_ | |||
177 | * @return configuration with only the differences, never NULL | 177 | * @return configuration with only the differences, never NULL |
178 | */ | 178 | */ |
179 | struct GNUNET_CONFIGURATION_Handle * | 179 | struct GNUNET_CONFIGURATION_Handle * |
180 | GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_default, | 180 | GNUNET_CONFIGURATION_get_diff(const struct GNUNET_CONFIGURATION_Handle *cfg_default, |
181 | const struct GNUNET_CONFIGURATION_Handle *cfg_new); | 181 | const struct GNUNET_CONFIGURATION_Handle *cfg_new); |
182 | 182 | ||
183 | 183 | ||
184 | /** | 184 | /** |
@@ -189,7 +189,7 @@ GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_def | |||
189 | * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed) | 189 | * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed) |
190 | */ | 190 | */ |
191 | int | 191 | int |
192 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); | 192 | GNUNET_CONFIGURATION_is_dirty(const struct GNUNET_CONFIGURATION_Handle *cfg); |
193 | 193 | ||
194 | 194 | ||
195 | /** | 195 | /** |
@@ -201,7 +201,7 @@ GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
201 | */ | 201 | */ |
202 | typedef int | 202 | typedef int |
203 | (*GNUNET_CONFIGURATION_Callback)(void *cls, | 203 | (*GNUNET_CONFIGURATION_Callback)(void *cls, |
204 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 204 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
205 | 205 | ||
206 | 206 | ||
207 | /** | 207 | /** |
@@ -216,9 +216,9 @@ typedef int | |||
216 | * otherwise return value from @a cb. | 216 | * otherwise return value from @a cb. |
217 | */ | 217 | */ |
218 | int | 218 | int |
219 | GNUNET_CONFIGURATION_parse_and_run (const char *filename, | 219 | GNUNET_CONFIGURATION_parse_and_run(const char *filename, |
220 | GNUNET_CONFIGURATION_Callback cb, | 220 | GNUNET_CONFIGURATION_Callback cb, |
221 | void *cb_cls); | 221 | void *cb_cls); |
222 | 222 | ||
223 | 223 | ||
224 | /** | 224 | /** |
@@ -255,9 +255,9 @@ typedef void | |||
255 | * @param iter_cls closure for @a iter | 255 | * @param iter_cls closure for @a iter |
256 | */ | 256 | */ |
257 | void | 257 | void |
258 | GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | 258 | GNUNET_CONFIGURATION_iterate(const struct GNUNET_CONFIGURATION_Handle *cfg, |
259 | GNUNET_CONFIGURATION_Iterator iter, | 259 | GNUNET_CONFIGURATION_Iterator iter, |
260 | void *iter_cls); | 260 | void *iter_cls); |
261 | 261 | ||
262 | 262 | ||
263 | /** | 263 | /** |
@@ -268,9 +268,9 @@ GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
268 | * @param iter_cls closure for @a iter | 268 | * @param iter_cls closure for @a iter |
269 | */ | 269 | */ |
270 | void | 270 | void |
271 | GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg, | 271 | GNUNET_CONFIGURATION_iterate_sections(const struct GNUNET_CONFIGURATION_Handle *cfg, |
272 | GNUNET_CONFIGURATION_Section_Iterator iter, | 272 | GNUNET_CONFIGURATION_Section_Iterator iter, |
273 | void *iter_cls); | 273 | void *iter_cls); |
274 | 274 | ||
275 | 275 | ||
276 | /** | 276 | /** |
@@ -280,8 +280,8 @@ GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle | |||
280 | * @param section name of the section to remove | 280 | * @param section name of the section to remove |
281 | */ | 281 | */ |
282 | void | 282 | void |
283 | GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, | 283 | GNUNET_CONFIGURATION_remove_section(struct GNUNET_CONFIGURATION_Handle *cfg, |
284 | const char *section); | 284 | const char *section); |
285 | 285 | ||
286 | 286 | ||
287 | /** | 287 | /** |
@@ -294,10 +294,10 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
294 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 294 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
295 | */ | 295 | */ |
296 | int | 296 | int |
297 | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle *cfg, | 297 | GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, |
298 | const char *section, | 298 | const char *section, |
299 | const char *option, | 299 | const char *option, |
300 | unsigned long long *number); | 300 | unsigned long long *number); |
301 | 301 | ||
302 | 302 | ||
303 | /** | 303 | /** |
@@ -310,10 +310,10 @@ GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle | |||
310 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 310 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
311 | */ | 311 | */ |
312 | int | 312 | int |
313 | GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle *cfg, | 313 | GNUNET_CONFIGURATION_get_value_float(const struct GNUNET_CONFIGURATION_Handle *cfg, |
314 | const char *section, | 314 | const char *section, |
315 | const char *option, | 315 | const char *option, |
316 | float *number); | 316 | float *number); |
317 | 317 | ||
318 | 318 | ||
319 | /** | 319 | /** |
@@ -326,10 +326,10 @@ GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle | |||
326 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 326 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
327 | */ | 327 | */ |
328 | int | 328 | int |
329 | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *cfg, | 329 | GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, |
330 | const char *section, | 330 | const char *section, |
331 | const char *option, | 331 | const char *option, |
332 | struct GNUNET_TIME_Relative *time); | 332 | struct GNUNET_TIME_Relative *time); |
333 | 333 | ||
334 | 334 | ||
335 | 335 | ||
@@ -343,10 +343,10 @@ GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *c | |||
343 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 343 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
344 | */ | 344 | */ |
345 | int | 345 | int |
346 | GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *cfg, | 346 | GNUNET_CONFIGURATION_get_value_size(const struct GNUNET_CONFIGURATION_Handle *cfg, |
347 | const char *section, | 347 | const char *section, |
348 | const char *option, | 348 | const char *option, |
349 | unsigned long long *size); | 349 | unsigned long long *size); |
350 | 350 | ||
351 | 351 | ||
352 | /** | 352 | /** |
@@ -358,9 +358,9 @@ GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *c | |||
358 | * @return #GNUNET_YES if so, #GNUNET_NO if not. | 358 | * @return #GNUNET_YES if so, #GNUNET_NO if not. |
359 | */ | 359 | */ |
360 | int | 360 | int |
361 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | 361 | GNUNET_CONFIGURATION_have_value(const struct GNUNET_CONFIGURATION_Handle *cfg, |
362 | const char *section, | 362 | const char *section, |
363 | const char *option); | 363 | const char *option); |
364 | 364 | ||
365 | 365 | ||
366 | /** | 366 | /** |
@@ -374,10 +374,10 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
374 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 374 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
375 | */ | 375 | */ |
376 | int | 376 | int |
377 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg, | 377 | GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, |
378 | const char *section, | 378 | const char *section, |
379 | const char *option, | 379 | const char *option, |
380 | char **value); | 380 | char **value); |
381 | 381 | ||
382 | 382 | ||
383 | /** | 383 | /** |
@@ -392,10 +392,10 @@ GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle | |||
392 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 392 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
393 | */ | 393 | */ |
394 | int | 394 | int |
395 | GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, | 395 | GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, |
396 | const char *section, | 396 | const char *section, |
397 | const char *option, | 397 | const char *option, |
398 | char **value); | 398 | char **value); |
399 | 399 | ||
400 | 400 | ||
401 | /** | 401 | /** |
@@ -409,11 +409,11 @@ GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handl | |||
409 | * @return number of filenames iterated over, -1 on error | 409 | * @return number of filenames iterated over, -1 on error |
410 | */ | 410 | */ |
411 | int | 411 | int |
412 | GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_Handle *cfg, | 412 | GNUNET_CONFIGURATION_iterate_value_filenames(const struct GNUNET_CONFIGURATION_Handle *cfg, |
413 | const char *section, | 413 | const char *section, |
414 | const char *option, | 414 | const char *option, |
415 | GNUNET_FileNameCallback cb, | 415 | GNUNET_FileNameCallback cb, |
416 | void *cb_cls); | 416 | void *cb_cls); |
417 | 417 | ||
418 | /** | 418 | /** |
419 | * Iterate over values of a section in the configuration. | 419 | * Iterate over values of a section in the configuration. |
@@ -424,10 +424,10 @@ GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_ | |||
424 | * @param iter_cls closure for @a iter | 424 | * @param iter_cls closure for @a iter |
425 | */ | 425 | */ |
426 | void | 426 | void |
427 | GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_Handle *cfg, | 427 | GNUNET_CONFIGURATION_iterate_section_values(const struct GNUNET_CONFIGURATION_Handle *cfg, |
428 | const char *section, | 428 | const char *section, |
429 | GNUNET_CONFIGURATION_Iterator iter, | 429 | GNUNET_CONFIGURATION_Iterator iter, |
430 | void *iter_cls); | 430 | void *iter_cls); |
431 | 431 | ||
432 | /** | 432 | /** |
433 | * Get a configuration value that should be in a set of | 433 | * Get a configuration value that should be in a set of |
@@ -442,11 +442,11 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_H | |||
442 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 442 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
443 | */ | 443 | */ |
444 | int | 444 | int |
445 | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle *cfg, | 445 | GNUNET_CONFIGURATION_get_value_choice(const struct GNUNET_CONFIGURATION_Handle *cfg, |
446 | const char *section, | 446 | const char *section, |
447 | const char *option, | 447 | const char *option, |
448 | const char *const *choices, | 448 | const char *const *choices, |
449 | const char **value); | 449 | const char **value); |
450 | 450 | ||
451 | /** | 451 | /** |
452 | * Get a configuration value that should be in a set of | 452 | * Get a configuration value that should be in a set of |
@@ -458,9 +458,9 @@ GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle | |||
458 | * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR | 458 | * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR |
459 | */ | 459 | */ |
460 | int | 460 | int |
461 | GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg, | 461 | GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, |
462 | const char *section, | 462 | const char *section, |
463 | const char *option); | 463 | const char *option); |
464 | 464 | ||
465 | 465 | ||
466 | /** | 466 | /** |
@@ -476,11 +476,11 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle * | |||
476 | * #GNUNET_SYSERR on decoding error | 476 | * #GNUNET_SYSERR on decoding error |
477 | */ | 477 | */ |
478 | int | 478 | int |
479 | GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, | 479 | GNUNET_CONFIGURATION_get_data(const struct GNUNET_CONFIGURATION_Handle *cfg, |
480 | const char *section, | 480 | const char *section, |
481 | const char *option, | 481 | const char *option, |
482 | void *buf, | 482 | void *buf, |
483 | size_t buf_size); | 483 | size_t buf_size); |
484 | 484 | ||
485 | 485 | ||
486 | /** | 486 | /** |
@@ -500,8 +500,8 @@ GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
500 | * @return $-expanded string | 500 | * @return $-expanded string |
501 | */ | 501 | */ |
502 | char * | 502 | char * |
503 | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, | 503 | GNUNET_CONFIGURATION_expand_dollar(const struct GNUNET_CONFIGURATION_Handle *cfg, |
504 | char *orig); | 504 | char *orig); |
505 | 505 | ||
506 | 506 | ||
507 | /** | 507 | /** |
@@ -513,10 +513,10 @@ GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cf | |||
513 | * @param number value to set | 513 | * @param number value to set |
514 | */ | 514 | */ |
515 | void | 515 | void |
516 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, | 516 | GNUNET_CONFIGURATION_set_value_number(struct GNUNET_CONFIGURATION_Handle *cfg, |
517 | const char *section, | 517 | const char *section, |
518 | const char *option, | 518 | const char *option, |
519 | unsigned long long number); | 519 | unsigned long long number); |
520 | 520 | ||
521 | 521 | ||
522 | /** | 522 | /** |
@@ -528,10 +528,10 @@ GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
528 | * @param value value to set | 528 | * @param value value to set |
529 | */ | 529 | */ |
530 | void | 530 | void |
531 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, | 531 | GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, |
532 | const char *section, | 532 | const char *section, |
533 | const char *option, | 533 | const char *option, |
534 | const char *value); | 534 | const char *value); |
535 | 535 | ||
536 | 536 | ||
537 | /** | 537 | /** |
@@ -546,10 +546,10 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
546 | * #GNUNET_SYSERR if the filename is not in the list | 546 | * #GNUNET_SYSERR if the filename is not in the list |
547 | */ | 547 | */ |
548 | int | 548 | int |
549 | GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, | 549 | GNUNET_CONFIGURATION_remove_value_filename(struct GNUNET_CONFIGURATION_Handle *cfg, |
550 | const char *section, | 550 | const char *section, |
551 | const char *option, | 551 | const char *option, |
552 | const char *value); | 552 | const char *value); |
553 | 553 | ||
554 | 554 | ||
555 | /** | 555 | /** |
@@ -564,10 +564,10 @@ GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle * | |||
564 | * #GNUNET_SYSERR if the filename already in the list | 564 | * #GNUNET_SYSERR if the filename already in the list |
565 | */ | 565 | */ |
566 | int | 566 | int |
567 | GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, | 567 | GNUNET_CONFIGURATION_append_value_filename(struct GNUNET_CONFIGURATION_Handle *cfg, |
568 | const char *section, | 568 | const char *section, |
569 | const char *option, | 569 | const char *option, |
570 | const char *value); | 570 | const char *value); |
571 | 571 | ||
572 | #if 0 /* keep Emacsens' auto-indent happy */ | 572 | #if 0 /* keep Emacsens' auto-indent happy */ |
573 | { | 573 | { |
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h index 19736f241..e864b5337 100644 --- a/src/include/gnunet_consensus_service.h +++ b/src/include/gnunet_consensus_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -93,14 +93,14 @@ struct GNUNET_CONSENSUS_Handle; | |||
93 | * @return handle to use, NULL on error | 93 | * @return handle to use, NULL on error |
94 | */ | 94 | */ |
95 | struct GNUNET_CONSENSUS_Handle * | 95 | struct GNUNET_CONSENSUS_Handle * |
96 | GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 96 | GNUNET_CONSENSUS_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
97 | unsigned int num_peers, | 97 | unsigned int num_peers, |
98 | const struct GNUNET_PeerIdentity *peers, | 98 | const struct GNUNET_PeerIdentity *peers, |
99 | const struct GNUNET_HashCode *session_id, | 99 | const struct GNUNET_HashCode *session_id, |
100 | struct GNUNET_TIME_Absolute start, | 100 | struct GNUNET_TIME_Absolute start, |
101 | struct GNUNET_TIME_Absolute deadline, | 101 | struct GNUNET_TIME_Absolute deadline, |
102 | GNUNET_CONSENSUS_ElementCallback new_element_cb, | 102 | GNUNET_CONSENSUS_ElementCallback new_element_cb, |
103 | void *new_element_cls); | 103 | void *new_element_cls); |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
@@ -132,10 +132,10 @@ typedef void (*GNUNET_CONSENSUS_InsertDoneCallback) (void *cls, | |||
132 | * @param idc_cls closure for @a idc | 132 | * @param idc_cls closure for @a idc |
133 | */ | 133 | */ |
134 | void | 134 | void |
135 | GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus, | 135 | GNUNET_CONSENSUS_insert(struct GNUNET_CONSENSUS_Handle *consensus, |
136 | const struct GNUNET_SET_Element *element, | 136 | const struct GNUNET_SET_Element *element, |
137 | GNUNET_CONSENSUS_InsertDoneCallback idc, | 137 | GNUNET_CONSENSUS_InsertDoneCallback idc, |
138 | void *idc_cls); | 138 | void *idc_cls); |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
@@ -156,9 +156,9 @@ typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls); | |||
156 | * @param conclude_cls closure for the conclude callback | 156 | * @param conclude_cls closure for the conclude callback |
157 | */ | 157 | */ |
158 | void | 158 | void |
159 | GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, | 159 | GNUNET_CONSENSUS_conclude(struct GNUNET_CONSENSUS_Handle *consensus, |
160 | GNUNET_CONSENSUS_ConcludeCallback conclude, | 160 | GNUNET_CONSENSUS_ConcludeCallback conclude, |
161 | void *conclude_cls); | 161 | void *conclude_cls); |
162 | 162 | ||
163 | 163 | ||
164 | /** | 164 | /** |
@@ -168,7 +168,7 @@ GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, | |||
168 | * @param consensus handle to destroy | 168 | * @param consensus handle to destroy |
169 | */ | 169 | */ |
170 | void | 170 | void |
171 | GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus); | 171 | GNUNET_CONSENSUS_destroy(struct GNUNET_CONSENSUS_Handle *consensus); |
172 | 172 | ||
173 | 173 | ||
174 | #if 0 /* keep Emacsens' auto-indent happy */ | 174 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index 7e4653a97..39dbd4425 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -48,35 +48,35 @@ extern "C" | |||
48 | * so that at least one maximum-size message can be send roughly once | 48 | * so that at least one maximum-size message can be send roughly once |
49 | * per minute. | 49 | * per minute. |
50 | */ | 50 | */ |
51 | #define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024) | 51 | #define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init(1024) |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * After how long do we consider a connection to a peer dead | 54 | * After how long do we consider a connection to a peer dead |
55 | * if we don't receive messages from the peer? | 55 | * if we don't receive messages from the peer? |
56 | */ | 56 | */ |
57 | #define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 57 | #define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5) |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * How long do we delay reading more from a peer after a quota violation? | 60 | * How long do we delay reading more from a peer after a quota violation? |
61 | */ | 61 | */ |
62 | #define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) | 62 | #define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2) |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * After how long do we consider a service unresponsive | 65 | * After how long do we consider a service unresponsive |
66 | * even if we assume that the service commonly does not | 66 | * even if we assume that the service commonly does not |
67 | * respond instantly (DNS, Database, etc.). | 67 | * respond instantly (DNS, Database, etc.). |
68 | */ | 68 | */ |
69 | #define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 10) | 69 | #define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 10) |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * How long do we delay messages to get larger packet sizes (CORKing)? | 72 | * How long do we delay messages to get larger packet sizes (CORKing)? |
73 | */ | 73 | */ |
74 | #define GNUNET_CONSTANTS_MAX_CORK_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) | 74 | #define GNUNET_CONSTANTS_MAX_CORK_DELAY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1) |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * After what amount of latency for a message do we print a warning? | 77 | * After what amount of latency for a message do we print a warning? |
78 | */ | 78 | */ |
79 | #define GNUNET_CONSTANTS_LATENCY_WARN GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) | 79 | #define GNUNET_CONSTANTS_LATENCY_WARN GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3) |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Until which load do we consider the peer overly idle | 82 | * Until which load do we consider the peer overly idle |
@@ -100,20 +100,20 @@ extern "C" | |||
100 | * validated? This value is also used for our own addresses when we | 100 | * validated? This value is also used for our own addresses when we |
101 | * create a HELLO. | 101 | * create a HELLO. |
102 | */ | 102 | */ |
103 | #define GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12) | 103 | #define GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 12) |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * How long do we cache records at most in the DHT? | 107 | * How long do we cache records at most in the DHT? |
108 | */ | 108 | */ |
109 | #define GNUNET_CONSTANTS_DHT_MAX_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 24) | 109 | #define GNUNET_CONSTANTS_DHT_MAX_EXPIRATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) |
110 | 110 | ||
111 | 111 | ||
112 | /** | 112 | /** |
113 | * Size of the `struct EncryptedMessage` of the core (which | 113 | * Size of the `struct EncryptedMessage` of the core (which |
114 | * is the per-message overhead of the core). | 114 | * is the per-message overhead of the core). |
115 | */ | 115 | */ |
116 | #define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof (struct GNUNET_HashCode)) | 116 | #define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof(struct GNUNET_HashCode)) |
117 | 117 | ||
118 | /** | 118 | /** |
119 | * What is the maximum size for encrypted messages? Note that this | 119 | * What is the maximum size for encrypted messages? Note that this |
@@ -141,7 +141,7 @@ extern "C" | |||
141 | * Maximum message size that can be sent on CADET. | 141 | * Maximum message size that can be sent on CADET. |
142 | */ | 142 | */ |
143 | #define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \ | 143 | #define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \ |
144 | (GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD) | 144 | (GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD) |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * Largest block that can be stored in the DHT. | 147 | * Largest block that can be stored in the DHT. |
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 8796fdcb6..d811995ff 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -67,10 +67,10 @@ | |||
67 | * #GNUNET_NO if compression did not help | 67 | * #GNUNET_NO if compression did not help |
68 | */ | 68 | */ |
69 | int | 69 | int |
70 | GNUNET_try_compression (const char *data, | 70 | GNUNET_try_compression(const char *data, |
71 | size_t old_size, | 71 | size_t old_size, |
72 | char **result, | 72 | char **result, |
73 | size_t *new_size); | 73 | size_t *new_size); |
74 | 74 | ||
75 | 75 | ||
76 | /** | 76 | /** |
@@ -84,7 +84,7 @@ GNUNET_try_compression (const char *data, | |||
84 | * @return NULL on error, buffer of @a output_size decompressed bytes otherwise | 84 | * @return NULL on error, buffer of @a output_size decompressed bytes otherwise |
85 | */ | 85 | */ |
86 | char * | 86 | char * |
87 | GNUNET_decompress (const char *input, size_t input_size, size_t output_size); | 87 | GNUNET_decompress(const char *input, size_t input_size, size_t output_size); |
88 | 88 | ||
89 | 89 | ||
90 | #if HAVE_EXTRACTOR_H | 90 | #if HAVE_EXTRACTOR_H |
@@ -99,8 +99,7 @@ GNUNET_decompress (const char *input, size_t input_size, size_t output_size); | |||
99 | * Enumeration defining various sources of keywords. See also | 99 | * Enumeration defining various sources of keywords. See also |
100 | * http://dublincore.org/documents/1998/09/dces/ | 100 | * http://dublincore.org/documents/1998/09/dces/ |
101 | */ | 101 | */ |
102 | enum EXTRACTOR_MetaType | 102 | enum EXTRACTOR_MetaType { |
103 | { | ||
104 | EXTRACTOR_METATYPE_RESERVED = 0, | 103 | EXTRACTOR_METATYPE_RESERVED = 0, |
105 | EXTRACTOR_METATYPE_MIMETYPE = 1, | 104 | EXTRACTOR_METATYPE_MIMETYPE = 1, |
106 | EXTRACTOR_METATYPE_FILENAME = 2, | 105 | EXTRACTOR_METATYPE_FILENAME = 2, |
@@ -124,14 +123,12 @@ enum EXTRACTOR_MetaType | |||
124 | EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162, | 123 | EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162, |
125 | EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174, | 124 | EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174, |
126 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180, | 125 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180, |
127 | |||
128 | }; | 126 | }; |
129 | 127 | ||
130 | /** | 128 | /** |
131 | * Format in which the extracted meta data is presented. | 129 | * Format in which the extracted meta data is presented. |
132 | */ | 130 | */ |
133 | enum EXTRACTOR_MetaFormat | 131 | enum EXTRACTOR_MetaFormat { |
134 | { | ||
135 | /** | 132 | /** |
136 | * Format is unknown. | 133 | * Format is unknown. |
137 | */ | 134 | */ |
@@ -231,9 +228,9 @@ typedef int (*GNUNET_CONTAINER_HashCodeIterator) (void *cls, | |||
231 | * @return the bloomfilter | 228 | * @return the bloomfilter |
232 | */ | 229 | */ |
233 | struct GNUNET_CONTAINER_BloomFilter * | 230 | struct GNUNET_CONTAINER_BloomFilter * |
234 | GNUNET_CONTAINER_bloomfilter_load (const char *filename, | 231 | GNUNET_CONTAINER_bloomfilter_load(const char *filename, |
235 | size_t size, | 232 | size_t size, |
236 | unsigned int k); | 233 | unsigned int k); |
237 | 234 | ||
238 | 235 | ||
239 | /** | 236 | /** |
@@ -251,9 +248,9 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, | |||
251 | * @return the bloomfilter | 248 | * @return the bloomfilter |
252 | */ | 249 | */ |
253 | struct GNUNET_CONTAINER_BloomFilter * | 250 | struct GNUNET_CONTAINER_BloomFilter * |
254 | GNUNET_CONTAINER_bloomfilter_init (const char *data, | 251 | GNUNET_CONTAINER_bloomfilter_init(const char *data, |
255 | size_t size, | 252 | size_t size, |
256 | unsigned int k); | 253 | unsigned int k); |
257 | 254 | ||
258 | 255 | ||
259 | /** | 256 | /** |
@@ -266,7 +263,7 @@ GNUNET_CONTAINER_bloomfilter_init (const char *data, | |||
266 | * @return #GNUNET_SYSERR if the data array of the wrong size | 263 | * @return #GNUNET_SYSERR if the data array of the wrong size |
267 | */ | 264 | */ |
268 | int | 265 | int |
269 | GNUNET_CONTAINER_bloomfilter_get_raw_data ( | 266 | GNUNET_CONTAINER_bloomfilter_get_raw_data( |
270 | const struct GNUNET_CONTAINER_BloomFilter *bf, | 267 | const struct GNUNET_CONTAINER_BloomFilter *bf, |
271 | char *data, | 268 | char *data, |
272 | size_t size); | 269 | size_t size); |
@@ -281,7 +278,7 @@ GNUNET_CONTAINER_bloomfilter_get_raw_data ( | |||
281 | * @return #GNUNET_YES if the element is in the filter, #GNUNET_NO if not | 278 | * @return #GNUNET_YES if the element is in the filter, #GNUNET_NO if not |
282 | */ | 279 | */ |
283 | int | 280 | int |
284 | GNUNET_CONTAINER_bloomfilter_test ( | 281 | GNUNET_CONTAINER_bloomfilter_test( |
285 | const struct GNUNET_CONTAINER_BloomFilter *bf, | 282 | const struct GNUNET_CONTAINER_BloomFilter *bf, |
286 | const struct GNUNET_HashCode *e); | 283 | const struct GNUNET_HashCode *e); |
287 | 284 | ||
@@ -294,8 +291,8 @@ GNUNET_CONTAINER_bloomfilter_test ( | |||
294 | * @param e the element | 291 | * @param e the element |
295 | */ | 292 | */ |
296 | void | 293 | void |
297 | GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | 294 | GNUNET_CONTAINER_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf, |
298 | const struct GNUNET_HashCode *e); | 295 | const struct GNUNET_HashCode *e); |
299 | 296 | ||
300 | 297 | ||
301 | /** | 298 | /** |
@@ -306,8 +303,8 @@ GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
306 | * @param e the element to remove | 303 | * @param e the element to remove |
307 | */ | 304 | */ |
308 | void | 305 | void |
309 | GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, | 306 | GNUNET_CONTAINER_bloomfilter_remove(struct GNUNET_CONTAINER_BloomFilter *bf, |
310 | const struct GNUNET_HashCode *e); | 307 | const struct GNUNET_HashCode *e); |
311 | 308 | ||
312 | 309 | ||
313 | /** | 310 | /** |
@@ -318,7 +315,7 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
318 | * @return copy of bf | 315 | * @return copy of bf |
319 | */ | 316 | */ |
320 | struct GNUNET_CONTAINER_BloomFilter * | 317 | struct GNUNET_CONTAINER_BloomFilter * |
321 | GNUNET_CONTAINER_bloomfilter_copy ( | 318 | GNUNET_CONTAINER_bloomfilter_copy( |
322 | const struct GNUNET_CONTAINER_BloomFilter *bf); | 319 | const struct GNUNET_CONTAINER_BloomFilter *bf); |
323 | 320 | ||
324 | 321 | ||
@@ -331,7 +328,7 @@ GNUNET_CONTAINER_bloomfilter_copy ( | |||
331 | * @param bf the filter | 328 | * @param bf the filter |
332 | */ | 329 | */ |
333 | void | 330 | void |
334 | GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf); | 331 | GNUNET_CONTAINER_bloomfilter_free(struct GNUNET_CONTAINER_BloomFilter *bf); |
335 | 332 | ||
336 | 333 | ||
337 | /** | 334 | /** |
@@ -341,7 +338,7 @@ GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf); | |||
341 | * @return addresses set per element in the bf | 338 | * @return addresses set per element in the bf |
342 | */ | 339 | */ |
343 | size_t | 340 | size_t |
344 | GNUNET_CONTAINER_bloomfilter_get_element_addresses ( | 341 | GNUNET_CONTAINER_bloomfilter_get_element_addresses( |
345 | const struct GNUNET_CONTAINER_BloomFilter *bf); | 342 | const struct GNUNET_CONTAINER_BloomFilter *bf); |
346 | 343 | ||
347 | 344 | ||
@@ -353,7 +350,7 @@ GNUNET_CONTAINER_bloomfilter_get_element_addresses ( | |||
353 | * @return number of bytes used for the data of the bloom filter | 350 | * @return number of bytes used for the data of the bloom filter |
354 | */ | 351 | */ |
355 | size_t | 352 | size_t |
356 | GNUNET_CONTAINER_bloomfilter_get_size ( | 353 | GNUNET_CONTAINER_bloomfilter_get_size( |
357 | const struct GNUNET_CONTAINER_BloomFilter *bf); | 354 | const struct GNUNET_CONTAINER_BloomFilter *bf); |
358 | 355 | ||
359 | 356 | ||
@@ -364,7 +361,7 @@ GNUNET_CONTAINER_bloomfilter_get_size ( | |||
364 | * @param bf the filter | 361 | * @param bf the filter |
365 | */ | 362 | */ |
366 | void | 363 | void |
367 | GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); | 364 | GNUNET_CONTAINER_bloomfilter_clear(struct GNUNET_CONTAINER_BloomFilter *bf); |
368 | 365 | ||
369 | 366 | ||
370 | /** | 367 | /** |
@@ -380,9 +377,9 @@ GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); | |||
380 | * @return #GNUNET_OK on success | 377 | * @return #GNUNET_OK on success |
381 | */ | 378 | */ |
382 | int | 379 | int |
383 | GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | 380 | GNUNET_CONTAINER_bloomfilter_or(struct GNUNET_CONTAINER_BloomFilter *bf, |
384 | const char *data, | 381 | const char *data, |
385 | size_t size); | 382 | size_t size); |
386 | 383 | ||
387 | 384 | ||
388 | /** | 385 | /** |
@@ -396,7 +393,7 @@ GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
396 | * @return #GNUNET_OK on success | 393 | * @return #GNUNET_OK on success |
397 | */ | 394 | */ |
398 | int | 395 | int |
399 | GNUNET_CONTAINER_bloomfilter_or2 ( | 396 | GNUNET_CONTAINER_bloomfilter_or2( |
400 | struct GNUNET_CONTAINER_BloomFilter *bf, | 397 | struct GNUNET_CONTAINER_BloomFilter *bf, |
401 | const struct GNUNET_CONTAINER_BloomFilter *to_or); | 398 | const struct GNUNET_CONTAINER_BloomFilter *to_or); |
402 | 399 | ||
@@ -414,11 +411,11 @@ GNUNET_CONTAINER_bloomfilter_or2 ( | |||
414 | * @param k the new number of #GNUNET_CRYPTO_hash-function to apply per element | 411 | * @param k the new number of #GNUNET_CRYPTO_hash-function to apply per element |
415 | */ | 412 | */ |
416 | void | 413 | void |
417 | GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, | 414 | GNUNET_CONTAINER_bloomfilter_resize(struct GNUNET_CONTAINER_BloomFilter *bf, |
418 | GNUNET_CONTAINER_HashCodeIterator iterator, | 415 | GNUNET_CONTAINER_HashCodeIterator iterator, |
419 | void *iterator_cls, | 416 | void *iterator_cls, |
420 | size_t size, | 417 | size_t size, |
421 | unsigned int k); | 418 | unsigned int k); |
422 | 419 | ||
423 | 420 | ||
424 | /* ****************** metadata ******************* */ | 421 | /* ****************** metadata ******************* */ |
@@ -437,7 +434,7 @@ struct GNUNET_CONTAINER_MetaData; | |||
437 | * @return empty meta-data container | 434 | * @return empty meta-data container |
438 | */ | 435 | */ |
439 | struct GNUNET_CONTAINER_MetaData * | 436 | struct GNUNET_CONTAINER_MetaData * |
440 | GNUNET_CONTAINER_meta_data_create (void); | 437 | GNUNET_CONTAINER_meta_data_create(void); |
441 | 438 | ||
442 | 439 | ||
443 | /** | 440 | /** |
@@ -448,7 +445,7 @@ GNUNET_CONTAINER_meta_data_create (void); | |||
448 | * @return duplicate meta-data container | 445 | * @return duplicate meta-data container |
449 | */ | 446 | */ |
450 | struct GNUNET_CONTAINER_MetaData * | 447 | struct GNUNET_CONTAINER_MetaData * |
451 | GNUNET_CONTAINER_meta_data_duplicate ( | 448 | GNUNET_CONTAINER_meta_data_duplicate( |
452 | const struct GNUNET_CONTAINER_MetaData *md); | 449 | const struct GNUNET_CONTAINER_MetaData *md); |
453 | 450 | ||
454 | 451 | ||
@@ -459,7 +456,7 @@ GNUNET_CONTAINER_meta_data_duplicate ( | |||
459 | * @param md what to free | 456 | * @param md what to free |
460 | */ | 457 | */ |
461 | void | 458 | void |
462 | GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | 459 | GNUNET_CONTAINER_meta_data_destroy(struct GNUNET_CONTAINER_MetaData *md); |
463 | 460 | ||
464 | 461 | ||
465 | /** | 462 | /** |
@@ -474,7 +471,7 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | |||
474 | * @return #GNUNET_YES if they are equal | 471 | * @return #GNUNET_YES if they are equal |
475 | */ | 472 | */ |
476 | int | 473 | int |
477 | GNUNET_CONTAINER_meta_data_test_equal ( | 474 | GNUNET_CONTAINER_meta_data_test_equal( |
478 | const struct GNUNET_CONTAINER_MetaData *md1, | 475 | const struct GNUNET_CONTAINER_MetaData *md1, |
479 | const struct GNUNET_CONTAINER_MetaData *md2); | 476 | const struct GNUNET_CONTAINER_MetaData *md2); |
480 | 477 | ||
@@ -498,13 +495,13 @@ GNUNET_CONTAINER_meta_data_test_equal ( | |||
498 | * data_mime_type and plugin_name are not considered for "exists" checks | 495 | * data_mime_type and plugin_name are not considered for "exists" checks |
499 | */ | 496 | */ |
500 | int | 497 | int |
501 | GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | 498 | GNUNET_CONTAINER_meta_data_insert(struct GNUNET_CONTAINER_MetaData *md, |
502 | const char *plugin_name, | 499 | const char *plugin_name, |
503 | enum EXTRACTOR_MetaType type, | 500 | enum EXTRACTOR_MetaType type, |
504 | enum EXTRACTOR_MetaFormat format, | 501 | enum EXTRACTOR_MetaFormat format, |
505 | const char *data_mime_type, | 502 | const char *data_mime_type, |
506 | const char *data, | 503 | const char *data, |
507 | size_t data_size); | 504 | size_t data_size); |
508 | 505 | ||
509 | 506 | ||
510 | /** | 507 | /** |
@@ -516,8 +513,8 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | |||
516 | * @param in metadata to merge | 513 | * @param in metadata to merge |
517 | */ | 514 | */ |
518 | void | 515 | void |
519 | GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | 516 | GNUNET_CONTAINER_meta_data_merge(struct GNUNET_CONTAINER_MetaData *md, |
520 | const struct GNUNET_CONTAINER_MetaData *in); | 517 | const struct GNUNET_CONTAINER_MetaData *in); |
521 | 518 | ||
522 | 519 | ||
523 | /** | 520 | /** |
@@ -532,10 +529,10 @@ GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | |||
532 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the item does not exist in md | 529 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the item does not exist in md |
533 | */ | 530 | */ |
534 | int | 531 | int |
535 | GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | 532 | GNUNET_CONTAINER_meta_data_delete(struct GNUNET_CONTAINER_MetaData *md, |
536 | enum EXTRACTOR_MetaType type, | 533 | enum EXTRACTOR_MetaType type, |
537 | const char *data, | 534 | const char *data, |
538 | size_t data_size); | 535 | size_t data_size); |
539 | 536 | ||
540 | 537 | ||
541 | /** | 538 | /** |
@@ -545,7 +542,7 @@ GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | |||
545 | * @param md metadata to manipulate | 542 | * @param md metadata to manipulate |
546 | */ | 543 | */ |
547 | void | 544 | void |
548 | GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | 545 | GNUNET_CONTAINER_meta_data_clear(struct GNUNET_CONTAINER_MetaData *md); |
549 | 546 | ||
550 | 547 | ||
551 | /** | 548 | /** |
@@ -556,7 +553,7 @@ GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | |||
556 | * @param md metadata to modify | 553 | * @param md metadata to modify |
557 | */ | 554 | */ |
558 | void | 555 | void |
559 | GNUNET_CONTAINER_meta_data_add_publication_date ( | 556 | GNUNET_CONTAINER_meta_data_add_publication_date( |
560 | struct GNUNET_CONTAINER_MetaData *md); | 557 | struct GNUNET_CONTAINER_MetaData *md); |
561 | 558 | ||
562 | 559 | ||
@@ -571,9 +568,9 @@ GNUNET_CONTAINER_meta_data_add_publication_date ( | |||
571 | * @return number of entries | 568 | * @return number of entries |
572 | */ | 569 | */ |
573 | int | 570 | int |
574 | GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, | 571 | GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md, |
575 | EXTRACTOR_MetaDataProcessor iter, | 572 | EXTRACTOR_MetaDataProcessor iter, |
576 | void *iter_cls); | 573 | void *iter_cls); |
577 | 574 | ||
578 | 575 | ||
579 | /** | 576 | /** |
@@ -588,7 +585,7 @@ GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, | |||
588 | * @return NULL if no entry was found | 585 | * @return NULL if no entry was found |
589 | */ | 586 | */ |
590 | char * | 587 | char * |
591 | GNUNET_CONTAINER_meta_data_get_by_type ( | 588 | GNUNET_CONTAINER_meta_data_get_by_type( |
592 | const struct GNUNET_CONTAINER_MetaData *md, | 589 | const struct GNUNET_CONTAINER_MetaData *md, |
593 | enum EXTRACTOR_MetaType type); | 590 | enum EXTRACTOR_MetaType type); |
594 | 591 | ||
@@ -606,7 +603,7 @@ GNUNET_CONTAINER_meta_data_get_by_type ( | |||
606 | * otherwise client is responsible for freeing the value! | 603 | * otherwise client is responsible for freeing the value! |
607 | */ | 604 | */ |
608 | char * | 605 | char * |
609 | GNUNET_CONTAINER_meta_data_get_first_by_types ( | 606 | GNUNET_CONTAINER_meta_data_get_first_by_types( |
610 | const struct GNUNET_CONTAINER_MetaData *md, | 607 | const struct GNUNET_CONTAINER_MetaData *md, |
611 | ...); | 608 | ...); |
612 | 609 | ||
@@ -621,7 +618,7 @@ GNUNET_CONTAINER_meta_data_get_first_by_types ( | |||
621 | * @return number of bytes in thumbnail, 0 if not available | 618 | * @return number of bytes in thumbnail, 0 if not available |
622 | */ | 619 | */ |
623 | size_t | 620 | size_t |
624 | GNUNET_CONTAINER_meta_data_get_thumbnail ( | 621 | GNUNET_CONTAINER_meta_data_get_thumbnail( |
625 | const struct GNUNET_CONTAINER_MetaData *md, | 622 | const struct GNUNET_CONTAINER_MetaData *md, |
626 | unsigned char **thumb); | 623 | unsigned char **thumb); |
627 | 624 | ||
@@ -630,8 +627,7 @@ GNUNET_CONTAINER_meta_data_get_thumbnail ( | |||
630 | * @ingroup metadata | 627 | * @ingroup metadata |
631 | * Options for metadata serialization. | 628 | * Options for metadata serialization. |
632 | */ | 629 | */ |
633 | enum GNUNET_CONTAINER_MetaDataSerializationOptions | 630 | enum GNUNET_CONTAINER_MetaDataSerializationOptions { |
634 | { | ||
635 | /** | 631 | /** |
636 | * @ingroup metadata | 632 | * @ingroup metadata |
637 | * Serialize all of the data. | 633 | * Serialize all of the data. |
@@ -669,7 +665,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions | |||
669 | * space) | 665 | * space) |
670 | */ | 666 | */ |
671 | ssize_t | 667 | ssize_t |
672 | GNUNET_CONTAINER_meta_data_serialize ( | 668 | GNUNET_CONTAINER_meta_data_serialize( |
673 | const struct GNUNET_CONTAINER_MetaData *md, | 669 | const struct GNUNET_CONTAINER_MetaData *md, |
674 | char **target, | 670 | char **target, |
675 | size_t max, | 671 | size_t max, |
@@ -684,7 +680,7 @@ GNUNET_CONTAINER_meta_data_serialize ( | |||
684 | * @return number of bytes needed for serialization, -1 on error | 680 | * @return number of bytes needed for serialization, -1 on error |
685 | */ | 681 | */ |
686 | ssize_t | 682 | ssize_t |
687 | GNUNET_CONTAINER_meta_data_get_serialized_size ( | 683 | GNUNET_CONTAINER_meta_data_get_serialized_size( |
688 | const struct GNUNET_CONTAINER_MetaData *md); | 684 | const struct GNUNET_CONTAINER_MetaData *md); |
689 | 685 | ||
690 | 686 | ||
@@ -698,7 +694,7 @@ GNUNET_CONTAINER_meta_data_get_serialized_size ( | |||
698 | * bad format) | 694 | * bad format) |
699 | */ | 695 | */ |
700 | struct GNUNET_CONTAINER_MetaData * | 696 | struct GNUNET_CONTAINER_MetaData * |
701 | GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size); | 697 | GNUNET_CONTAINER_meta_data_deserialize(const char *input, size_t size); |
702 | 698 | ||
703 | 699 | ||
704 | /* ******************************* HashMap **************************** */ | 700 | /* ******************************* HashMap **************************** */ |
@@ -720,9 +716,7 @@ struct GNUNET_CONTAINER_MultiHashMapIterator; | |||
720 | * @ingroup hashmap | 716 | * @ingroup hashmap |
721 | * Options for storing values in the HashMap. | 717 | * Options for storing values in the HashMap. |
722 | */ | 718 | */ |
723 | enum GNUNET_CONTAINER_MultiHashMapOption | 719 | enum GNUNET_CONTAINER_MultiHashMapOption { |
724 | { | ||
725 | |||
726 | /** | 720 | /** |
727 | * @ingroup hashmap | 721 | * @ingroup hashmap |
728 | * If a value with the given key exists, replace it. Note that the | 722 | * If a value with the given key exists, replace it. Note that the |
@@ -791,7 +785,7 @@ typedef int (*GNUNET_CONTAINER_MulitHashMapIteratorCallback) ( | |||
791 | * @return NULL on error | 785 | * @return NULL on error |
792 | */ | 786 | */ |
793 | struct GNUNET_CONTAINER_MultiHashMap * | 787 | struct GNUNET_CONTAINER_MultiHashMap * |
794 | GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys); | 788 | GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys); |
795 | 789 | ||
796 | 790 | ||
797 | /** | 791 | /** |
@@ -802,7 +796,7 @@ GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys); | |||
802 | * @param map the map | 796 | * @param map the map |
803 | */ | 797 | */ |
804 | void | 798 | void |
805 | GNUNET_CONTAINER_multihashmap_destroy ( | 799 | GNUNET_CONTAINER_multihashmap_destroy( |
806 | struct GNUNET_CONTAINER_MultiHashMap *map); | 800 | struct GNUNET_CONTAINER_MultiHashMap *map); |
807 | 801 | ||
808 | 802 | ||
@@ -818,7 +812,7 @@ GNUNET_CONTAINER_multihashmap_destroy ( | |||
818 | * key-value pairs with value NULL | 812 | * key-value pairs with value NULL |
819 | */ | 813 | */ |
820 | void * | 814 | void * |
821 | GNUNET_CONTAINER_multihashmap_get ( | 815 | GNUNET_CONTAINER_multihashmap_get( |
822 | const struct GNUNET_CONTAINER_MultiHashMap *map, | 816 | const struct GNUNET_CONTAINER_MultiHashMap *map, |
823 | const struct GNUNET_HashCode *key); | 817 | const struct GNUNET_HashCode *key); |
824 | 818 | ||
@@ -836,9 +830,9 @@ GNUNET_CONTAINER_multihashmap_get ( | |||
836 | * is not in the map | 830 | * is not in the map |
837 | */ | 831 | */ |
838 | int | 832 | int |
839 | GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, | 833 | GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, |
840 | const struct GNUNET_HashCode *key, | 834 | const struct GNUNET_HashCode *key, |
841 | const void *value); | 835 | const void *value); |
842 | 836 | ||
843 | /** | 837 | /** |
844 | * @ingroup hashmap | 838 | * @ingroup hashmap |
@@ -850,7 +844,7 @@ GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, | |||
850 | * @return number of values removed | 844 | * @return number of values removed |
851 | */ | 845 | */ |
852 | int | 846 | int |
853 | GNUNET_CONTAINER_multihashmap_remove_all ( | 847 | GNUNET_CONTAINER_multihashmap_remove_all( |
854 | struct GNUNET_CONTAINER_MultiHashMap *map, | 848 | struct GNUNET_CONTAINER_MultiHashMap *map, |
855 | const struct GNUNET_HashCode *key); | 849 | const struct GNUNET_HashCode *key); |
856 | 850 | ||
@@ -864,7 +858,7 @@ GNUNET_CONTAINER_multihashmap_remove_all ( | |||
864 | * @return number of values removed | 858 | * @return number of values removed |
865 | */ | 859 | */ |
866 | unsigned int | 860 | unsigned int |
867 | GNUNET_CONTAINER_multihashmap_clear (struct GNUNET_CONTAINER_MultiHashMap *map); | 861 | GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map); |
868 | 862 | ||
869 | 863 | ||
870 | /** | 864 | /** |
@@ -878,7 +872,7 @@ GNUNET_CONTAINER_multihashmap_clear (struct GNUNET_CONTAINER_MultiHashMap *map); | |||
878 | * #GNUNET_NO if not | 872 | * #GNUNET_NO if not |
879 | */ | 873 | */ |
880 | int | 874 | int |
881 | GNUNET_CONTAINER_multihashmap_contains ( | 875 | GNUNET_CONTAINER_multihashmap_contains( |
882 | const struct GNUNET_CONTAINER_MultiHashMap *map, | 876 | const struct GNUNET_CONTAINER_MultiHashMap *map, |
883 | const struct GNUNET_HashCode *key); | 877 | const struct GNUNET_HashCode *key); |
884 | 878 | ||
@@ -895,7 +889,7 @@ GNUNET_CONTAINER_multihashmap_contains ( | |||
895 | * #GNUNET_NO if not | 889 | * #GNUNET_NO if not |
896 | */ | 890 | */ |
897 | int | 891 | int |
898 | GNUNET_CONTAINER_multihashmap_contains_value ( | 892 | GNUNET_CONTAINER_multihashmap_contains_value( |
899 | const struct GNUNET_CONTAINER_MultiHashMap *map, | 893 | const struct GNUNET_CONTAINER_MultiHashMap *map, |
900 | const struct GNUNET_HashCode *key, | 894 | const struct GNUNET_HashCode *key, |
901 | const void *value); | 895 | const void *value); |
@@ -915,7 +909,7 @@ GNUNET_CONTAINER_multihashmap_contains_value ( | |||
915 | * value already exists | 909 | * value already exists |
916 | */ | 910 | */ |
917 | int | 911 | int |
918 | GNUNET_CONTAINER_multihashmap_put ( | 912 | GNUNET_CONTAINER_multihashmap_put( |
919 | struct GNUNET_CONTAINER_MultiHashMap *map, | 913 | struct GNUNET_CONTAINER_MultiHashMap *map, |
920 | const struct GNUNET_HashCode *key, | 914 | const struct GNUNET_HashCode *key, |
921 | void *value, | 915 | void *value, |
@@ -929,7 +923,7 @@ GNUNET_CONTAINER_multihashmap_put ( | |||
929 | * @return the number of key value pairs | 923 | * @return the number of key value pairs |
930 | */ | 924 | */ |
931 | unsigned int | 925 | unsigned int |
932 | GNUNET_CONTAINER_multihashmap_size ( | 926 | GNUNET_CONTAINER_multihashmap_size( |
933 | const struct GNUNET_CONTAINER_MultiHashMap *map); | 927 | const struct GNUNET_CONTAINER_MultiHashMap *map); |
934 | 928 | ||
935 | 929 | ||
@@ -944,7 +938,7 @@ GNUNET_CONTAINER_multihashmap_size ( | |||
944 | * #GNUNET_SYSERR if it aborted iteration | 938 | * #GNUNET_SYSERR if it aborted iteration |
945 | */ | 939 | */ |
946 | int | 940 | int |
947 | GNUNET_CONTAINER_multihashmap_iterate ( | 941 | GNUNET_CONTAINER_multihashmap_iterate( |
948 | struct GNUNET_CONTAINER_MultiHashMap *map, | 942 | struct GNUNET_CONTAINER_MultiHashMap *map, |
949 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, | 943 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, |
950 | void *it_cls); | 944 | void *it_cls); |
@@ -964,7 +958,7 @@ GNUNET_CONTAINER_multihashmap_iterate ( | |||
964 | * @return an iterator over the given multihashmap @a map | 958 | * @return an iterator over the given multihashmap @a map |
965 | */ | 959 | */ |
966 | struct GNUNET_CONTAINER_MultiHashMapIterator * | 960 | struct GNUNET_CONTAINER_MultiHashMapIterator * |
967 | GNUNET_CONTAINER_multihashmap_iterator_create ( | 961 | GNUNET_CONTAINER_multihashmap_iterator_create( |
968 | const struct GNUNET_CONTAINER_MultiHashMap *map); | 962 | const struct GNUNET_CONTAINER_MultiHashMap *map); |
969 | 963 | ||
970 | 964 | ||
@@ -984,7 +978,7 @@ GNUNET_CONTAINER_multihashmap_iterator_create ( | |||
984 | * #GNUNET_NO if we are out of elements | 978 | * #GNUNET_NO if we are out of elements |
985 | */ | 979 | */ |
986 | int | 980 | int |
987 | GNUNET_CONTAINER_multihashmap_iterator_next ( | 981 | GNUNET_CONTAINER_multihashmap_iterator_next( |
988 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter, | 982 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter, |
989 | struct GNUNET_HashCode *key, | 983 | struct GNUNET_HashCode *key, |
990 | const void **value); | 984 | const void **value); |
@@ -997,7 +991,7 @@ GNUNET_CONTAINER_multihashmap_iterator_next ( | |||
997 | * @param iter the iterator to destroy | 991 | * @param iter the iterator to destroy |
998 | */ | 992 | */ |
999 | void | 993 | void |
1000 | GNUNET_CONTAINER_multihashmap_iterator_destroy ( | 994 | GNUNET_CONTAINER_multihashmap_iterator_destroy( |
1001 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter); | 995 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter); |
1002 | 996 | ||
1003 | 997 | ||
@@ -1013,7 +1007,7 @@ GNUNET_CONTAINER_multihashmap_iterator_destroy ( | |||
1013 | * #GNUNET_SYSERR if it aborted iteration | 1007 | * #GNUNET_SYSERR if it aborted iteration |
1014 | */ | 1008 | */ |
1015 | int | 1009 | int |
1016 | GNUNET_CONTAINER_multihashmap_get_multiple ( | 1010 | GNUNET_CONTAINER_multihashmap_get_multiple( |
1017 | struct GNUNET_CONTAINER_MultiHashMap *map, | 1011 | struct GNUNET_CONTAINER_MultiHashMap *map, |
1018 | const struct GNUNET_HashCode *key, | 1012 | const struct GNUNET_HashCode *key, |
1019 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, | 1013 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, |
@@ -1032,7 +1026,7 @@ GNUNET_CONTAINER_multihashmap_get_multiple ( | |||
1032 | * @return the number of key value pairs processed, zero or one. | 1026 | * @return the number of key value pairs processed, zero or one. |
1033 | */ | 1027 | */ |
1034 | unsigned int | 1028 | unsigned int |
1035 | GNUNET_CONTAINER_multihashmap_get_random ( | 1029 | GNUNET_CONTAINER_multihashmap_get_random( |
1036 | const struct GNUNET_CONTAINER_MultiHashMap *map, | 1030 | const struct GNUNET_CONTAINER_MultiHashMap *map, |
1037 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, | 1031 | GNUNET_CONTAINER_MulitHashMapIteratorCallback it, |
1038 | void *it_cls); | 1032 | void *it_cls); |
@@ -1080,7 +1074,7 @@ struct GNUNET_CONTAINER_MultiPeerMap; | |||
1080 | * @return NULL on error | 1074 | * @return NULL on error |
1081 | */ | 1075 | */ |
1082 | struct GNUNET_CONTAINER_MultiPeerMap * | 1076 | struct GNUNET_CONTAINER_MultiPeerMap * |
1083 | GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys); | 1077 | GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys); |
1084 | 1078 | ||
1085 | 1079 | ||
1086 | /** | 1080 | /** |
@@ -1091,7 +1085,7 @@ GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys); | |||
1091 | * @param map the map | 1085 | * @param map the map |
1092 | */ | 1086 | */ |
1093 | void | 1087 | void |
1094 | GNUNET_CONTAINER_multipeermap_destroy ( | 1088 | GNUNET_CONTAINER_multipeermap_destroy( |
1095 | struct GNUNET_CONTAINER_MultiPeerMap *map); | 1089 | struct GNUNET_CONTAINER_MultiPeerMap *map); |
1096 | 1090 | ||
1097 | 1091 | ||
@@ -1107,7 +1101,7 @@ GNUNET_CONTAINER_multipeermap_destroy ( | |||
1107 | * key-value pairs with value NULL | 1101 | * key-value pairs with value NULL |
1108 | */ | 1102 | */ |
1109 | void * | 1103 | void * |
1110 | GNUNET_CONTAINER_multipeermap_get ( | 1104 | GNUNET_CONTAINER_multipeermap_get( |
1111 | const struct GNUNET_CONTAINER_MultiPeerMap *map, | 1105 | const struct GNUNET_CONTAINER_MultiPeerMap *map, |
1112 | const struct GNUNET_PeerIdentity *key); | 1106 | const struct GNUNET_PeerIdentity *key); |
1113 | 1107 | ||
@@ -1125,9 +1119,9 @@ GNUNET_CONTAINER_multipeermap_get ( | |||
1125 | * is not in the map | 1119 | * is not in the map |
1126 | */ | 1120 | */ |
1127 | int | 1121 | int |
1128 | GNUNET_CONTAINER_multipeermap_remove (struct GNUNET_CONTAINER_MultiPeerMap *map, | 1122 | GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, |
1129 | const struct GNUNET_PeerIdentity *key, | 1123 | const struct GNUNET_PeerIdentity *key, |
1130 | const void *value); | 1124 | const void *value); |
1131 | 1125 | ||
1132 | /** | 1126 | /** |
1133 | * @ingroup hashmap | 1127 | * @ingroup hashmap |
@@ -1139,7 +1133,7 @@ GNUNET_CONTAINER_multipeermap_remove (struct GNUNET_CONTAINER_MultiPeerMap *map, | |||
1139 | * @return number of values removed | 1133 | * @return number of values removed |
1140 | */ | 1134 | */ |
1141 | int | 1135 | int |
1142 | GNUNET_CONTAINER_multipeermap_remove_all ( | 1136 | GNUNET_CONTAINER_multipeermap_remove_all( |
1143 | struct GNUNET_CONTAINER_MultiPeerMap *map, | 1137 | struct GNUNET_CONTAINER_MultiPeerMap *map, |
1144 | const struct GNUNET_PeerIdentity *key); | 1138 | const struct GNUNET_PeerIdentity *key); |
1145 | 1139 | ||
@@ -1155,7 +1149,7 @@ GNUNET_CONTAINER_multipeermap_remove_all ( | |||
1155 | * #GNUNET_NO if not | 1149 | * #GNUNET_NO if not |
1156 | */ | 1150 | */ |
1157 | int | 1151 | int |
1158 | GNUNET_CONTAINER_multipeermap_contains ( | 1152 | GNUNET_CONTAINER_multipeermap_contains( |
1159 | const struct GNUNET_CONTAINER_MultiPeerMap *map, | 1153 | const struct GNUNET_CONTAINER_MultiPeerMap *map, |
1160 | const struct GNUNET_PeerIdentity *key); | 1154 | const struct GNUNET_PeerIdentity *key); |
1161 | 1155 | ||
@@ -1172,7 +1166,7 @@ GNUNET_CONTAINER_multipeermap_contains ( | |||
1172 | * #GNUNET_NO if not | 1166 | * #GNUNET_NO if not |
1173 | */ | 1167 | */ |
1174 | int | 1168 | int |
1175 | GNUNET_CONTAINER_multipeermap_contains_value ( | 1169 | GNUNET_CONTAINER_multipeermap_contains_value( |
1176 | const struct GNUNET_CONTAINER_MultiPeerMap *map, | 1170 | const struct GNUNET_CONTAINER_MultiPeerMap *map, |
1177 | const struct GNUNET_PeerIdentity *key, | 1171 | const struct GNUNET_PeerIdentity *key, |
1178 | const void *value); | 1172 | const void *value); |
@@ -1192,7 +1186,7 @@ GNUNET_CONTAINER_multipeermap_contains_value ( | |||
1192 | * value already exists | 1186 | * value already exists |
1193 | */ | 1187 | */ |
1194 | int | 1188 | int |
1195 | GNUNET_CONTAINER_multipeermap_put ( | 1189 | GNUNET_CONTAINER_multipeermap_put( |
1196 | struct GNUNET_CONTAINER_MultiPeerMap *map, | 1190 | struct GNUNET_CONTAINER_MultiPeerMap *map, |
1197 | const struct GNUNET_PeerIdentity *key, | 1191 | const struct GNUNET_PeerIdentity *key, |
1198 | void *value, | 1192 | void *value, |
@@ -1207,7 +1201,7 @@ GNUNET_CONTAINER_multipeermap_put ( | |||
1207 | * @return the number of key value pairs | 1201 | * @return the number of key value pairs |
1208 | */ | 1202 | */ |
1209 | unsigned int | 1203 | unsigned int |
1210 | GNUNET_CONTAINER_multipeermap_size ( | 1204 | GNUNET_CONTAINER_multipeermap_size( |
1211 | const struct GNUNET_CONTAINER_MultiPeerMap *map); | 1205 | const struct GNUNET_CONTAINER_MultiPeerMap *map); |
1212 | 1206 | ||
1213 | 1207 | ||
@@ -1222,7 +1216,7 @@ GNUNET_CONTAINER_multipeermap_size ( | |||
1222 | * #GNUNET_SYSERR if it aborted iteration | 1216 | * #GNUNET_SYSERR if it aborted iteration |
1223 | */ | 1217 | */ |
1224 | int | 1218 | int |
1225 | GNUNET_CONTAINER_multipeermap_iterate ( | 1219 | GNUNET_CONTAINER_multipeermap_iterate( |
1226 | struct GNUNET_CONTAINER_MultiPeerMap *map, | 1220 | struct GNUNET_CONTAINER_MultiPeerMap *map, |
1227 | GNUNET_CONTAINER_PeerMapIterator it, | 1221 | GNUNET_CONTAINER_PeerMapIterator it, |
1228 | void *it_cls); | 1222 | void *it_cls); |
@@ -1243,7 +1237,7 @@ struct GNUNET_CONTAINER_MultiPeerMapIterator; | |||
1243 | * @return an iterator over the given multihashmap @a map | 1237 | * @return an iterator over the given multihashmap @a map |
1244 | */ | 1238 | */ |
1245 | struct GNUNET_CONTAINER_MultiPeerMapIterator * | 1239 | struct GNUNET_CONTAINER_MultiPeerMapIterator * |
1246 | GNUNET_CONTAINER_multipeermap_iterator_create ( | 1240 | GNUNET_CONTAINER_multipeermap_iterator_create( |
1247 | const struct GNUNET_CONTAINER_MultiPeerMap *map); | 1241 | const struct GNUNET_CONTAINER_MultiPeerMap *map); |
1248 | 1242 | ||
1249 | 1243 | ||
@@ -1263,7 +1257,7 @@ GNUNET_CONTAINER_multipeermap_iterator_create ( | |||
1263 | * #GNUNET_NO if we are out of elements | 1257 | * #GNUNET_NO if we are out of elements |
1264 | */ | 1258 | */ |
1265 | int | 1259 | int |
1266 | GNUNET_CONTAINER_multipeermap_iterator_next ( | 1260 | GNUNET_CONTAINER_multipeermap_iterator_next( |
1267 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter, | 1261 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter, |
1268 | struct GNUNET_PeerIdentity *key, | 1262 | struct GNUNET_PeerIdentity *key, |
1269 | const void **value); | 1263 | const void **value); |
@@ -1276,7 +1270,7 @@ GNUNET_CONTAINER_multipeermap_iterator_next ( | |||
1276 | * @param iter the iterator to destroy | 1270 | * @param iter the iterator to destroy |
1277 | */ | 1271 | */ |
1278 | void | 1272 | void |
1279 | GNUNET_CONTAINER_multipeermap_iterator_destroy ( | 1273 | GNUNET_CONTAINER_multipeermap_iterator_destroy( |
1280 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter); | 1274 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter); |
1281 | 1275 | ||
1282 | 1276 | ||
@@ -1292,7 +1286,7 @@ GNUNET_CONTAINER_multipeermap_iterator_destroy ( | |||
1292 | * #GNUNET_SYSERR if it aborted iteration | 1286 | * #GNUNET_SYSERR if it aborted iteration |
1293 | */ | 1287 | */ |
1294 | int | 1288 | int |
1295 | GNUNET_CONTAINER_multipeermap_get_multiple ( | 1289 | GNUNET_CONTAINER_multipeermap_get_multiple( |
1296 | struct GNUNET_CONTAINER_MultiPeerMap *map, | 1290 | struct GNUNET_CONTAINER_MultiPeerMap *map, |
1297 | const struct GNUNET_PeerIdentity *key, | 1291 | const struct GNUNET_PeerIdentity *key, |
1298 | GNUNET_CONTAINER_PeerMapIterator it, | 1292 | GNUNET_CONTAINER_PeerMapIterator it, |
@@ -1311,7 +1305,7 @@ GNUNET_CONTAINER_multipeermap_get_multiple ( | |||
1311 | * @return the number of key value pairs processed, zero or one. | 1305 | * @return the number of key value pairs processed, zero or one. |
1312 | */ | 1306 | */ |
1313 | unsigned int | 1307 | unsigned int |
1314 | GNUNET_CONTAINER_multipeermap_get_random ( | 1308 | GNUNET_CONTAINER_multipeermap_get_random( |
1315 | const struct GNUNET_CONTAINER_MultiPeerMap *map, | 1309 | const struct GNUNET_CONTAINER_MultiPeerMap *map, |
1316 | GNUNET_CONTAINER_PeerMapIterator it, | 1310 | GNUNET_CONTAINER_PeerMapIterator it, |
1317 | void *it_cls); | 1311 | void *it_cls); |
@@ -1359,7 +1353,7 @@ struct GNUNET_CONTAINER_MultiShortmap; | |||
1359 | * @return NULL on error | 1353 | * @return NULL on error |
1360 | */ | 1354 | */ |
1361 | struct GNUNET_CONTAINER_MultiShortmap * | 1355 | struct GNUNET_CONTAINER_MultiShortmap * |
1362 | GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys); | 1356 | GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys); |
1363 | 1357 | ||
1364 | 1358 | ||
1365 | /** | 1359 | /** |
@@ -1370,7 +1364,7 @@ GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys); | |||
1370 | * @param map the map | 1364 | * @param map the map |
1371 | */ | 1365 | */ |
1372 | void | 1366 | void |
1373 | GNUNET_CONTAINER_multishortmap_destroy ( | 1367 | GNUNET_CONTAINER_multishortmap_destroy( |
1374 | struct GNUNET_CONTAINER_MultiShortmap *map); | 1368 | struct GNUNET_CONTAINER_MultiShortmap *map); |
1375 | 1369 | ||
1376 | 1370 | ||
@@ -1386,7 +1380,7 @@ GNUNET_CONTAINER_multishortmap_destroy ( | |||
1386 | * key-value pairs with value NULL | 1380 | * key-value pairs with value NULL |
1387 | */ | 1381 | */ |
1388 | void * | 1382 | void * |
1389 | GNUNET_CONTAINER_multishortmap_get ( | 1383 | GNUNET_CONTAINER_multishortmap_get( |
1390 | const struct GNUNET_CONTAINER_MultiShortmap *map, | 1384 | const struct GNUNET_CONTAINER_MultiShortmap *map, |
1391 | const struct GNUNET_ShortHashCode *key); | 1385 | const struct GNUNET_ShortHashCode *key); |
1392 | 1386 | ||
@@ -1404,7 +1398,7 @@ GNUNET_CONTAINER_multishortmap_get ( | |||
1404 | * is not in the map | 1398 | * is not in the map |
1405 | */ | 1399 | */ |
1406 | int | 1400 | int |
1407 | GNUNET_CONTAINER_multishortmap_remove ( | 1401 | GNUNET_CONTAINER_multishortmap_remove( |
1408 | struct GNUNET_CONTAINER_MultiShortmap *map, | 1402 | struct GNUNET_CONTAINER_MultiShortmap *map, |
1409 | const struct GNUNET_ShortHashCode *key, | 1403 | const struct GNUNET_ShortHashCode *key, |
1410 | const void *value); | 1404 | const void *value); |
@@ -1419,7 +1413,7 @@ GNUNET_CONTAINER_multishortmap_remove ( | |||
1419 | * @return number of values removed | 1413 | * @return number of values removed |
1420 | */ | 1414 | */ |
1421 | int | 1415 | int |
1422 | GNUNET_CONTAINER_multishortmap_remove_all ( | 1416 | GNUNET_CONTAINER_multishortmap_remove_all( |
1423 | struct GNUNET_CONTAINER_MultiShortmap *map, | 1417 | struct GNUNET_CONTAINER_MultiShortmap *map, |
1424 | const struct GNUNET_ShortHashCode *key); | 1418 | const struct GNUNET_ShortHashCode *key); |
1425 | 1419 | ||
@@ -1435,7 +1429,7 @@ GNUNET_CONTAINER_multishortmap_remove_all ( | |||
1435 | * #GNUNET_NO if not | 1429 | * #GNUNET_NO if not |
1436 | */ | 1430 | */ |
1437 | int | 1431 | int |
1438 | GNUNET_CONTAINER_multishortmap_contains ( | 1432 | GNUNET_CONTAINER_multishortmap_contains( |
1439 | const struct GNUNET_CONTAINER_MultiShortmap *map, | 1433 | const struct GNUNET_CONTAINER_MultiShortmap *map, |
1440 | const struct GNUNET_ShortHashCode *key); | 1434 | const struct GNUNET_ShortHashCode *key); |
1441 | 1435 | ||
@@ -1452,7 +1446,7 @@ GNUNET_CONTAINER_multishortmap_contains ( | |||
1452 | * #GNUNET_NO if not | 1446 | * #GNUNET_NO if not |
1453 | */ | 1447 | */ |
1454 | int | 1448 | int |
1455 | GNUNET_CONTAINER_multishortmap_contains_value ( | 1449 | GNUNET_CONTAINER_multishortmap_contains_value( |
1456 | const struct GNUNET_CONTAINER_MultiShortmap *map, | 1450 | const struct GNUNET_CONTAINER_MultiShortmap *map, |
1457 | const struct GNUNET_ShortHashCode *key, | 1451 | const struct GNUNET_ShortHashCode *key, |
1458 | const void *value); | 1452 | const void *value); |
@@ -1472,7 +1466,7 @@ GNUNET_CONTAINER_multishortmap_contains_value ( | |||
1472 | * value already exists | 1466 | * value already exists |
1473 | */ | 1467 | */ |
1474 | int | 1468 | int |
1475 | GNUNET_CONTAINER_multishortmap_put ( | 1469 | GNUNET_CONTAINER_multishortmap_put( |
1476 | struct GNUNET_CONTAINER_MultiShortmap *map, | 1470 | struct GNUNET_CONTAINER_MultiShortmap *map, |
1477 | const struct GNUNET_ShortHashCode *key, | 1471 | const struct GNUNET_ShortHashCode *key, |
1478 | void *value, | 1472 | void *value, |
@@ -1487,7 +1481,7 @@ GNUNET_CONTAINER_multishortmap_put ( | |||
1487 | * @return the number of key value pairs | 1481 | * @return the number of key value pairs |
1488 | */ | 1482 | */ |
1489 | unsigned int | 1483 | unsigned int |
1490 | GNUNET_CONTAINER_multishortmap_size ( | 1484 | GNUNET_CONTAINER_multishortmap_size( |
1491 | const struct GNUNET_CONTAINER_MultiShortmap *map); | 1485 | const struct GNUNET_CONTAINER_MultiShortmap *map); |
1492 | 1486 | ||
1493 | 1487 | ||
@@ -1502,7 +1496,7 @@ GNUNET_CONTAINER_multishortmap_size ( | |||
1502 | * #GNUNET_SYSERR if it aborted iteration | 1496 | * #GNUNET_SYSERR if it aborted iteration |
1503 | */ | 1497 | */ |
1504 | int | 1498 | int |
1505 | GNUNET_CONTAINER_multishortmap_iterate ( | 1499 | GNUNET_CONTAINER_multishortmap_iterate( |
1506 | struct GNUNET_CONTAINER_MultiShortmap *map, | 1500 | struct GNUNET_CONTAINER_MultiShortmap *map, |
1507 | GNUNET_CONTAINER_ShortmapIterator it, | 1501 | GNUNET_CONTAINER_ShortmapIterator it, |
1508 | void *it_cls); | 1502 | void *it_cls); |
@@ -1525,7 +1519,7 @@ struct GNUNET_CONTAINER_MultiShortmapIterator; | |||
1525 | * @return an iterator over the given multihashmap @a map | 1519 | * @return an iterator over the given multihashmap @a map |
1526 | */ | 1520 | */ |
1527 | struct GNUNET_CONTAINER_MultiShortmapIterator * | 1521 | struct GNUNET_CONTAINER_MultiShortmapIterator * |
1528 | GNUNET_CONTAINER_multishortmap_iterator_create ( | 1522 | GNUNET_CONTAINER_multishortmap_iterator_create( |
1529 | const struct GNUNET_CONTAINER_MultiShortmap *map); | 1523 | const struct GNUNET_CONTAINER_MultiShortmap *map); |
1530 | 1524 | ||
1531 | 1525 | ||
@@ -1545,7 +1539,7 @@ GNUNET_CONTAINER_multishortmap_iterator_create ( | |||
1545 | * #GNUNET_NO if we are out of elements | 1539 | * #GNUNET_NO if we are out of elements |
1546 | */ | 1540 | */ |
1547 | int | 1541 | int |
1548 | GNUNET_CONTAINER_multishortmap_iterator_next ( | 1542 | GNUNET_CONTAINER_multishortmap_iterator_next( |
1549 | struct GNUNET_CONTAINER_MultiShortmapIterator *iter, | 1543 | struct GNUNET_CONTAINER_MultiShortmapIterator *iter, |
1550 | struct GNUNET_ShortHashCode *key, | 1544 | struct GNUNET_ShortHashCode *key, |
1551 | const void **value); | 1545 | const void **value); |
@@ -1558,7 +1552,7 @@ GNUNET_CONTAINER_multishortmap_iterator_next ( | |||
1558 | * @param iter the iterator to destroy | 1552 | * @param iter the iterator to destroy |
1559 | */ | 1553 | */ |
1560 | void | 1554 | void |
1561 | GNUNET_CONTAINER_multishortmap_iterator_destroy ( | 1555 | GNUNET_CONTAINER_multishortmap_iterator_destroy( |
1562 | struct GNUNET_CONTAINER_MultiShortmapIterator *iter); | 1556 | struct GNUNET_CONTAINER_MultiShortmapIterator *iter); |
1563 | 1557 | ||
1564 | 1558 | ||
@@ -1574,7 +1568,7 @@ GNUNET_CONTAINER_multishortmap_iterator_destroy ( | |||
1574 | * #GNUNET_SYSERR if it aborted iteration | 1568 | * #GNUNET_SYSERR if it aborted iteration |
1575 | */ | 1569 | */ |
1576 | int | 1570 | int |
1577 | GNUNET_CONTAINER_multishortmap_get_multiple ( | 1571 | GNUNET_CONTAINER_multishortmap_get_multiple( |
1578 | struct GNUNET_CONTAINER_MultiShortmap *map, | 1572 | struct GNUNET_CONTAINER_MultiShortmap *map, |
1579 | const struct GNUNET_ShortHashCode *key, | 1573 | const struct GNUNET_ShortHashCode *key, |
1580 | GNUNET_CONTAINER_ShortmapIterator it, | 1574 | GNUNET_CONTAINER_ShortmapIterator it, |
@@ -1593,7 +1587,7 @@ GNUNET_CONTAINER_multishortmap_get_multiple ( | |||
1593 | * @return the number of key value pairs processed, zero or one. | 1587 | * @return the number of key value pairs processed, zero or one. |
1594 | */ | 1588 | */ |
1595 | unsigned int | 1589 | unsigned int |
1596 | GNUNET_CONTAINER_multishortmap_get_random ( | 1590 | GNUNET_CONTAINER_multishortmap_get_random( |
1597 | const struct GNUNET_CONTAINER_MultiShortmap *map, | 1591 | const struct GNUNET_CONTAINER_MultiShortmap *map, |
1598 | GNUNET_CONTAINER_ShortmapIterator it, | 1592 | GNUNET_CONTAINER_ShortmapIterator it, |
1599 | void *it_cls); | 1593 | void *it_cls); |
@@ -1642,7 +1636,7 @@ struct GNUNET_CONTAINER_MultiUuidmap; | |||
1642 | * @return NULL on error | 1636 | * @return NULL on error |
1643 | */ | 1637 | */ |
1644 | struct GNUNET_CONTAINER_MultiUuidmap * | 1638 | struct GNUNET_CONTAINER_MultiUuidmap * |
1645 | GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys); | 1639 | GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys); |
1646 | 1640 | ||
1647 | 1641 | ||
1648 | /** | 1642 | /** |
@@ -1653,7 +1647,7 @@ GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys); | |||
1653 | * @param map the map | 1647 | * @param map the map |
1654 | */ | 1648 | */ |
1655 | void | 1649 | void |
1656 | GNUNET_CONTAINER_multiuuidmap_destroy ( | 1650 | GNUNET_CONTAINER_multiuuidmap_destroy( |
1657 | struct GNUNET_CONTAINER_MultiUuidmap *map); | 1651 | struct GNUNET_CONTAINER_MultiUuidmap *map); |
1658 | 1652 | ||
1659 | 1653 | ||
@@ -1669,7 +1663,7 @@ GNUNET_CONTAINER_multiuuidmap_destroy ( | |||
1669 | * key-value pairs with value NULL | 1663 | * key-value pairs with value NULL |
1670 | */ | 1664 | */ |
1671 | void * | 1665 | void * |
1672 | GNUNET_CONTAINER_multiuuidmap_get ( | 1666 | GNUNET_CONTAINER_multiuuidmap_get( |
1673 | const struct GNUNET_CONTAINER_MultiUuidmap *map, | 1667 | const struct GNUNET_CONTAINER_MultiUuidmap *map, |
1674 | const struct GNUNET_Uuid *key); | 1668 | const struct GNUNET_Uuid *key); |
1675 | 1669 | ||
@@ -1687,9 +1681,9 @@ GNUNET_CONTAINER_multiuuidmap_get ( | |||
1687 | * is not in the map | 1681 | * is not in the map |
1688 | */ | 1682 | */ |
1689 | int | 1683 | int |
1690 | GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map, | 1684 | GNUNET_CONTAINER_multiuuidmap_remove(struct GNUNET_CONTAINER_MultiUuidmap *map, |
1691 | const struct GNUNET_Uuid *key, | 1685 | const struct GNUNET_Uuid *key, |
1692 | const void *value); | 1686 | const void *value); |
1693 | 1687 | ||
1694 | /** | 1688 | /** |
1695 | * @ingroup hashmap | 1689 | * @ingroup hashmap |
@@ -1701,7 +1695,7 @@ GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map, | |||
1701 | * @return number of values removed | 1695 | * @return number of values removed |
1702 | */ | 1696 | */ |
1703 | int | 1697 | int |
1704 | GNUNET_CONTAINER_multiuuidmap_remove_all ( | 1698 | GNUNET_CONTAINER_multiuuidmap_remove_all( |
1705 | struct GNUNET_CONTAINER_MultiUuidmap *map, | 1699 | struct GNUNET_CONTAINER_MultiUuidmap *map, |
1706 | const struct GNUNET_Uuid *key); | 1700 | const struct GNUNET_Uuid *key); |
1707 | 1701 | ||
@@ -1717,7 +1711,7 @@ GNUNET_CONTAINER_multiuuidmap_remove_all ( | |||
1717 | * #GNUNET_NO if not | 1711 | * #GNUNET_NO if not |
1718 | */ | 1712 | */ |
1719 | int | 1713 | int |
1720 | GNUNET_CONTAINER_multiuuidmap_contains ( | 1714 | GNUNET_CONTAINER_multiuuidmap_contains( |
1721 | const struct GNUNET_CONTAINER_MultiUuidmap *map, | 1715 | const struct GNUNET_CONTAINER_MultiUuidmap *map, |
1722 | const struct GNUNET_Uuid *key); | 1716 | const struct GNUNET_Uuid *key); |
1723 | 1717 | ||
@@ -1734,7 +1728,7 @@ GNUNET_CONTAINER_multiuuidmap_contains ( | |||
1734 | * #GNUNET_NO if not | 1728 | * #GNUNET_NO if not |
1735 | */ | 1729 | */ |
1736 | int | 1730 | int |
1737 | GNUNET_CONTAINER_multiuuidmap_contains_value ( | 1731 | GNUNET_CONTAINER_multiuuidmap_contains_value( |
1738 | const struct GNUNET_CONTAINER_MultiUuidmap *map, | 1732 | const struct GNUNET_CONTAINER_MultiUuidmap *map, |
1739 | const struct GNUNET_Uuid *key, | 1733 | const struct GNUNET_Uuid *key, |
1740 | const void *value); | 1734 | const void *value); |
@@ -1754,7 +1748,7 @@ GNUNET_CONTAINER_multiuuidmap_contains_value ( | |||
1754 | * value already exists | 1748 | * value already exists |
1755 | */ | 1749 | */ |
1756 | int | 1750 | int |
1757 | GNUNET_CONTAINER_multiuuidmap_put ( | 1751 | GNUNET_CONTAINER_multiuuidmap_put( |
1758 | struct GNUNET_CONTAINER_MultiUuidmap *map, | 1752 | struct GNUNET_CONTAINER_MultiUuidmap *map, |
1759 | const struct GNUNET_Uuid *key, | 1753 | const struct GNUNET_Uuid *key, |
1760 | void *value, | 1754 | void *value, |
@@ -1769,7 +1763,7 @@ GNUNET_CONTAINER_multiuuidmap_put ( | |||
1769 | * @return the number of key value pairs | 1763 | * @return the number of key value pairs |
1770 | */ | 1764 | */ |
1771 | unsigned int | 1765 | unsigned int |
1772 | GNUNET_CONTAINER_multiuuidmap_size ( | 1766 | GNUNET_CONTAINER_multiuuidmap_size( |
1773 | const struct GNUNET_CONTAINER_MultiUuidmap *map); | 1767 | const struct GNUNET_CONTAINER_MultiUuidmap *map); |
1774 | 1768 | ||
1775 | 1769 | ||
@@ -1784,7 +1778,7 @@ GNUNET_CONTAINER_multiuuidmap_size ( | |||
1784 | * #GNUNET_SYSERR if it aborted iteration | 1778 | * #GNUNET_SYSERR if it aborted iteration |
1785 | */ | 1779 | */ |
1786 | int | 1780 | int |
1787 | GNUNET_CONTAINER_multiuuidmap_iterate ( | 1781 | GNUNET_CONTAINER_multiuuidmap_iterate( |
1788 | struct GNUNET_CONTAINER_MultiUuidmap *map, | 1782 | struct GNUNET_CONTAINER_MultiUuidmap *map, |
1789 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, | 1783 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, |
1790 | void *it_cls); | 1784 | void *it_cls); |
@@ -1807,7 +1801,7 @@ struct GNUNET_CONTAINER_MultiUuidmapIterator; | |||
1807 | * @return an iterator over the given multihashmap @a map | 1801 | * @return an iterator over the given multihashmap @a map |
1808 | */ | 1802 | */ |
1809 | struct GNUNET_CONTAINER_MultiUuidmapIterator * | 1803 | struct GNUNET_CONTAINER_MultiUuidmapIterator * |
1810 | GNUNET_CONTAINER_multiuuidmap_iterator_create ( | 1804 | GNUNET_CONTAINER_multiuuidmap_iterator_create( |
1811 | const struct GNUNET_CONTAINER_MultiUuidmap *map); | 1805 | const struct GNUNET_CONTAINER_MultiUuidmap *map); |
1812 | 1806 | ||
1813 | 1807 | ||
@@ -1827,7 +1821,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_create ( | |||
1827 | * #GNUNET_NO if we are out of elements | 1821 | * #GNUNET_NO if we are out of elements |
1828 | */ | 1822 | */ |
1829 | int | 1823 | int |
1830 | GNUNET_CONTAINER_multiuuidmap_iterator_next ( | 1824 | GNUNET_CONTAINER_multiuuidmap_iterator_next( |
1831 | struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, | 1825 | struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, |
1832 | struct GNUNET_Uuid *key, | 1826 | struct GNUNET_Uuid *key, |
1833 | const void **value); | 1827 | const void **value); |
@@ -1840,7 +1834,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_next ( | |||
1840 | * @param iter the iterator to destroy | 1834 | * @param iter the iterator to destroy |
1841 | */ | 1835 | */ |
1842 | void | 1836 | void |
1843 | GNUNET_CONTAINER_multiuuidmap_iterator_destroy ( | 1837 | GNUNET_CONTAINER_multiuuidmap_iterator_destroy( |
1844 | struct GNUNET_CONTAINER_MultiUuidmapIterator *iter); | 1838 | struct GNUNET_CONTAINER_MultiUuidmapIterator *iter); |
1845 | 1839 | ||
1846 | 1840 | ||
@@ -1856,7 +1850,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_destroy ( | |||
1856 | * #GNUNET_SYSERR if it aborted iteration | 1850 | * #GNUNET_SYSERR if it aborted iteration |
1857 | */ | 1851 | */ |
1858 | int | 1852 | int |
1859 | GNUNET_CONTAINER_multiuuidmap_get_multiple ( | 1853 | GNUNET_CONTAINER_multiuuidmap_get_multiple( |
1860 | struct GNUNET_CONTAINER_MultiUuidmap *map, | 1854 | struct GNUNET_CONTAINER_MultiUuidmap *map, |
1861 | const struct GNUNET_Uuid *key, | 1855 | const struct GNUNET_Uuid *key, |
1862 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, | 1856 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, |
@@ -1875,7 +1869,7 @@ GNUNET_CONTAINER_multiuuidmap_get_multiple ( | |||
1875 | * @return the number of key value pairs processed, zero or one. | 1869 | * @return the number of key value pairs processed, zero or one. |
1876 | */ | 1870 | */ |
1877 | unsigned int | 1871 | unsigned int |
1878 | GNUNET_CONTAINER_multiuuidmap_get_random ( | 1872 | GNUNET_CONTAINER_multiuuidmap_get_random( |
1879 | const struct GNUNET_CONTAINER_MultiUuidmap *map, | 1873 | const struct GNUNET_CONTAINER_MultiUuidmap *map, |
1880 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, | 1874 | GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, |
1881 | void *it_cls); | 1875 | void *it_cls); |
@@ -1922,7 +1916,7 @@ typedef int (*GNUNET_CONTAINER_MulitHashMapIterator32Callback) (void *cls, | |||
1922 | * @return NULL on error | 1916 | * @return NULL on error |
1923 | */ | 1917 | */ |
1924 | struct GNUNET_CONTAINER_MultiHashMap32 * | 1918 | struct GNUNET_CONTAINER_MultiHashMap32 * |
1925 | GNUNET_CONTAINER_multihashmap32_create (unsigned int len); | 1919 | GNUNET_CONTAINER_multihashmap32_create(unsigned int len); |
1926 | 1920 | ||
1927 | 1921 | ||
1928 | /** | 1922 | /** |
@@ -1933,7 +1927,7 @@ GNUNET_CONTAINER_multihashmap32_create (unsigned int len); | |||
1933 | * @param map the map | 1927 | * @param map the map |
1934 | */ | 1928 | */ |
1935 | void | 1929 | void |
1936 | GNUNET_CONTAINER_multihashmap32_destroy ( | 1930 | GNUNET_CONTAINER_multihashmap32_destroy( |
1937 | struct GNUNET_CONTAINER_MultiHashMap32 *map); | 1931 | struct GNUNET_CONTAINER_MultiHashMap32 *map); |
1938 | 1932 | ||
1939 | 1933 | ||
@@ -1945,7 +1939,7 @@ GNUNET_CONTAINER_multihashmap32_destroy ( | |||
1945 | * @return the number of key value pairs | 1939 | * @return the number of key value pairs |
1946 | */ | 1940 | */ |
1947 | unsigned int | 1941 | unsigned int |
1948 | GNUNET_CONTAINER_multihashmap32_size ( | 1942 | GNUNET_CONTAINER_multihashmap32_size( |
1949 | const struct GNUNET_CONTAINER_MultiHashMap32 *map); | 1943 | const struct GNUNET_CONTAINER_MultiHashMap32 *map); |
1950 | 1944 | ||
1951 | 1945 | ||
@@ -1961,7 +1955,7 @@ GNUNET_CONTAINER_multihashmap32_size ( | |||
1961 | * key-value pairs with value NULL | 1955 | * key-value pairs with value NULL |
1962 | */ | 1956 | */ |
1963 | void * | 1957 | void * |
1964 | GNUNET_CONTAINER_multihashmap32_get ( | 1958 | GNUNET_CONTAINER_multihashmap32_get( |
1965 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, | 1959 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, |
1966 | uint32_t key); | 1960 | uint32_t key); |
1967 | 1961 | ||
@@ -1977,7 +1971,7 @@ GNUNET_CONTAINER_multihashmap32_get ( | |||
1977 | * #GNUNET_SYSERR if it aborted iteration | 1971 | * #GNUNET_SYSERR if it aborted iteration |
1978 | */ | 1972 | */ |
1979 | int | 1973 | int |
1980 | GNUNET_CONTAINER_multihashmap32_iterate ( | 1974 | GNUNET_CONTAINER_multihashmap32_iterate( |
1981 | struct GNUNET_CONTAINER_MultiHashMap32 *map, | 1975 | struct GNUNET_CONTAINER_MultiHashMap32 *map, |
1982 | GNUNET_CONTAINER_MulitHashMapIterator32Callback it, | 1976 | GNUNET_CONTAINER_MulitHashMapIterator32Callback it, |
1983 | void *it_cls); | 1977 | void *it_cls); |
@@ -1996,7 +1990,7 @@ GNUNET_CONTAINER_multihashmap32_iterate ( | |||
1996 | * is not in the map | 1990 | * is not in the map |
1997 | */ | 1991 | */ |
1998 | int | 1992 | int |
1999 | GNUNET_CONTAINER_multihashmap32_remove ( | 1993 | GNUNET_CONTAINER_multihashmap32_remove( |
2000 | struct GNUNET_CONTAINER_MultiHashMap32 *map, | 1994 | struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2001 | uint32_t key, | 1995 | uint32_t key, |
2002 | const void *value); | 1996 | const void *value); |
@@ -2012,7 +2006,7 @@ GNUNET_CONTAINER_multihashmap32_remove ( | |||
2012 | * @return number of values removed | 2006 | * @return number of values removed |
2013 | */ | 2007 | */ |
2014 | int | 2008 | int |
2015 | GNUNET_CONTAINER_multihashmap32_remove_all ( | 2009 | GNUNET_CONTAINER_multihashmap32_remove_all( |
2016 | struct GNUNET_CONTAINER_MultiHashMap32 *map, | 2010 | struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2017 | uint32_t key); | 2011 | uint32_t key); |
2018 | 2012 | ||
@@ -2028,7 +2022,7 @@ GNUNET_CONTAINER_multihashmap32_remove_all ( | |||
2028 | * #GNUNET_NO if not | 2022 | * #GNUNET_NO if not |
2029 | */ | 2023 | */ |
2030 | int | 2024 | int |
2031 | GNUNET_CONTAINER_multihashmap32_contains ( | 2025 | GNUNET_CONTAINER_multihashmap32_contains( |
2032 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, | 2026 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2033 | uint32_t key); | 2027 | uint32_t key); |
2034 | 2028 | ||
@@ -2045,7 +2039,7 @@ GNUNET_CONTAINER_multihashmap32_contains ( | |||
2045 | * #GNUNET_NO if not | 2039 | * #GNUNET_NO if not |
2046 | */ | 2040 | */ |
2047 | int | 2041 | int |
2048 | GNUNET_CONTAINER_multihashmap32_contains_value ( | 2042 | GNUNET_CONTAINER_multihashmap32_contains_value( |
2049 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, | 2043 | const struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2050 | uint32_t key, | 2044 | uint32_t key, |
2051 | const void *value); | 2045 | const void *value); |
@@ -2065,7 +2059,7 @@ GNUNET_CONTAINER_multihashmap32_contains_value ( | |||
2065 | * value already exists | 2059 | * value already exists |
2066 | */ | 2060 | */ |
2067 | int | 2061 | int |
2068 | GNUNET_CONTAINER_multihashmap32_put ( | 2062 | GNUNET_CONTAINER_multihashmap32_put( |
2069 | struct GNUNET_CONTAINER_MultiHashMap32 *map, | 2063 | struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2070 | uint32_t key, | 2064 | uint32_t key, |
2071 | void *value, | 2065 | void *value, |
@@ -2084,7 +2078,7 @@ GNUNET_CONTAINER_multihashmap32_put ( | |||
2084 | * #GNUNET_SYSERR if it aborted iteration | 2078 | * #GNUNET_SYSERR if it aborted iteration |
2085 | */ | 2079 | */ |
2086 | int | 2080 | int |
2087 | GNUNET_CONTAINER_multihashmap32_get_multiple ( | 2081 | GNUNET_CONTAINER_multihashmap32_get_multiple( |
2088 | struct GNUNET_CONTAINER_MultiHashMap32 *map, | 2082 | struct GNUNET_CONTAINER_MultiHashMap32 *map, |
2089 | uint32_t key, | 2083 | uint32_t key, |
2090 | GNUNET_CONTAINER_MulitHashMapIterator32Callback it, | 2084 | GNUNET_CONTAINER_MulitHashMapIterator32Callback it, |
@@ -2104,7 +2098,7 @@ GNUNET_CONTAINER_multihashmap32_get_multiple ( | |||
2104 | * @return an iterator over the given multihashmap map | 2098 | * @return an iterator over the given multihashmap map |
2105 | */ | 2099 | */ |
2106 | struct GNUNET_CONTAINER_MultiHashMap32Iterator * | 2100 | struct GNUNET_CONTAINER_MultiHashMap32Iterator * |
2107 | GNUNET_CONTAINER_multihashmap32_iterator_create ( | 2101 | GNUNET_CONTAINER_multihashmap32_iterator_create( |
2108 | const struct GNUNET_CONTAINER_MultiHashMap32 *map); | 2102 | const struct GNUNET_CONTAINER_MultiHashMap32 *map); |
2109 | 2103 | ||
2110 | 2104 | ||
@@ -2123,7 +2117,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_create ( | |||
2123 | * #GNUNET_NO if we are out of elements | 2117 | * #GNUNET_NO if we are out of elements |
2124 | */ | 2118 | */ |
2125 | int | 2119 | int |
2126 | GNUNET_CONTAINER_multihashmap32_iterator_next ( | 2120 | GNUNET_CONTAINER_multihashmap32_iterator_next( |
2127 | struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter, | 2121 | struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter, |
2128 | uint32_t *key, | 2122 | uint32_t *key, |
2129 | const void **value); | 2123 | const void **value); |
@@ -2135,7 +2129,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_next ( | |||
2135 | * @param iter the iterator to destroy | 2129 | * @param iter the iterator to destroy |
2136 | */ | 2130 | */ |
2137 | void | 2131 | void |
2138 | GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | 2132 | GNUNET_CONTAINER_multihashmap32_iterator_destroy( |
2139 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter); | 2133 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter); |
2140 | 2134 | ||
2141 | 2135 | ||
@@ -2153,17 +2147,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2153 | */ | 2147 | */ |
2154 | #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \ | 2148 | #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \ |
2155 | do \ | 2149 | do \ |
2156 | { \ | 2150 | { \ |
2157 | GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \ | 2151 | GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ |
2158 | GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \ | 2152 | GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ |
2159 | (element)->next = (head); \ | 2153 | (element)->next = (head); \ |
2160 | (element)->prev = NULL; \ | 2154 | (element)->prev = NULL; \ |
2161 | if ((tail) == NULL) \ | 2155 | if ((tail) == NULL) \ |
2162 | (tail) = element; \ | 2156 | (tail) = element; \ |
2163 | else \ | 2157 | else \ |
2164 | (head)->prev = element; \ | 2158 | (head) ->prev = element; \ |
2165 | (head) = (element); \ | 2159 | (head) = (element); \ |
2166 | } while (0) | 2160 | } while (0) |
2167 | 2161 | ||
2168 | 2162 | ||
2169 | /** | 2163 | /** |
@@ -2177,17 +2171,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2177 | */ | 2171 | */ |
2178 | #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \ | 2172 | #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \ |
2179 | do \ | 2173 | do \ |
2180 | { \ | 2174 | { \ |
2181 | GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \ | 2175 | GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ |
2182 | GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \ | 2176 | GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ |
2183 | (element)->prev = (tail); \ | 2177 | (element)->prev = (tail); \ |
2184 | (element)->next = NULL; \ | 2178 | (element)->next = NULL; \ |
2185 | if ((head) == NULL) \ | 2179 | if ((head) == NULL) \ |
2186 | (head) = element; \ | 2180 | (head) = element; \ |
2187 | else \ | 2181 | else \ |
2188 | (tail)->next = element; \ | 2182 | (tail) ->next = element; \ |
2189 | (tail) = (element); \ | 2183 | (tail) = (element); \ |
2190 | } while (0) | 2184 | } while (0) |
2191 | 2185 | ||
2192 | 2186 | ||
2193 | /** | 2187 | /** |
@@ -2202,25 +2196,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2202 | */ | 2196 | */ |
2203 | #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \ | 2197 | #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \ |
2204 | do \ | 2198 | do \ |
2205 | { \ | 2199 | { \ |
2206 | GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \ | 2200 | GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ |
2207 | GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \ | 2201 | GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ |
2208 | (element)->prev = (other); \ | 2202 | (element)->prev = (other); \ |
2209 | if (NULL == other) \ | 2203 | if (NULL == other) \ |
2210 | { \ | 2204 | { \ |
2211 | (element)->next = (head); \ | 2205 | (element)->next = (head); \ |
2212 | (head) = (element); \ | 2206 | (head) = (element); \ |
2213 | } \ | 2207 | } \ |
2214 | else \ | 2208 | else \ |
2215 | { \ | 2209 | { \ |
2216 | (element)->next = (other)->next; \ | 2210 | (element)->next = (other)->next; \ |
2217 | (other)->next = (element); \ | 2211 | (other)->next = (element); \ |
2218 | } \ | 2212 | } \ |
2219 | if (NULL == (element)->next) \ | 2213 | if (NULL == (element)->next) \ |
2220 | (tail) = (element); \ | 2214 | (tail) = (element); \ |
2221 | else \ | 2215 | else \ |
2222 | (element)->next->prev = (element); \ | 2216 | (element) ->next->prev = (element); \ |
2223 | } while (0) | 2217 | } while (0) |
2224 | 2218 | ||
2225 | 2219 | ||
2226 | /** | 2220 | /** |
@@ -2235,25 +2229,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2235 | */ | 2229 | */ |
2236 | #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \ | 2230 | #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \ |
2237 | do \ | 2231 | do \ |
2238 | { \ | 2232 | { \ |
2239 | GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \ | 2233 | GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ |
2240 | GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \ | 2234 | GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ |
2241 | (element)->next = (other); \ | 2235 | (element)->next = (other); \ |
2242 | if (NULL == other) \ | 2236 | if (NULL == other) \ |
2243 | { \ | 2237 | { \ |
2244 | (element)->prev = (tail); \ | 2238 | (element)->prev = (tail); \ |
2245 | (tail) = (element); \ | 2239 | (tail) = (element); \ |
2246 | } \ | 2240 | } \ |
2247 | else \ | 2241 | else \ |
2248 | { \ | 2242 | { \ |
2249 | (element)->prev = (other)->prev; \ | 2243 | (element)->prev = (other)->prev; \ |
2250 | (other)->prev = (element); \ | 2244 | (other)->prev = (element); \ |
2251 | } \ | 2245 | } \ |
2252 | if (NULL == (element)->prev) \ | 2246 | if (NULL == (element)->prev) \ |
2253 | (head) = (element); \ | 2247 | (head) = (element); \ |
2254 | else \ | 2248 | else \ |
2255 | (element)->prev->next = (element); \ | 2249 | (element) ->prev->next = (element); \ |
2256 | } while (0) | 2250 | } while (0) |
2257 | 2251 | ||
2258 | 2252 | ||
2259 | /** | 2253 | /** |
@@ -2272,20 +2266,20 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2272 | */ | 2266 | */ |
2273 | #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \ | 2267 | #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \ |
2274 | do \ | 2268 | do \ |
2275 | { \ | 2269 | { \ |
2276 | GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \ | 2270 | GNUNET_assert(((element)->prev != NULL) || ((head) == (element))); \ |
2277 | GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \ | 2271 | GNUNET_assert(((element)->next != NULL) || ((tail) == (element))); \ |
2278 | if ((element)->prev == NULL) \ | 2272 | if ((element)->prev == NULL) \ |
2279 | (head) = (element)->next; \ | 2273 | (head) = (element)->next; \ |
2280 | else \ | 2274 | else \ |
2281 | (element)->prev->next = (element)->next; \ | 2275 | (element) ->prev->next = (element)->next; \ |
2282 | if ((element)->next == NULL) \ | 2276 | if ((element)->next == NULL) \ |
2283 | (tail) = (element)->prev; \ | 2277 | (tail) = (element)->prev; \ |
2284 | else \ | 2278 | else \ |
2285 | (element)->next->prev = (element)->prev; \ | 2279 | (element) ->next->prev = (element)->prev; \ |
2286 | (element)->next = NULL; \ | 2280 | (element)->next = NULL; \ |
2287 | (element)->prev = NULL; \ | 2281 | (element)->prev = NULL; \ |
2288 | } while (0) | 2282 | } while (0) |
2289 | 2283 | ||
2290 | 2284 | ||
2291 | /* ************ Multi-DLL interface, allows DLL elements to be | 2285 | /* ************ Multi-DLL interface, allows DLL elements to be |
@@ -2303,17 +2297,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2303 | */ | 2297 | */ |
2304 | #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \ | 2298 | #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \ |
2305 | do \ | 2299 | do \ |
2306 | { \ | 2300 | { \ |
2307 | GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \ | 2301 | GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ |
2308 | GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \ | 2302 | GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ |
2309 | (element)->next_##mdll = (head); \ | 2303 | (element)->next_ ## mdll = (head); \ |
2310 | (element)->prev_##mdll = NULL; \ | 2304 | (element)->prev_ ## mdll = NULL; \ |
2311 | if ((tail) == NULL) \ | 2305 | if ((tail) == NULL) \ |
2312 | (tail) = element; \ | 2306 | (tail) = element; \ |
2313 | else \ | 2307 | else \ |
2314 | (head)->prev_##mdll = element; \ | 2308 | (head) ->prev_ ## mdll = element; \ |
2315 | (head) = (element); \ | 2309 | (head) = (element); \ |
2316 | } while (0) | 2310 | } while (0) |
2317 | 2311 | ||
2318 | 2312 | ||
2319 | /** | 2313 | /** |
@@ -2328,17 +2322,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2328 | */ | 2322 | */ |
2329 | #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \ | 2323 | #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \ |
2330 | do \ | 2324 | do \ |
2331 | { \ | 2325 | { \ |
2332 | GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \ | 2326 | GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ |
2333 | GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \ | 2327 | GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ |
2334 | (element)->prev_##mdll = (tail); \ | 2328 | (element)->prev_ ## mdll = (tail); \ |
2335 | (element)->next_##mdll = NULL; \ | 2329 | (element)->next_ ## mdll = NULL; \ |
2336 | if ((head) == NULL) \ | 2330 | if ((head) == NULL) \ |
2337 | (head) = element; \ | 2331 | (head) = element; \ |
2338 | else \ | 2332 | else \ |
2339 | (tail)->next_##mdll = element; \ | 2333 | (tail) ->next_ ## mdll = element; \ |
2340 | (tail) = (element); \ | 2334 | (tail) = (element); \ |
2341 | } while (0) | 2335 | } while (0) |
2342 | 2336 | ||
2343 | 2337 | ||
2344 | /** | 2338 | /** |
@@ -2354,25 +2348,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2354 | */ | 2348 | */ |
2355 | #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \ | 2349 | #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \ |
2356 | do \ | 2350 | do \ |
2357 | { \ | 2351 | { \ |
2358 | GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \ | 2352 | GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ |
2359 | GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \ | 2353 | GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ |
2360 | (element)->prev_##mdll = (other); \ | 2354 | (element)->prev_ ## mdll = (other); \ |
2361 | if (NULL == other) \ | 2355 | if (NULL == other) \ |
2362 | { \ | 2356 | { \ |
2363 | (element)->next_##mdll = (head); \ | 2357 | (element)->next_ ## mdll = (head); \ |
2364 | (head) = (element); \ | 2358 | (head) = (element); \ |
2365 | } \ | 2359 | } \ |
2366 | else \ | 2360 | else \ |
2367 | { \ | 2361 | { \ |
2368 | (element)->next_##mdll = (other)->next_##mdll; \ | 2362 | (element)->next_ ## mdll = (other)->next_ ## mdll; \ |
2369 | (other)->next_##mdll = (element); \ | 2363 | (other)->next_ ## mdll = (element); \ |
2370 | } \ | 2364 | } \ |
2371 | if (NULL == (element)->next_##mdll) \ | 2365 | if (NULL == (element)->next_ ## mdll) \ |
2372 | (tail) = (element); \ | 2366 | (tail) = (element); \ |
2373 | else \ | 2367 | else \ |
2374 | (element)->next_##mdll->prev_##mdll = (element); \ | 2368 | (element) ->next_ ## mdll->prev_ ## mdll = (element); \ |
2375 | } while (0) | 2369 | } while (0) |
2376 | 2370 | ||
2377 | 2371 | ||
2378 | /** | 2372 | /** |
@@ -2388,25 +2382,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2388 | */ | 2382 | */ |
2389 | #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \ | 2383 | #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \ |
2390 | do \ | 2384 | do \ |
2391 | { \ | 2385 | { \ |
2392 | GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \ | 2386 | GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ |
2393 | GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \ | 2387 | GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ |
2394 | (element)->next_##mdll = (other); \ | 2388 | (element)->next_ ## mdll = (other); \ |
2395 | if (NULL == other) \ | 2389 | if (NULL == other) \ |
2396 | { \ | 2390 | { \ |
2397 | (element)->prev = (tail); \ | 2391 | (element)->prev = (tail); \ |
2398 | (tail) = (element); \ | 2392 | (tail) = (element); \ |
2399 | } \ | 2393 | } \ |
2400 | else \ | 2394 | else \ |
2401 | { \ | 2395 | { \ |
2402 | (element)->prev_##mdll = (other)->prev_##mdll; \ | 2396 | (element)->prev_ ## mdll = (other)->prev_ ## mdll; \ |
2403 | (other)->prev_##mdll = (element); \ | 2397 | (other)->prev_ ## mdll = (element); \ |
2404 | } \ | 2398 | } \ |
2405 | if (NULL == (element)->prev_##mdll) \ | 2399 | if (NULL == (element)->prev_ ## mdll) \ |
2406 | (head) = (element); \ | 2400 | (head) = (element); \ |
2407 | else \ | 2401 | else \ |
2408 | (element)->prev_##mdll->next_##mdll = (element); \ | 2402 | (element) ->prev_ ## mdll->next_ ## mdll = (element); \ |
2409 | } while (0) | 2403 | } while (0) |
2410 | 2404 | ||
2411 | 2405 | ||
2412 | /** | 2406 | /** |
@@ -2422,20 +2416,20 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2422 | */ | 2416 | */ |
2423 | #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \ | 2417 | #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \ |
2424 | do \ | 2418 | do \ |
2425 | { \ | 2419 | { \ |
2426 | GNUNET_assert (((element)->prev_##mdll != NULL) || ((head) == (element))); \ | 2420 | GNUNET_assert(((element)->prev_ ## mdll != NULL) || ((head) == (element))); \ |
2427 | GNUNET_assert (((element)->next_##mdll != NULL) || ((tail) == (element))); \ | 2421 | GNUNET_assert(((element)->next_ ## mdll != NULL) || ((tail) == (element))); \ |
2428 | if ((element)->prev_##mdll == NULL) \ | 2422 | if ((element)->prev_ ## mdll == NULL) \ |
2429 | (head) = (element)->next_##mdll; \ | 2423 | (head) = (element)->next_ ## mdll; \ |
2430 | else \ | 2424 | else \ |
2431 | (element)->prev_##mdll->next_##mdll = (element)->next_##mdll; \ | 2425 | (element) ->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \ |
2432 | if ((element)->next_##mdll == NULL) \ | 2426 | if ((element)->next_ ## mdll == NULL) \ |
2433 | (tail) = (element)->prev_##mdll; \ | 2427 | (tail) = (element)->prev_ ## mdll; \ |
2434 | else \ | 2428 | else \ |
2435 | (element)->next_##mdll->prev_##mdll = (element)->prev_##mdll; \ | 2429 | (element) ->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \ |
2436 | (element)->next_##mdll = NULL; \ | 2430 | (element)->next_ ## mdll = NULL; \ |
2437 | (element)->prev_##mdll = NULL; \ | 2431 | (element)->prev_ ## mdll = NULL; \ |
2438 | } while (0) | 2432 | } while (0) |
2439 | 2433 | ||
2440 | 2434 | ||
2441 | /** | 2435 | /** |
@@ -2458,29 +2452,29 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( | |||
2458 | tail, \ | 2452 | tail, \ |
2459 | element) \ | 2453 | element) \ |
2460 | do \ | 2454 | do \ |
2461 | { \ | 2455 | { \ |
2462 | if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \ | 2456 | if ((NULL == head) || (0 < comparator(comparator_cls, element, head))) \ |
2463 | { \ | 2457 | { \ |
2464 | /* insert at head, element < head */ \ | 2458 | /* insert at head, element < head */ \ |
2465 | GNUNET_CONTAINER_DLL_insert (head, tail, element); \ | 2459 | GNUNET_CONTAINER_DLL_insert(head, tail, element); \ |
2466 | } \ | 2460 | } \ |
2467 | else \ | 2461 | else \ |
2468 | { \ | 2462 | { \ |
2469 | TYPE *pos; \ | 2463 | TYPE *pos; \ |
2470 | \ | 2464 | \ |
2471 | for (pos = head; NULL != pos; pos = pos->next) \ | 2465 | for (pos = head; NULL != pos; pos = pos->next) \ |
2472 | if (0 < comparator (comparator_cls, element, pos)) \ | 2466 | if (0 < comparator(comparator_cls, element, pos)) \ |
2473 | break; /* element < pos */ \ | 2467 | break; /* element < pos */ \ |
2474 | if (NULL == pos) /* => element > tail */ \ | 2468 | if (NULL == pos) /* => element > tail */ \ |
2475 | { \ | 2469 | { \ |
2476 | GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \ | 2470 | GNUNET_CONTAINER_DLL_insert_tail(head, tail, element); \ |
2477 | } \ | 2471 | } \ |
2478 | else /* prev < element < pos */ \ | 2472 | else /* prev < element < pos */ \ |
2479 | { \ | 2473 | { \ |
2480 | GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \ | 2474 | GNUNET_CONTAINER_DLL_insert_after(head, tail, pos->prev, element); \ |
2481 | } \ | 2475 | } \ |
2482 | } \ | 2476 | } \ |
2483 | } while (0) | 2477 | } while (0) |
2484 | 2478 | ||
2485 | 2479 | ||
2486 | /* ******************** Heap *************** */ | 2480 | /* ******************** Heap *************** */ |
@@ -2497,8 +2491,7 @@ typedef uint64_t GNUNET_CONTAINER_HeapCostType; | |||
2497 | * @ingroup heap | 2491 | * @ingroup heap |
2498 | * Heap type, either max or min. | 2492 | * Heap type, either max or min. |
2499 | */ | 2493 | */ |
2500 | enum GNUNET_CONTAINER_HeapOrder | 2494 | enum GNUNET_CONTAINER_HeapOrder { |
2501 | { | ||
2502 | /** | 2495 | /** |
2503 | * @ingroup heap | 2496 | * @ingroup heap |
2504 | * Heap with the maximum cost at the root. | 2497 | * Heap with the maximum cost at the root. |
@@ -2535,7 +2528,7 @@ struct GNUNET_CONTAINER_HeapNode; | |||
2535 | * @return handle to the heap | 2528 | * @return handle to the heap |
2536 | */ | 2529 | */ |
2537 | struct GNUNET_CONTAINER_Heap * | 2530 | struct GNUNET_CONTAINER_Heap * |
2538 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order); | 2531 | GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order); |
2539 | 2532 | ||
2540 | 2533 | ||
2541 | /** | 2534 | /** |
@@ -2546,7 +2539,7 @@ GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order); | |||
2546 | * @param heap heap to destroy | 2539 | * @param heap heap to destroy |
2547 | */ | 2540 | */ |
2548 | void | 2541 | void |
2549 | GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | 2542 | GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap); |
2550 | 2543 | ||
2551 | 2544 | ||
2552 | /** | 2545 | /** |
@@ -2557,7 +2550,7 @@ GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | |||
2557 | * @return Element at the root, or NULL if heap is empty. | 2550 | * @return Element at the root, or NULL if heap is empty. |
2558 | */ | 2551 | */ |
2559 | void * | 2552 | void * |
2560 | GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | 2553 | GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap); |
2561 | 2554 | ||
2562 | 2555 | ||
2563 | /** | 2556 | /** |
@@ -2570,9 +2563,9 @@ GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | |||
2570 | * #GNUNET_NO if the heap is empty. | 2563 | * #GNUNET_NO if the heap is empty. |
2571 | */ | 2564 | */ |
2572 | int | 2565 | int |
2573 | GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap, | 2566 | GNUNET_CONTAINER_heap_peek2(const struct GNUNET_CONTAINER_Heap *heap, |
2574 | void **element, | 2567 | void **element, |
2575 | GNUNET_CONTAINER_HeapCostType *cost); | 2568 | GNUNET_CONTAINER_HeapCostType *cost); |
2576 | 2569 | ||
2577 | 2570 | ||
2578 | /** | 2571 | /** |
@@ -2583,7 +2576,7 @@ GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap, | |||
2583 | * @return number of elements stored | 2576 | * @return number of elements stored |
2584 | */ | 2577 | */ |
2585 | unsigned int | 2578 | unsigned int |
2586 | GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); | 2579 | GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap); |
2587 | 2580 | ||
2588 | 2581 | ||
2589 | /** | 2582 | /** |
@@ -2594,7 +2587,7 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); | |||
2594 | * @return cost of the node | 2587 | * @return cost of the node |
2595 | */ | 2588 | */ |
2596 | GNUNET_CONTAINER_HeapCostType | 2589 | GNUNET_CONTAINER_HeapCostType |
2597 | GNUNET_CONTAINER_heap_node_get_cost ( | 2590 | GNUNET_CONTAINER_heap_node_get_cost( |
2598 | const struct GNUNET_CONTAINER_HeapNode *node); | 2591 | const struct GNUNET_CONTAINER_HeapNode *node); |
2599 | 2592 | ||
2600 | 2593 | ||
@@ -2625,9 +2618,9 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) ( | |||
2625 | * @param iterator_cls closure for @a iterator | 2618 | * @param iterator_cls closure for @a iterator |
2626 | */ | 2619 | */ |
2627 | void | 2620 | void |
2628 | GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | 2621 | GNUNET_CONTAINER_heap_iterate(const struct GNUNET_CONTAINER_Heap *heap, |
2629 | GNUNET_CONTAINER_HeapIterator iterator, | 2622 | GNUNET_CONTAINER_HeapIterator iterator, |
2630 | void *iterator_cls); | 2623 | void *iterator_cls); |
2631 | 2624 | ||
2632 | /** | 2625 | /** |
2633 | * @ingroup heap | 2626 | * @ingroup heap |
@@ -2642,7 +2635,7 @@ GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | |||
2642 | * NULL if the tree is empty. | 2635 | * NULL if the tree is empty. |
2643 | */ | 2636 | */ |
2644 | void * | 2637 | void * |
2645 | GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | 2638 | GNUNET_CONTAINER_heap_walk_get_next(struct GNUNET_CONTAINER_Heap *heap); |
2646 | 2639 | ||
2647 | 2640 | ||
2648 | /** | 2641 | /** |
@@ -2655,9 +2648,9 @@ GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | |||
2655 | * @return node for the new element | 2648 | * @return node for the new element |
2656 | */ | 2649 | */ |
2657 | struct GNUNET_CONTAINER_HeapNode * | 2650 | struct GNUNET_CONTAINER_HeapNode * |
2658 | GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, | 2651 | GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, |
2659 | void *element, | 2652 | void *element, |
2660 | GNUNET_CONTAINER_HeapCostType cost); | 2653 | GNUNET_CONTAINER_HeapCostType cost); |
2661 | 2654 | ||
2662 | 2655 | ||
2663 | /** | 2656 | /** |
@@ -2668,7 +2661,7 @@ GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, | |||
2668 | * @return element data stored at the root node | 2661 | * @return element data stored at the root node |
2669 | */ | 2662 | */ |
2670 | void * | 2663 | void * |
2671 | GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | 2664 | GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap); |
2672 | 2665 | ||
2673 | 2666 | ||
2674 | /** | 2667 | /** |
@@ -2679,7 +2672,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | |||
2679 | * @return element data stored at the node, NULL if heap is empty | 2672 | * @return element data stored at the node, NULL if heap is empty |
2680 | */ | 2673 | */ |
2681 | void * | 2674 | void * |
2682 | GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); | 2675 | GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node); |
2683 | 2676 | ||
2684 | 2677 | ||
2685 | /** | 2678 | /** |
@@ -2690,8 +2683,8 @@ GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); | |||
2690 | * @param new_cost new cost for the node | 2683 | * @param new_cost new cost for the node |
2691 | */ | 2684 | */ |
2692 | void | 2685 | void |
2693 | GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_HeapNode *node, | 2686 | GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, |
2694 | GNUNET_CONTAINER_HeapCostType new_cost); | 2687 | GNUNET_CONTAINER_HeapCostType new_cost); |
2695 | 2688 | ||
2696 | 2689 | ||
2697 | #if 0 /* keep Emacsens' auto-indent happy */ | 2690 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h index 64da5380e..a15e71f0d 100644 --- a/src/include/gnunet_conversation_service.h +++ b/src/include/gnunet_conversation_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2013, 2014, 2016 GNUnet e.V. | 3 | Copyright (C) 2013, 2014, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -53,7 +53,7 @@ | |||
53 | #ifdef __cplusplus | 53 | #ifdef __cplusplus |
54 | extern "C" | 54 | extern "C" |
55 | { | 55 | { |
56 | #if 0 /* keep Emacsens' auto-indent happy */ | 56 | #if 0 /* keep Emacsens' auto-indent happy */ |
57 | } | 57 | } |
58 | #endif | 58 | #endif |
59 | #endif | 59 | #endif |
@@ -86,9 +86,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
86 | * may also specify the phone line that is used (typically zero). | 86 | * may also specify the phone line that is used (typically zero). |
87 | * The version is also right now always zero. | 87 | * The version is also right now always zero. |
88 | */ | 88 | */ |
89 | struct GNUNET_CONVERSATION_PhoneRecord | 89 | struct GNUNET_CONVERSATION_PhoneRecord { |
90 | { | ||
91 | |||
92 | /** | 90 | /** |
93 | * Version of the phone record, for now always one. We may | 91 | * Version of the phone record, for now always one. We may |
94 | * use other versions for anonymously hosted phone lines in | 92 | * use other versions for anonymously hosted phone lines in |
@@ -110,7 +108,6 @@ struct GNUNET_CONVERSATION_PhoneRecord | |||
110 | * Phone line (CADET port) to connect to. | 108 | * Phone line (CADET port) to connect to. |
111 | */ | 109 | */ |
112 | struct GNUNET_HashCode line_port; | 110 | struct GNUNET_HashCode line_port; |
113 | |||
114 | }; | 111 | }; |
115 | 112 | ||
116 | GNUNET_NETWORK_STRUCT_END | 113 | GNUNET_NETWORK_STRUCT_END |
@@ -118,8 +115,7 @@ GNUNET_NETWORK_STRUCT_END | |||
118 | /** | 115 | /** |
119 | * Information about active callers to a phone. | 116 | * Information about active callers to a phone. |
120 | */ | 117 | */ |
121 | enum GNUNET_CONVERSATION_PhoneEventCode | 118 | enum GNUNET_CONVERSATION_PhoneEventCode { |
122 | { | ||
123 | /** | 119 | /** |
124 | * We are the callee and the phone is ringing. | 120 | * We are the callee and the phone is ringing. |
125 | * We should accept the call or hang up. | 121 | * We should accept the call or hang up. |
@@ -131,7 +127,6 @@ enum GNUNET_CONVERSATION_PhoneEventCode | |||
131 | * We must no longer use the caller's handle. | 127 | * We must no longer use the caller's handle. |
132 | */ | 128 | */ |
133 | GNUNET_CONVERSATION_EC_PHONE_HUNG_UP | 129 | GNUNET_CONVERSATION_EC_PHONE_HUNG_UP |
134 | |||
135 | }; | 130 | }; |
136 | 131 | ||
137 | 132 | ||
@@ -155,9 +150,7 @@ typedef void | |||
155 | * progresses from ring over ready to terminated. Steps may | 150 | * progresses from ring over ready to terminated. Steps may |
156 | * be skipped. | 151 | * be skipped. |
157 | */ | 152 | */ |
158 | enum GNUNET_CONVERSATION_CallerEventCode | 153 | enum GNUNET_CONVERSATION_CallerEventCode { |
159 | { | ||
160 | |||
161 | /** | 154 | /** |
162 | * We are the callee and the caller suspended the call. Note that | 155 | * We are the callee and the caller suspended the call. Note that |
163 | * both sides can independently suspend and resume calls; a call is | 156 | * both sides can independently suspend and resume calls; a call is |
@@ -171,7 +164,6 @@ enum GNUNET_CONVERSATION_CallerEventCode | |||
171 | * only "working" of both sides are active. | 164 | * only "working" of both sides are active. |
172 | */ | 165 | */ |
173 | GNUNET_CONVERSATION_EC_CALLER_RESUME | 166 | GNUNET_CONVERSATION_EC_CALLER_RESUME |
174 | |||
175 | }; | 167 | }; |
176 | 168 | ||
177 | 169 | ||
@@ -212,10 +204,10 @@ struct GNUNET_CONVERSATION_Phone; | |||
212 | * @param event_handler_cls closure for @a event_handler | 204 | * @param event_handler_cls closure for @a event_handler |
213 | */ | 205 | */ |
214 | struct GNUNET_CONVERSATION_Phone * | 206 | struct GNUNET_CONVERSATION_Phone * |
215 | GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 207 | GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
216 | const struct GNUNET_IDENTITY_Ego *ego, | 208 | const struct GNUNET_IDENTITY_Ego *ego, |
217 | GNUNET_CONVERSATION_PhoneEventHandler event_handler, | 209 | GNUNET_CONVERSATION_PhoneEventHandler event_handler, |
218 | void *event_handler_cls); | 210 | void *event_handler_cls); |
219 | 211 | ||
220 | 212 | ||
221 | /** | 213 | /** |
@@ -227,8 +219,8 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
227 | * @param rd namestore record to fill in | 219 | * @param rd namestore record to fill in |
228 | */ | 220 | */ |
229 | void | 221 | void |
230 | GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone, | 222 | GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, |
231 | struct GNUNET_GNSRECORD_Data *rd); | 223 | struct GNUNET_GNSRECORD_Data *rd); |
232 | 224 | ||
233 | 225 | ||
234 | /** | 226 | /** |
@@ -242,11 +234,11 @@ GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone, | |||
242 | * @param mic microphone to use | 234 | * @param mic microphone to use |
243 | */ | 235 | */ |
244 | void | 236 | void |
245 | GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller, | 237 | GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, |
246 | GNUNET_CONVERSATION_CallerEventHandler event_handler, | 238 | GNUNET_CONVERSATION_CallerEventHandler event_handler, |
247 | void *event_handler_cls, | 239 | void *event_handler_cls, |
248 | struct GNUNET_SPEAKER_Handle *speaker, | 240 | struct GNUNET_SPEAKER_Handle *speaker, |
249 | struct GNUNET_MICROPHONE_Handle *mic); | 241 | struct GNUNET_MICROPHONE_Handle *mic); |
250 | 242 | ||
251 | 243 | ||
252 | /** | 244 | /** |
@@ -257,7 +249,7 @@ GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller, | |||
257 | * @param caller call to suspend | 249 | * @param caller call to suspend |
258 | */ | 250 | */ |
259 | void | 251 | void |
260 | GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller); | 252 | GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller); |
261 | 253 | ||
262 | 254 | ||
263 | /** | 255 | /** |
@@ -268,9 +260,9 @@ GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller); | |||
268 | * @param mic microphone to use | 260 | * @param mic microphone to use |
269 | */ | 261 | */ |
270 | void | 262 | void |
271 | GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller, | 263 | GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, |
272 | struct GNUNET_SPEAKER_Handle *speaker, | 264 | struct GNUNET_SPEAKER_Handle *speaker, |
273 | struct GNUNET_MICROPHONE_Handle *mic); | 265 | struct GNUNET_MICROPHONE_Handle *mic); |
274 | 266 | ||
275 | 267 | ||
276 | /** | 268 | /** |
@@ -280,7 +272,7 @@ GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller, | |||
280 | * @param caller who should we hang up on | 272 | * @param caller who should we hang up on |
281 | */ | 273 | */ |
282 | void | 274 | void |
283 | GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller); | 275 | GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller); |
284 | 276 | ||
285 | 277 | ||
286 | /** | 278 | /** |
@@ -289,7 +281,7 @@ GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller); | |||
289 | * @param phone phone to destroy | 281 | * @param phone phone to destroy |
290 | */ | 282 | */ |
291 | void | 283 | void |
292 | GNUNET_CONVERSATION_phone_destroy (struct GNUNET_CONVERSATION_Phone *phone); | 284 | GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone); |
293 | 285 | ||
294 | 286 | ||
295 | /* *********************** CALL API ************************ */ | 287 | /* *********************** CALL API ************************ */ |
@@ -303,9 +295,7 @@ struct GNUNET_CONVERSATION_Call; | |||
303 | /** | 295 | /** |
304 | * Information about the current status of a call. | 296 | * Information about the current status of a call. |
305 | */ | 297 | */ |
306 | enum GNUNET_CONVERSATION_CallEventCode | 298 | enum GNUNET_CONVERSATION_CallEventCode { |
307 | { | ||
308 | |||
309 | /** | 299 | /** |
310 | * We are the caller and are now ringing the other party (GNS lookup | 300 | * We are the caller and are now ringing the other party (GNS lookup |
311 | * succeeded). | 301 | * succeeded). |
@@ -354,7 +344,6 @@ enum GNUNET_CONVERSATION_CallEventCode | |||
354 | * is restarted during a call. | 344 | * is restarted during a call. |
355 | */ | 345 | */ |
356 | GNUNET_CONVERSATION_EC_CALL_ERROR | 346 | GNUNET_CONVERSATION_EC_CALL_ERROR |
357 | |||
358 | }; | 347 | }; |
359 | 348 | ||
360 | 349 | ||
@@ -385,13 +374,13 @@ typedef void | |||
385 | * @return handle for the call | 374 | * @return handle for the call |
386 | */ | 375 | */ |
387 | struct GNUNET_CONVERSATION_Call * | 376 | struct GNUNET_CONVERSATION_Call * |
388 | GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 377 | GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
389 | struct GNUNET_IDENTITY_Ego *caller_id, | 378 | struct GNUNET_IDENTITY_Ego *caller_id, |
390 | const char *callee, | 379 | const char *callee, |
391 | struct GNUNET_SPEAKER_Handle *speaker, | 380 | struct GNUNET_SPEAKER_Handle *speaker, |
392 | struct GNUNET_MICROPHONE_Handle *mic, | 381 | struct GNUNET_MICROPHONE_Handle *mic, |
393 | GNUNET_CONVERSATION_CallEventHandler event_handler, | 382 | GNUNET_CONVERSATION_CallEventHandler event_handler, |
394 | void *event_handler_cls); | 383 | void *event_handler_cls); |
395 | 384 | ||
396 | 385 | ||
397 | /** | 386 | /** |
@@ -401,7 +390,7 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
401 | * @param call call to pause | 390 | * @param call call to pause |
402 | */ | 391 | */ |
403 | void | 392 | void |
404 | GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call); | 393 | GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call); |
405 | 394 | ||
406 | 395 | ||
407 | /** | 396 | /** |
@@ -412,9 +401,9 @@ GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call); | |||
412 | * @param mic microphone to use | 401 | * @param mic microphone to use |
413 | */ | 402 | */ |
414 | void | 403 | void |
415 | GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call, | 404 | GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call, |
416 | struct GNUNET_SPEAKER_Handle *speaker, | 405 | struct GNUNET_SPEAKER_Handle *speaker, |
417 | struct GNUNET_MICROPHONE_Handle *mic); | 406 | struct GNUNET_MICROPHONE_Handle *mic); |
418 | 407 | ||
419 | 408 | ||
420 | /** | 409 | /** |
@@ -423,10 +412,10 @@ GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call, | |||
423 | * @param call call to terminate | 412 | * @param call call to terminate |
424 | */ | 413 | */ |
425 | void | 414 | void |
426 | GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call); | 415 | GNUNET_CONVERSATION_call_stop(struct GNUNET_CONVERSATION_Call *call); |
427 | 416 | ||
428 | 417 | ||
429 | #if 0 /* keep Emacsens' auto-indent happy */ | 418 | #if 0 /* keep Emacsens' auto-indent happy */ |
430 | { | 419 | { |
431 | #endif | 420 | #endif |
432 | #ifdef __cplusplus | 421 | #ifdef __cplusplus |
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 111eb529d..4e6c48ee8 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -125,12 +125,12 @@ typedef void (*GNUNET_CORE_StartupCallback) ( | |||
125 | * NULL on error (in this case, init is never called) | 125 | * NULL on error (in this case, init is never called) |
126 | */ | 126 | */ |
127 | struct GNUNET_CORE_Handle * | 127 | struct GNUNET_CORE_Handle * |
128 | GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 128 | GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
129 | void *cls, | 129 | void *cls, |
130 | GNUNET_CORE_StartupCallback init, | 130 | GNUNET_CORE_StartupCallback init, |
131 | GNUNET_CORE_ConnectEventHandler connects, | 131 | GNUNET_CORE_ConnectEventHandler connects, |
132 | GNUNET_CORE_DisconnectEventHandler disconnects, | 132 | GNUNET_CORE_DisconnectEventHandler disconnects, |
133 | const struct GNUNET_MQ_MessageHandler *handlers); | 133 | const struct GNUNET_MQ_MessageHandler *handlers); |
134 | 134 | ||
135 | 135 | ||
136 | /** | 136 | /** |
@@ -139,7 +139,7 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
139 | * @param handle connection to core to disconnect | 139 | * @param handle connection to core to disconnect |
140 | */ | 140 | */ |
141 | void | 141 | void |
142 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | 142 | GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle); |
143 | 143 | ||
144 | 144 | ||
145 | /** | 145 | /** |
@@ -150,8 +150,8 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | |||
150 | * @return NULL if @a pid is not connected | 150 | * @return NULL if @a pid is not connected |
151 | */ | 151 | */ |
152 | struct GNUNET_MQ_Handle * | 152 | struct GNUNET_MQ_Handle * |
153 | GNUNET_CORE_get_mq (const struct GNUNET_CORE_Handle *h, | 153 | GNUNET_CORE_get_mq(const struct GNUNET_CORE_Handle *h, |
154 | const struct GNUNET_PeerIdentity *pid); | 154 | const struct GNUNET_PeerIdentity *pid); |
155 | 155 | ||
156 | 156 | ||
157 | /** | 157 | /** |
@@ -173,8 +173,7 @@ struct GNUNET_CORE_MonitorHandle; | |||
173 | * #GNUNET_CORE_KX_STATE_REKEY_SENT until the rekey operation is | 173 | * #GNUNET_CORE_KX_STATE_REKEY_SENT until the rekey operation is |
174 | * confirmed by a PONG from the other peer. | 174 | * confirmed by a PONG from the other peer. |
175 | */ | 175 | */ |
176 | enum GNUNET_CORE_KxState | 176 | enum GNUNET_CORE_KxState { |
177 | { | ||
178 | /** | 177 | /** |
179 | * No handshake yet. | 178 | * No handshake yet. |
180 | */ | 179 | */ |
@@ -228,7 +227,6 @@ enum GNUNET_CORE_KxState | |||
228 | * crashed and thus all connection state should be assumed lost. | 227 | * crashed and thus all connection state should be assumed lost. |
229 | */ | 228 | */ |
230 | GNUNET_CORE_KX_CORE_DISCONNECT | 229 | GNUNET_CORE_KX_CORE_DISCONNECT |
231 | |||
232 | }; | 230 | }; |
233 | 231 | ||
234 | 232 | ||
@@ -265,9 +263,9 @@ typedef void (*GNUNET_CORE_MonitorCallback) ( | |||
265 | * @return NULL on error | 263 | * @return NULL on error |
266 | */ | 264 | */ |
267 | struct GNUNET_CORE_MonitorHandle * | 265 | struct GNUNET_CORE_MonitorHandle * |
268 | GNUNET_CORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 266 | GNUNET_CORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
269 | GNUNET_CORE_MonitorCallback peer_cb, | 267 | GNUNET_CORE_MonitorCallback peer_cb, |
270 | void *peer_cb_cls); | 268 | void *peer_cb_cls); |
271 | 269 | ||
272 | 270 | ||
273 | /** | 271 | /** |
@@ -276,7 +274,7 @@ GNUNET_CORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
276 | * @param mh monitor to stop | 274 | * @param mh monitor to stop |
277 | */ | 275 | */ |
278 | void | 276 | void |
279 | GNUNET_CORE_monitor_stop (struct GNUNET_CORE_MonitorHandle *mh); | 277 | GNUNET_CORE_monitor_stop(struct GNUNET_CORE_MonitorHandle *mh); |
280 | 278 | ||
281 | 279 | ||
282 | /** | 280 | /** |
@@ -292,8 +290,8 @@ GNUNET_CORE_monitor_stop (struct GNUNET_CORE_MonitorHandle *mh); | |||
292 | * @return #GNUNET_YES if the peer is connected to us; #GNUNET_NO if not | 290 | * @return #GNUNET_YES if the peer is connected to us; #GNUNET_NO if not |
293 | */ | 291 | */ |
294 | int | 292 | int |
295 | GNUNET_CORE_is_peer_connected_sync (const struct GNUNET_CORE_Handle *h, | 293 | GNUNET_CORE_is_peer_connected_sync(const struct GNUNET_CORE_Handle *h, |
296 | const struct GNUNET_PeerIdentity *pid); | 294 | const struct GNUNET_PeerIdentity *pid); |
297 | 295 | ||
298 | 296 | ||
299 | /** | 297 | /** |
@@ -310,8 +308,8 @@ GNUNET_CORE_is_peer_connected_sync (const struct GNUNET_CORE_Handle *h, | |||
310 | * to the target peer | 308 | * to the target peer |
311 | */ | 309 | */ |
312 | struct GNUNET_MQ_Handle * | 310 | struct GNUNET_MQ_Handle * |
313 | GNUNET_CORE_mq_create (struct GNUNET_CORE_Handle *h, | 311 | GNUNET_CORE_mq_create(struct GNUNET_CORE_Handle *h, |
314 | const struct GNUNET_PeerIdentity *target); | 312 | const struct GNUNET_PeerIdentity *target); |
315 | 313 | ||
316 | 314 | ||
317 | #if 0 /* keep Emacsens' auto-indent happy */ | 315 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h index c925b0da8..9e1672ba3 100644 --- a/src/include/gnunet_credential_service.h +++ b/src/include/gnunet_credential_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -56,10 +56,9 @@ struct GNUNET_CREDENTIAL_Handle; | |||
56 | struct GNUNET_CREDENTIAL_Request; | 56 | struct GNUNET_CREDENTIAL_Request; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject | 59 | * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject |
60 | */ | 60 | */ |
61 | enum GNUNET_CREDENTIAL_CredentialFlags { | 61 | enum GNUNET_CREDENTIAL_CredentialFlags { |
62 | |||
63 | //Subject had credentials before, but have been revoked now | 62 | //Subject had credentials before, but have been revoked now |
64 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, | 63 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, |
65 | 64 | ||
@@ -68,7 +67,6 @@ enum GNUNET_CREDENTIAL_CredentialFlags { | |||
68 | 67 | ||
69 | //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance | 68 | //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance |
70 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 | 69 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 |
71 | |||
72 | }; | 70 | }; |
73 | 71 | ||
74 | GNUNET_NETWORK_STRUCT_BEGIN | 72 | GNUNET_NETWORK_STRUCT_BEGIN |
@@ -76,7 +74,6 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
76 | * The attribute delegation record | 74 | * The attribute delegation record |
77 | */ | 75 | */ |
78 | struct GNUNET_CREDENTIAL_DelegationRecord { | 76 | struct GNUNET_CREDENTIAL_DelegationRecord { |
79 | |||
80 | /** | 77 | /** |
81 | * Number of delegation sets in this record | 78 | * Number of delegation sets in this record |
82 | */ | 79 | */ |
@@ -96,7 +93,6 @@ struct GNUNET_CREDENTIAL_DelegationRecord { | |||
96 | * The attribute delegation record | 93 | * The attribute delegation record |
97 | */ | 94 | */ |
98 | struct GNUNET_CREDENTIAL_DelegationRecordSet { | 95 | struct GNUNET_CREDENTIAL_DelegationRecordSet { |
99 | |||
100 | /** | 96 | /** |
101 | * Public key of the subject this attribute was delegated to | 97 | * Public key of the subject this attribute was delegated to |
102 | */ | 98 | */ |
@@ -115,7 +111,6 @@ GNUNET_NETWORK_STRUCT_END | |||
115 | * The attribute delegation record | 111 | * The attribute delegation record |
116 | */ | 112 | */ |
117 | struct GNUNET_CREDENTIAL_DelegationSet { | 113 | struct GNUNET_CREDENTIAL_DelegationSet { |
118 | |||
119 | /** | 114 | /** |
120 | * Public key of the subject this attribute was delegated to | 115 | * Public key of the subject this attribute was delegated to |
121 | */ | 116 | */ |
@@ -134,7 +129,6 @@ struct GNUNET_CREDENTIAL_DelegationSet { | |||
134 | * A delegation | 129 | * A delegation |
135 | */ | 130 | */ |
136 | struct GNUNET_CREDENTIAL_Delegation { | 131 | struct GNUNET_CREDENTIAL_Delegation { |
137 | |||
138 | /** | 132 | /** |
139 | * The issuer of the delegation | 133 | * The issuer of the delegation |
140 | */ | 134 | */ |
@@ -171,7 +165,6 @@ struct GNUNET_CREDENTIAL_Delegation { | |||
171 | * A credential | 165 | * A credential |
172 | */ | 166 | */ |
173 | struct GNUNET_CREDENTIAL_Credential { | 167 | struct GNUNET_CREDENTIAL_Credential { |
174 | |||
175 | /** | 168 | /** |
176 | * The issuer of the credential | 169 | * The issuer of the credential |
177 | */ | 170 | */ |
@@ -201,7 +194,6 @@ struct GNUNET_CREDENTIAL_Credential { | |||
201 | * The attribute | 194 | * The attribute |
202 | */ | 195 | */ |
203 | const char *issuer_attribute; | 196 | const char *issuer_attribute; |
204 | |||
205 | }; | 197 | }; |
206 | 198 | ||
207 | 199 | ||
@@ -213,7 +205,7 @@ struct GNUNET_CREDENTIAL_Credential { | |||
213 | * @return handle to the Credential service, or NULL on error | 205 | * @return handle to the Credential service, or NULL on error |
214 | */ | 206 | */ |
215 | struct GNUNET_CREDENTIAL_Handle * | 207 | struct GNUNET_CREDENTIAL_Handle * |
216 | GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 208 | GNUNET_CREDENTIAL_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
217 | 209 | ||
218 | 210 | ||
219 | /** | 211 | /** |
@@ -222,7 +214,7 @@ GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
222 | * @param handle connection to shut down | 214 | * @param handle connection to shut down |
223 | */ | 215 | */ |
224 | void | 216 | void |
225 | GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); | 217 | GNUNET_CREDENTIAL_disconnect(struct GNUNET_CREDENTIAL_Handle *handle); |
226 | 218 | ||
227 | 219 | ||
228 | /** | 220 | /** |
@@ -235,10 +227,10 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); | |||
235 | * @param credential the credentials | 227 | * @param credential the credentials |
236 | */ | 228 | */ |
237 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, | 229 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, |
238 | unsigned int d_count, | 230 | unsigned int d_count, |
239 | struct GNUNET_CREDENTIAL_Delegation *delegation_chain, | 231 | struct GNUNET_CREDENTIAL_Delegation *delegation_chain, |
240 | unsigned int c_count, | 232 | unsigned int c_count, |
241 | struct GNUNET_CREDENTIAL_Credential *credential); | 233 | struct GNUNET_CREDENTIAL_Credential *credential); |
242 | 234 | ||
243 | /** | 235 | /** |
244 | * Iterator called on obtained result for an attribute delegation. | 236 | * Iterator called on obtained result for an attribute delegation. |
@@ -280,23 +272,23 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, | |||
280 | * @return handle to the queued request | 272 | * @return handle to the queued request |
281 | */ | 273 | */ |
282 | struct GNUNET_CREDENTIAL_Request* | 274 | struct GNUNET_CREDENTIAL_Request* |
283 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | 275 | GNUNET_CREDENTIAL_verify(struct GNUNET_CREDENTIAL_Handle *handle, |
276 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
277 | const char *issuer_attribute, | ||
278 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | ||
279 | uint32_t credential_count, | ||
280 | const struct GNUNET_CREDENTIAL_Credential *credentials, | ||
281 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | ||
282 | void *proc_cls); | ||
283 | |||
284 | struct GNUNET_CREDENTIAL_Request* | ||
285 | GNUNET_CREDENTIAL_collect(struct GNUNET_CREDENTIAL_Handle *handle, | ||
284 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 286 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, |
285 | const char *issuer_attribute, | 287 | const char *issuer_attribute, |
286 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | 288 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, |
287 | uint32_t credential_count, | ||
288 | const struct GNUNET_CREDENTIAL_Credential *credentials, | ||
289 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | 289 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, |
290 | void *proc_cls); | 290 | void *proc_cls); |
291 | 291 | ||
292 | struct GNUNET_CREDENTIAL_Request* | ||
293 | GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | ||
294 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
295 | const char *issuer_attribute, | ||
296 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, | ||
297 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | ||
298 | void *proc_cls); | ||
299 | |||
300 | /** | 292 | /** |
301 | * Delegate an attribute | 293 | * Delegate an attribute |
302 | * | 294 | * |
@@ -310,13 +302,13 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
310 | * @return handle to the queued request | 302 | * @return handle to the queued request |
311 | */ | 303 | */ |
312 | struct GNUNET_CREDENTIAL_Request * | 304 | struct GNUNET_CREDENTIAL_Request * |
313 | GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | 305 | GNUNET_CREDENTIAL_add_delegation(struct GNUNET_CREDENTIAL_Handle *handle, |
314 | struct GNUNET_IDENTITY_Ego *issuer, | 306 | struct GNUNET_IDENTITY_Ego *issuer, |
315 | const char *attribute, | 307 | const char *attribute, |
316 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 308 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
317 | const char *delegated_attribute, | 309 | const char *delegated_attribute, |
318 | GNUNET_CREDENTIAL_DelegateResultProcessor proc, | 310 | GNUNET_CREDENTIAL_DelegateResultProcessor proc, |
319 | void *proc_cls); | 311 | void *proc_cls); |
320 | 312 | ||
321 | /** | 313 | /** |
322 | * Remove a delegation | 314 | * Remove a delegation |
@@ -329,11 +321,11 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
329 | * @return handle to the queued request | 321 | * @return handle to the queued request |
330 | */ | 322 | */ |
331 | struct GNUNET_CREDENTIAL_Request * | 323 | struct GNUNET_CREDENTIAL_Request * |
332 | GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | 324 | GNUNET_CREDENTIAL_remove_delegation(struct GNUNET_CREDENTIAL_Handle *handle, |
333 | struct GNUNET_IDENTITY_Ego *issuer, | 325 | struct GNUNET_IDENTITY_Ego *issuer, |
334 | const char *attribute, | 326 | const char *attribute, |
335 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, | 327 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, |
336 | void *proc_cls); | 328 | void *proc_cls); |
337 | 329 | ||
338 | 330 | ||
339 | 331 | ||
@@ -347,10 +339,10 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
347 | * @return handle to the queued request | 339 | * @return handle to the queued request |
348 | */ | 340 | */ |
349 | struct GNUNET_CREDENTIAL_Credential* | 341 | struct GNUNET_CREDENTIAL_Credential* |
350 | GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | 342 | GNUNET_CREDENTIAL_credential_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, |
351 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 343 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
352 | const char *attribute, | 344 | const char *attribute, |
353 | struct GNUNET_TIME_Absolute *expiration); | 345 | struct GNUNET_TIME_Absolute *expiration); |
354 | 346 | ||
355 | 347 | ||
356 | 348 | ||
@@ -360,7 +352,7 @@ GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey * | |||
360 | * @param lr the lookup request to cancel | 352 | * @param lr the lookup request to cancel |
361 | */ | 353 | */ |
362 | void | 354 | void |
363 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr); | 355 | GNUNET_CREDENTIAL_request_cancel(struct GNUNET_CREDENTIAL_Request *lr); |
364 | 356 | ||
365 | 357 | ||
366 | #if 0 /* keep Emacsens' auto-indent happy */ | 358 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 140a1b48c..6e347c52b 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_crypto_lib.h | 22 | * @file include/gnunet_crypto_lib.h |
@@ -71,8 +71,7 @@ struct GNUNET_PeerIdentity; | |||
71 | * Desired quality level for random numbers. | 71 | * Desired quality level for random numbers. |
72 | * @ingroup crypto | 72 | * @ingroup crypto |
73 | */ | 73 | */ |
74 | enum GNUNET_CRYPTO_Quality | 74 | enum GNUNET_CRYPTO_Quality { |
75 | { | ||
76 | /** | 75 | /** |
77 | * No good quality of the operation is needed (i.e., | 76 | * No good quality of the operation is needed (i.e., |
78 | * random numbers can be pseudo-random). | 77 | * random numbers can be pseudo-random). |
@@ -113,8 +112,7 @@ enum GNUNET_CRYPTO_Quality | |||
113 | /** | 112 | /** |
114 | * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode. | 113 | * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode. |
115 | */ | 114 | */ |
116 | struct GNUNET_CRYPTO_HashAsciiEncoded | 115 | struct GNUNET_CRYPTO_HashAsciiEncoded { |
117 | { | ||
118 | unsigned char encoding[104]; | 116 | unsigned char encoding[104]; |
119 | }; | 117 | }; |
120 | 118 | ||
@@ -127,8 +125,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
127 | * this must be followed by "size - 8" bytes of | 125 | * this must be followed by "size - 8" bytes of |
128 | * the actual signed data | 126 | * the actual signed data |
129 | */ | 127 | */ |
130 | struct GNUNET_CRYPTO_EccSignaturePurpose | 128 | struct GNUNET_CRYPTO_EccSignaturePurpose { |
131 | { | ||
132 | /** | 129 | /** |
133 | * How many bytes does this signature sign? | 130 | * How many bytes does this signature sign? |
134 | * (including this purpose header); in network | 131 | * (including this purpose header); in network |
@@ -150,9 +147,7 @@ struct GNUNET_CRYPTO_EccSignaturePurpose | |||
150 | * @brief an ECC signature using EdDSA. | 147 | * @brief an ECC signature using EdDSA. |
151 | * See cr.yp.to/papers.html#ed25519 | 148 | * See cr.yp.to/papers.html#ed25519 |
152 | */ | 149 | */ |
153 | struct GNUNET_CRYPTO_EddsaSignature | 150 | struct GNUNET_CRYPTO_EddsaSignature { |
154 | { | ||
155 | |||
156 | /** | 151 | /** |
157 | * R value. | 152 | * R value. |
158 | */ | 153 | */ |
@@ -168,9 +163,7 @@ struct GNUNET_CRYPTO_EddsaSignature | |||
168 | /** | 163 | /** |
169 | * @brief an ECC signature using ECDSA | 164 | * @brief an ECC signature using ECDSA |
170 | */ | 165 | */ |
171 | struct GNUNET_CRYPTO_EcdsaSignature | 166 | struct GNUNET_CRYPTO_EcdsaSignature { |
172 | { | ||
173 | |||
174 | /** | 167 | /** |
175 | * R value. | 168 | * R value. |
176 | */ | 169 | */ |
@@ -187,8 +180,7 @@ struct GNUNET_CRYPTO_EcdsaSignature | |||
187 | * Public ECC key (always for curve Ed25519) encoded in a format | 180 | * Public ECC key (always for curve Ed25519) encoded in a format |
188 | * suitable for network transmission and EdDSA signatures. | 181 | * suitable for network transmission and EdDSA signatures. |
189 | */ | 182 | */ |
190 | struct GNUNET_CRYPTO_EddsaPublicKey | 183 | struct GNUNET_CRYPTO_EddsaPublicKey { |
191 | { | ||
192 | /** | 184 | /** |
193 | * Point Q consists of a y-value mod p (256 bits); the x-value is | 185 | * Point Q consists of a y-value mod p (256 bits); the x-value is |
194 | * always positive. The point is stored in Ed25519 standard | 186 | * always positive. The point is stored in Ed25519 standard |
@@ -202,8 +194,7 @@ struct GNUNET_CRYPTO_EddsaPublicKey | |||
202 | * Public ECC key (always for Curve25519) encoded in a format suitable | 194 | * Public ECC key (always for Curve25519) encoded in a format suitable |
203 | * for network transmission and ECDSA signatures. | 195 | * for network transmission and ECDSA signatures. |
204 | */ | 196 | */ |
205 | struct GNUNET_CRYPTO_EcdsaPublicKey | 197 | struct GNUNET_CRYPTO_EcdsaPublicKey { |
206 | { | ||
207 | /** | 198 | /** |
208 | * Q consists of an x- and a y-value, each mod p (256 bits), given | 199 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
209 | * here in affine coordinates and Ed25519 standard compact format. | 200 | * here in affine coordinates and Ed25519 standard compact format. |
@@ -215,8 +206,7 @@ struct GNUNET_CRYPTO_EcdsaPublicKey | |||
215 | /** | 206 | /** |
216 | * The identity of the host (wraps the signing key of the peer). | 207 | * The identity of the host (wraps the signing key of the peer). |
217 | */ | 208 | */ |
218 | struct GNUNET_PeerIdentity | 209 | struct GNUNET_PeerIdentity { |
219 | { | ||
220 | struct GNUNET_CRYPTO_EddsaPublicKey public_key; | 210 | struct GNUNET_CRYPTO_EddsaPublicKey public_key; |
221 | }; | 211 | }; |
222 | 212 | ||
@@ -226,8 +216,7 @@ struct GNUNET_PeerIdentity | |||
226 | * for network transmission and encryption (ECDH), | 216 | * for network transmission and encryption (ECDH), |
227 | * See http://cr.yp.to/ecdh.html | 217 | * See http://cr.yp.to/ecdh.html |
228 | */ | 218 | */ |
229 | struct GNUNET_CRYPTO_EcdhePublicKey | 219 | struct GNUNET_CRYPTO_EcdhePublicKey { |
230 | { | ||
231 | /** | 220 | /** |
232 | * Q consists of an x- and a y-value, each mod p (256 bits), given | 221 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
233 | * here in affine coordinates and Ed25519 standard compact format. | 222 | * here in affine coordinates and Ed25519 standard compact format. |
@@ -240,8 +229,7 @@ struct GNUNET_CRYPTO_EcdhePublicKey | |||
240 | * Private ECC key encoded for transmission. To be used only for ECDH | 229 | * Private ECC key encoded for transmission. To be used only for ECDH |
241 | * key exchange (ECDHE to be precise). | 230 | * key exchange (ECDHE to be precise). |
242 | */ | 231 | */ |
243 | struct GNUNET_CRYPTO_EcdhePrivateKey | 232 | struct GNUNET_CRYPTO_EcdhePrivateKey { |
244 | { | ||
245 | /** | 233 | /** |
246 | * d is a value mod n, where n has at most 256 bits. | 234 | * d is a value mod n, where n has at most 256 bits. |
247 | */ | 235 | */ |
@@ -252,8 +240,7 @@ struct GNUNET_CRYPTO_EcdhePrivateKey | |||
252 | * Private ECC key encoded for transmission. To be used only for ECDSA | 240 | * Private ECC key encoded for transmission. To be used only for ECDSA |
253 | * signatures. | 241 | * signatures. |
254 | */ | 242 | */ |
255 | struct GNUNET_CRYPTO_EcdsaPrivateKey | 243 | struct GNUNET_CRYPTO_EcdsaPrivateKey { |
256 | { | ||
257 | /** | 244 | /** |
258 | * d is a value mod n, where n has at most 256 bits. | 245 | * d is a value mod n, where n has at most 256 bits. |
259 | */ | 246 | */ |
@@ -264,8 +251,7 @@ struct GNUNET_CRYPTO_EcdsaPrivateKey | |||
264 | * Private ECC key encoded for transmission. To be used only for EdDSA | 251 | * Private ECC key encoded for transmission. To be used only for EdDSA |
265 | * signatures. | 252 | * signatures. |
266 | */ | 253 | */ |
267 | struct GNUNET_CRYPTO_EddsaPrivateKey | 254 | struct GNUNET_CRYPTO_EddsaPrivateKey { |
268 | { | ||
269 | /** | 255 | /** |
270 | * d is a value mod n, where n has at most 256 bits. | 256 | * d is a value mod n, where n has at most 256 bits. |
271 | */ | 257 | */ |
@@ -276,8 +262,7 @@ struct GNUNET_CRYPTO_EddsaPrivateKey | |||
276 | /** | 262 | /** |
277 | * @brief type for session keys | 263 | * @brief type for session keys |
278 | */ | 264 | */ |
279 | struct GNUNET_CRYPTO_SymmetricSessionKey | 265 | struct GNUNET_CRYPTO_SymmetricSessionKey { |
280 | { | ||
281 | /** | 266 | /** |
282 | * Actual key for AES. | 267 | * Actual key for AES. |
283 | */ | 268 | */ |
@@ -297,8 +282,7 @@ GNUNET_NETWORK_STRUCT_END | |||
297 | * NOTE: must be smaller (!) in size than the | 282 | * NOTE: must be smaller (!) in size than the |
298 | * `struct GNUNET_HashCode`. | 283 | * `struct GNUNET_HashCode`. |
299 | */ | 284 | */ |
300 | struct GNUNET_CRYPTO_SymmetricInitializationVector | 285 | struct GNUNET_CRYPTO_SymmetricInitializationVector { |
301 | { | ||
302 | unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; | 286 | unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; |
303 | 287 | ||
304 | unsigned char twofish_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; | 288 | unsigned char twofish_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; |
@@ -308,8 +292,7 @@ struct GNUNET_CRYPTO_SymmetricInitializationVector | |||
308 | /** | 292 | /** |
309 | * @brief type for (message) authentication keys | 293 | * @brief type for (message) authentication keys |
310 | */ | 294 | */ |
311 | struct GNUNET_CRYPTO_AuthKey | 295 | struct GNUNET_CRYPTO_AuthKey { |
312 | { | ||
313 | unsigned char key[GNUNET_CRYPTO_HASH_LENGTH]; | 296 | unsigned char key[GNUNET_CRYPTO_HASH_LENGTH]; |
314 | }; | 297 | }; |
315 | 298 | ||
@@ -324,8 +307,7 @@ struct GNUNET_CRYPTO_AuthKey | |||
324 | /** | 307 | /** |
325 | * Paillier public key. | 308 | * Paillier public key. |
326 | */ | 309 | */ |
327 | struct GNUNET_CRYPTO_PaillierPublicKey | 310 | struct GNUNET_CRYPTO_PaillierPublicKey { |
328 | { | ||
329 | /** | 311 | /** |
330 | * N value. | 312 | * N value. |
331 | */ | 313 | */ |
@@ -336,8 +318,7 @@ struct GNUNET_CRYPTO_PaillierPublicKey | |||
336 | /** | 318 | /** |
337 | * Paillier private key. | 319 | * Paillier private key. |
338 | */ | 320 | */ |
339 | struct GNUNET_CRYPTO_PaillierPrivateKey | 321 | struct GNUNET_CRYPTO_PaillierPrivateKey { |
340 | { | ||
341 | /** | 322 | /** |
342 | * Lambda-component of the private key. | 323 | * Lambda-component of the private key. |
343 | */ | 324 | */ |
@@ -352,8 +333,7 @@ struct GNUNET_CRYPTO_PaillierPrivateKey | |||
352 | /** | 333 | /** |
353 | * Paillier ciphertext. | 334 | * Paillier ciphertext. |
354 | */ | 335 | */ |
355 | struct GNUNET_CRYPTO_PaillierCiphertext | 336 | struct GNUNET_CRYPTO_PaillierCiphertext { |
356 | { | ||
357 | /** | 337 | /** |
358 | * Guaranteed minimum number of homomorphic operations with this ciphertext, | 338 | * Guaranteed minimum number of homomorphic operations with this ciphertext, |
359 | * in network byte order (NBO). | 339 | * in network byte order (NBO). |
@@ -377,7 +357,7 @@ struct GNUNET_CRYPTO_PaillierCiphertext | |||
377 | * @param seed the seed to use | 357 | * @param seed the seed to use |
378 | */ | 358 | */ |
379 | void | 359 | void |
380 | GNUNET_CRYPTO_seed_weak_random (int32_t seed); | 360 | GNUNET_CRYPTO_seed_weak_random(int32_t seed); |
381 | 361 | ||
382 | 362 | ||
383 | /** | 363 | /** |
@@ -389,7 +369,7 @@ GNUNET_CRYPTO_seed_weak_random (int32_t seed); | |||
389 | * @return crc8 value | 369 | * @return crc8 value |
390 | */ | 370 | */ |
391 | uint8_t | 371 | uint8_t |
392 | GNUNET_CRYPTO_crc8_n (const void *buf, size_t len); | 372 | GNUNET_CRYPTO_crc8_n(const void *buf, size_t len); |
393 | 373 | ||
394 | 374 | ||
395 | /** | 375 | /** |
@@ -401,7 +381,7 @@ GNUNET_CRYPTO_crc8_n (const void *buf, size_t len); | |||
401 | * @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish to get actual crc16) | 381 | * @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish to get actual crc16) |
402 | */ | 382 | */ |
403 | uint32_t | 383 | uint32_t |
404 | GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len); | 384 | GNUNET_CRYPTO_crc16_step(uint32_t sum, const void *buf, size_t len); |
405 | 385 | ||
406 | 386 | ||
407 | /** | 387 | /** |
@@ -411,7 +391,7 @@ GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len); | |||
411 | * @return crc16 value | 391 | * @return crc16 value |
412 | */ | 392 | */ |
413 | uint16_t | 393 | uint16_t |
414 | GNUNET_CRYPTO_crc16_finish (uint32_t sum); | 394 | GNUNET_CRYPTO_crc16_finish(uint32_t sum); |
415 | 395 | ||
416 | 396 | ||
417 | /** | 397 | /** |
@@ -423,7 +403,7 @@ GNUNET_CRYPTO_crc16_finish (uint32_t sum); | |||
423 | * @return crc16 value | 403 | * @return crc16 value |
424 | */ | 404 | */ |
425 | uint16_t | 405 | uint16_t |
426 | GNUNET_CRYPTO_crc16_n (const void *buf, size_t len); | 406 | GNUNET_CRYPTO_crc16_n(const void *buf, size_t len); |
427 | 407 | ||
428 | 408 | ||
429 | /** | 409 | /** |
@@ -436,7 +416,7 @@ GNUNET_CRYPTO_crc16_n (const void *buf, size_t len); | |||
436 | * @return the resulting CRC32 checksum | 416 | * @return the resulting CRC32 checksum |
437 | */ | 417 | */ |
438 | int32_t | 418 | int32_t |
439 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | 419 | GNUNET_CRYPTO_crc32_n(const void *buf, size_t len); |
440 | 420 | ||
441 | /** | 421 | /** |
442 | * @ingroup crypto | 422 | * @ingroup crypto |
@@ -447,7 +427,7 @@ GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | |||
447 | * @param length buffer length | 427 | * @param length buffer length |
448 | */ | 428 | */ |
449 | void | 429 | void |
450 | GNUNET_CRYPTO_zero_keys (void *buffer, size_t length); | 430 | GNUNET_CRYPTO_zero_keys(void *buffer, size_t length); |
451 | 431 | ||
452 | 432 | ||
453 | /** | 433 | /** |
@@ -459,9 +439,9 @@ GNUNET_CRYPTO_zero_keys (void *buffer, size_t length); | |||
459 | * @param length buffer length | 439 | * @param length buffer length |
460 | */ | 440 | */ |
461 | void | 441 | void |
462 | GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode, | 442 | GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, |
463 | void *buffer, | 443 | void *buffer, |
464 | size_t length); | 444 | size_t length); |
465 | 445 | ||
466 | /** | 446 | /** |
467 | * @ingroup crypto | 447 | * @ingroup crypto |
@@ -472,7 +452,7 @@ GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode, | |||
472 | * @return a random value in the interval [0,@a i) (exclusive). | 452 | * @return a random value in the interval [0,@a i) (exclusive). |
473 | */ | 453 | */ |
474 | uint32_t | 454 | uint32_t |
475 | GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | 455 | GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i); |
476 | 456 | ||
477 | 457 | ||
478 | /** | 458 | /** |
@@ -484,7 +464,7 @@ GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | |||
484 | * @return random 64-bit number | 464 | * @return random 64-bit number |
485 | */ | 465 | */ |
486 | uint64_t | 466 | uint64_t |
487 | GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max); | 467 | GNUNET_CRYPTO_random_u64(enum GNUNET_CRYPTO_Quality mode, uint64_t max); |
488 | 468 | ||
489 | 469 | ||
490 | /** | 470 | /** |
@@ -497,7 +477,7 @@ GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max); | |||
497 | * @return the permutation array (allocated from heap) | 477 | * @return the permutation array (allocated from heap) |
498 | */ | 478 | */ |
499 | unsigned int * | 479 | unsigned int * |
500 | GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n); | 480 | GNUNET_CRYPTO_random_permute(enum GNUNET_CRYPTO_Quality mode, unsigned int n); |
501 | 481 | ||
502 | 482 | ||
503 | /** | 483 | /** |
@@ -507,7 +487,7 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n); | |||
507 | * @param key key to initialize | 487 | * @param key key to initialize |
508 | */ | 488 | */ |
509 | void | 489 | void |
510 | GNUNET_CRYPTO_symmetric_create_session_key ( | 490 | GNUNET_CRYPTO_symmetric_create_session_key( |
511 | struct GNUNET_CRYPTO_SymmetricSessionKey *key); | 491 | struct GNUNET_CRYPTO_SymmetricSessionKey *key); |
512 | 492 | ||
513 | 493 | ||
@@ -523,7 +503,7 @@ GNUNET_CRYPTO_symmetric_create_session_key ( | |||
523 | * @return the size of the encrypted block, -1 for errors | 503 | * @return the size of the encrypted block, -1 for errors |
524 | */ | 504 | */ |
525 | ssize_t | 505 | ssize_t |
526 | GNUNET_CRYPTO_symmetric_encrypt ( | 506 | GNUNET_CRYPTO_symmetric_encrypt( |
527 | const void *block, | 507 | const void *block, |
528 | size_t size, | 508 | size_t size, |
529 | const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, | 509 | const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, |
@@ -543,7 +523,7 @@ GNUNET_CRYPTO_symmetric_encrypt ( | |||
543 | * @return -1 on failure, size of decrypted block on success | 523 | * @return -1 on failure, size of decrypted block on success |
544 | */ | 524 | */ |
545 | ssize_t | 525 | ssize_t |
546 | GNUNET_CRYPTO_symmetric_decrypt ( | 526 | GNUNET_CRYPTO_symmetric_decrypt( |
547 | const void *block, | 527 | const void *block, |
548 | size_t size, | 528 | size_t size, |
549 | const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, | 529 | const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, |
@@ -561,7 +541,7 @@ GNUNET_CRYPTO_symmetric_decrypt ( | |||
561 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL | 541 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL |
562 | */ | 542 | */ |
563 | void | 543 | void |
564 | GNUNET_CRYPTO_symmetric_derive_iv ( | 544 | GNUNET_CRYPTO_symmetric_derive_iv( |
565 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | 545 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
566 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | 546 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, |
567 | const void *salt, | 547 | const void *salt, |
@@ -578,7 +558,7 @@ GNUNET_CRYPTO_symmetric_derive_iv ( | |||
578 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL | 558 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL |
579 | */ | 559 | */ |
580 | void | 560 | void |
581 | GNUNET_CRYPTO_symmetric_derive_iv_v ( | 561 | GNUNET_CRYPTO_symmetric_derive_iv_v( |
582 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | 562 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
583 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | 563 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, |
584 | const void *salt, | 564 | const void *salt, |
@@ -594,8 +574,8 @@ GNUNET_CRYPTO_symmetric_derive_iv_v ( | |||
594 | * safely cast to char*, a '\\0' termination is set). | 574 | * safely cast to char*, a '\\0' termination is set). |
595 | */ | 575 | */ |
596 | void | 576 | void |
597 | GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block, | 577 | GNUNET_CRYPTO_hash_to_enc(const struct GNUNET_HashCode *block, |
598 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); | 578 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); |
599 | 579 | ||
600 | 580 | ||
601 | /** | 581 | /** |
@@ -608,9 +588,9 @@ GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block, | |||
608 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding | 588 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding |
609 | */ | 589 | */ |
610 | int | 590 | int |
611 | GNUNET_CRYPTO_hash_from_string2 (const char *enc, | 591 | GNUNET_CRYPTO_hash_from_string2(const char *enc, |
612 | size_t enclen, | 592 | size_t enclen, |
613 | struct GNUNET_HashCode *result); | 593 | struct GNUNET_HashCode *result); |
614 | 594 | ||
615 | 595 | ||
616 | /** | 596 | /** |
@@ -622,7 +602,7 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, | |||
622 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding | 602 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding |
623 | */ | 603 | */ |
624 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ | 604 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ |
625 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result) | 605 | GNUNET_CRYPTO_hash_from_string2(enc, strlen(enc), result) |
626 | 606 | ||
627 | 607 | ||
628 | /** | 608 | /** |
@@ -638,8 +618,8 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, | |||
638 | * @return number between 0 and UINT32_MAX | 618 | * @return number between 0 and UINT32_MAX |
639 | */ | 619 | */ |
640 | uint32_t | 620 | uint32_t |
641 | GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a, | 621 | GNUNET_CRYPTO_hash_distance_u32(const struct GNUNET_HashCode *a, |
642 | const struct GNUNET_HashCode *b); | 622 | const struct GNUNET_HashCode *b); |
643 | 623 | ||
644 | 624 | ||
645 | /** | 625 | /** |
@@ -651,9 +631,9 @@ GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a, | |||
651 | * @param ret pointer to where to write the hashcode | 631 | * @param ret pointer to where to write the hashcode |
652 | */ | 632 | */ |
653 | void | 633 | void |
654 | GNUNET_CRYPTO_hash (const void *block, | 634 | GNUNET_CRYPTO_hash(const void *block, |
655 | size_t size, | 635 | size_t size, |
656 | struct GNUNET_HashCode *ret); | 636 | struct GNUNET_HashCode *ret); |
657 | 637 | ||
658 | 638 | ||
659 | /** | 639 | /** |
@@ -668,7 +648,7 @@ struct GNUNET_HashContext; | |||
668 | * @return context for incremental hash computation | 648 | * @return context for incremental hash computation |
669 | */ | 649 | */ |
670 | struct GNUNET_HashContext * | 650 | struct GNUNET_HashContext * |
671 | GNUNET_CRYPTO_hash_context_start (void); | 651 | GNUNET_CRYPTO_hash_context_start(void); |
672 | 652 | ||
673 | 653 | ||
674 | /** | 654 | /** |
@@ -679,9 +659,9 @@ GNUNET_CRYPTO_hash_context_start (void); | |||
679 | * @param size number of bytes in @a buf | 659 | * @param size number of bytes in @a buf |
680 | */ | 660 | */ |
681 | void | 661 | void |
682 | GNUNET_CRYPTO_hash_context_read (struct GNUNET_HashContext *hc, | 662 | GNUNET_CRYPTO_hash_context_read(struct GNUNET_HashContext *hc, |
683 | const void *buf, | 663 | const void *buf, |
684 | size_t size); | 664 | size_t size); |
685 | 665 | ||
686 | 666 | ||
687 | /** | 667 | /** |
@@ -691,8 +671,8 @@ GNUNET_CRYPTO_hash_context_read (struct GNUNET_HashContext *hc, | |||
691 | * @param r_hash where to write the latest / final hash code | 671 | * @param r_hash where to write the latest / final hash code |
692 | */ | 672 | */ |
693 | void | 673 | void |
694 | GNUNET_CRYPTO_hash_context_finish (struct GNUNET_HashContext *hc, | 674 | GNUNET_CRYPTO_hash_context_finish(struct GNUNET_HashContext *hc, |
695 | struct GNUNET_HashCode *r_hash); | 675 | struct GNUNET_HashCode *r_hash); |
696 | 676 | ||
697 | 677 | ||
698 | /** | 678 | /** |
@@ -701,7 +681,7 @@ GNUNET_CRYPTO_hash_context_finish (struct GNUNET_HashContext *hc, | |||
701 | * @param hc hash context to destroy | 681 | * @param hc hash context to destroy |
702 | */ | 682 | */ |
703 | void | 683 | void |
704 | GNUNET_CRYPTO_hash_context_abort (struct GNUNET_HashContext *hc); | 684 | GNUNET_CRYPTO_hash_context_abort(struct GNUNET_HashContext *hc); |
705 | 685 | ||
706 | 686 | ||
707 | /** | 687 | /** |
@@ -716,11 +696,11 @@ GNUNET_CRYPTO_hash_context_abort (struct GNUNET_HashContext *hc); | |||
716 | * @param hmac where to store the hmac | 696 | * @param hmac where to store the hmac |
717 | */ | 697 | */ |
718 | void | 698 | void |
719 | GNUNET_CRYPTO_hmac_raw (const void *key, | 699 | GNUNET_CRYPTO_hmac_raw(const void *key, |
720 | size_t key_len, | 700 | size_t key_len, |
721 | const void *plaintext, | 701 | const void *plaintext, |
722 | size_t plaintext_len, | 702 | size_t plaintext_len, |
723 | struct GNUNET_HashCode *hmac); | 703 | struct GNUNET_HashCode *hmac); |
724 | 704 | ||
725 | 705 | ||
726 | /** | 706 | /** |
@@ -733,10 +713,10 @@ GNUNET_CRYPTO_hmac_raw (const void *key, | |||
733 | * @param hmac where to store the hmac | 713 | * @param hmac where to store the hmac |
734 | */ | 714 | */ |
735 | void | 715 | void |
736 | GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, | 716 | GNUNET_CRYPTO_hmac(const struct GNUNET_CRYPTO_AuthKey *key, |
737 | const void *plaintext, | 717 | const void *plaintext, |
738 | size_t plaintext_len, | 718 | size_t plaintext_len, |
739 | struct GNUNET_HashCode *hmac); | 719 | struct GNUNET_HashCode *hmac); |
740 | 720 | ||
741 | 721 | ||
742 | /** | 722 | /** |
@@ -769,11 +749,11 @@ struct GNUNET_CRYPTO_FileHashContext; | |||
769 | * @return NULL on (immediate) errror | 749 | * @return NULL on (immediate) errror |
770 | */ | 750 | */ |
771 | struct GNUNET_CRYPTO_FileHashContext * | 751 | struct GNUNET_CRYPTO_FileHashContext * |
772 | GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, | 752 | GNUNET_CRYPTO_hash_file(enum GNUNET_SCHEDULER_Priority priority, |
773 | const char *filename, | 753 | const char *filename, |
774 | size_t blocksize, | 754 | size_t blocksize, |
775 | GNUNET_CRYPTO_HashCompletedCallback callback, | 755 | GNUNET_CRYPTO_HashCompletedCallback callback, |
776 | void *callback_cls); | 756 | void *callback_cls); |
777 | 757 | ||
778 | 758 | ||
779 | /** | 759 | /** |
@@ -782,7 +762,7 @@ GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, | |||
782 | * @param fhc operation to cancel (callback must not yet have been invoked) | 762 | * @param fhc operation to cancel (callback must not yet have been invoked) |
783 | */ | 763 | */ |
784 | void | 764 | void |
785 | GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | 765 | GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc); |
786 | 766 | ||
787 | 767 | ||
788 | /** | 768 | /** |
@@ -793,8 +773,8 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | |||
793 | * @param result hash code that is randomized | 773 | * @param result hash code that is randomized |
794 | */ | 774 | */ |
795 | void | 775 | void |
796 | GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | 776 | GNUNET_CRYPTO_hash_create_random(enum GNUNET_CRYPTO_Quality mode, |
797 | struct GNUNET_HashCode *result); | 777 | struct GNUNET_HashCode *result); |
798 | 778 | ||
799 | 779 | ||
800 | /** | 780 | /** |
@@ -806,9 +786,9 @@ GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | |||
806 | * @param result set to @a b - @a a | 786 | * @param result set to @a b - @a a |
807 | */ | 787 | */ |
808 | void | 788 | void |
809 | GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a, | 789 | GNUNET_CRYPTO_hash_difference(const struct GNUNET_HashCode *a, |
810 | const struct GNUNET_HashCode *b, | 790 | const struct GNUNET_HashCode *b, |
811 | struct GNUNET_HashCode *result); | 791 | struct GNUNET_HashCode *result); |
812 | 792 | ||
813 | 793 | ||
814 | /** | 794 | /** |
@@ -820,9 +800,9 @@ GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a, | |||
820 | * @param result set to @a a + @a delta | 800 | * @param result set to @a a + @a delta |
821 | */ | 801 | */ |
822 | void | 802 | void |
823 | GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a, | 803 | GNUNET_CRYPTO_hash_sum(const struct GNUNET_HashCode *a, |
824 | const struct GNUNET_HashCode *delta, | 804 | const struct GNUNET_HashCode *delta, |
825 | struct GNUNET_HashCode *result); | 805 | struct GNUNET_HashCode *result); |
826 | 806 | ||
827 | 807 | ||
828 | /** | 808 | /** |
@@ -834,9 +814,9 @@ GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a, | |||
834 | * @param result set to @a a ^ @a b | 814 | * @param result set to @a a ^ @a b |
835 | */ | 815 | */ |
836 | void | 816 | void |
837 | GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode *a, | 817 | GNUNET_CRYPTO_hash_xor(const struct GNUNET_HashCode *a, |
838 | const struct GNUNET_HashCode *b, | 818 | const struct GNUNET_HashCode *b, |
839 | struct GNUNET_HashCode *result); | 819 | struct GNUNET_HashCode *result); |
840 | 820 | ||
841 | 821 | ||
842 | /** | 822 | /** |
@@ -848,7 +828,7 @@ GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode *a, | |||
848 | * @param iv set to a valid initialization vector | 828 | * @param iv set to a valid initialization vector |
849 | */ | 829 | */ |
850 | void | 830 | void |
851 | GNUNET_CRYPTO_hash_to_aes_key ( | 831 | GNUNET_CRYPTO_hash_to_aes_key( |
852 | const struct GNUNET_HashCode *hc, | 832 | const struct GNUNET_HashCode *hc, |
853 | struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | 833 | struct GNUNET_CRYPTO_SymmetricSessionKey *skey, |
854 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv); | 834 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv); |
@@ -863,8 +843,8 @@ GNUNET_CRYPTO_hash_to_aes_key ( | |||
863 | * @return Bit \a bit from hashcode \a code, -1 for invalid index | 843 | * @return Bit \a bit from hashcode \a code, -1 for invalid index |
864 | */ | 844 | */ |
865 | int | 845 | int |
866 | GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, | 846 | GNUNET_CRYPTO_hash_get_bit(const struct GNUNET_HashCode *code, |
867 | unsigned int bit); | 847 | unsigned int bit); |
868 | 848 | ||
869 | 849 | ||
870 | /** | 850 | /** |
@@ -880,8 +860,8 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, | |||
880 | * @return the number of bits that match | 860 | * @return the number of bits that match |
881 | */ | 861 | */ |
882 | unsigned int | 862 | unsigned int |
883 | GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode *first, | 863 | GNUNET_CRYPTO_hash_matching_bits(const struct GNUNET_HashCode *first, |
884 | const struct GNUNET_HashCode *second); | 864 | const struct GNUNET_HashCode *second); |
885 | 865 | ||
886 | 866 | ||
887 | /** | 867 | /** |
@@ -894,8 +874,8 @@ GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode *first, | |||
894 | * @return 1 if @a h1 > @a h2, -1 if @a h1 < @a h2 and 0 if @a h1 == @a h2. | 874 | * @return 1 if @a h1 > @a h2, -1 if @a h1 < @a h2 and 0 if @a h1 == @a h2. |
895 | */ | 875 | */ |
896 | int | 876 | int |
897 | GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1, | 877 | GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, |
898 | const struct GNUNET_HashCode *h2); | 878 | const struct GNUNET_HashCode *h2); |
899 | 879 | ||
900 | 880 | ||
901 | /** | 881 | /** |
@@ -909,9 +889,9 @@ GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1, | |||
909 | * @return -1 if @a h1 is closer, 1 if @a h2 is closer and 0 if @a h1== @a h2. | 889 | * @return -1 if @a h1 is closer, 1 if @a h2 is closer and 0 if @a h1== @a h2. |
910 | */ | 890 | */ |
911 | int | 891 | int |
912 | GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1, | 892 | GNUNET_CRYPTO_hash_xorcmp(const struct GNUNET_HashCode *h1, |
913 | const struct GNUNET_HashCode *h2, | 893 | const struct GNUNET_HashCode *h2, |
914 | const struct GNUNET_HashCode *target); | 894 | const struct GNUNET_HashCode *target); |
915 | 895 | ||
916 | 896 | ||
917 | /** | 897 | /** |
@@ -924,7 +904,7 @@ GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1, | |||
924 | * @param argp pair of void * & size_t for context chunks, terminated by NULL | 904 | * @param argp pair of void * & size_t for context chunks, terminated by NULL |
925 | */ | 905 | */ |
926 | void | 906 | void |
927 | GNUNET_CRYPTO_hmac_derive_key_v ( | 907 | GNUNET_CRYPTO_hmac_derive_key_v( |
928 | struct GNUNET_CRYPTO_AuthKey *key, | 908 | struct GNUNET_CRYPTO_AuthKey *key, |
929 | const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, | 909 | const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, |
930 | const void *salt, | 910 | const void *salt, |
@@ -942,7 +922,7 @@ GNUNET_CRYPTO_hmac_derive_key_v ( | |||
942 | * @param ... pair of void * & size_t for context chunks, terminated by NULL | 922 | * @param ... pair of void * & size_t for context chunks, terminated by NULL |
943 | */ | 923 | */ |
944 | void | 924 | void |
945 | GNUNET_CRYPTO_hmac_derive_key ( | 925 | GNUNET_CRYPTO_hmac_derive_key( |
946 | struct GNUNET_CRYPTO_AuthKey *key, | 926 | struct GNUNET_CRYPTO_AuthKey *key, |
947 | const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, | 927 | const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, |
948 | const void *salt, | 928 | const void *salt, |
@@ -965,15 +945,15 @@ GNUNET_CRYPTO_hmac_derive_key ( | |||
965 | * @return #GNUNET_YES on success | 945 | * @return #GNUNET_YES on success |
966 | */ | 946 | */ |
967 | int | 947 | int |
968 | GNUNET_CRYPTO_hkdf (void *result, | 948 | GNUNET_CRYPTO_hkdf(void *result, |
969 | size_t out_len, | 949 | size_t out_len, |
970 | int xtr_algo, | 950 | int xtr_algo, |
971 | int prf_algo, | 951 | int prf_algo, |
972 | const void *xts, | 952 | const void *xts, |
973 | size_t xts_len, | 953 | size_t xts_len, |
974 | const void *skm, | 954 | const void *skm, |
975 | size_t skm_len, | 955 | size_t skm_len, |
976 | ...); | 956 | ...); |
977 | 957 | ||
978 | 958 | ||
979 | /** | 959 | /** |
@@ -991,15 +971,15 @@ GNUNET_CRYPTO_hkdf (void *result, | |||
991 | * @return #GNUNET_YES on success | 971 | * @return #GNUNET_YES on success |
992 | */ | 972 | */ |
993 | int | 973 | int |
994 | GNUNET_CRYPTO_hkdf_v (void *result, | 974 | GNUNET_CRYPTO_hkdf_v(void *result, |
995 | size_t out_len, | 975 | size_t out_len, |
996 | int xtr_algo, | 976 | int xtr_algo, |
997 | int prf_algo, | 977 | int prf_algo, |
998 | const void *xts, | 978 | const void *xts, |
999 | size_t xts_len, | 979 | size_t xts_len, |
1000 | const void *skm, | 980 | const void *skm, |
1001 | size_t skm_len, | 981 | size_t skm_len, |
1002 | va_list argp); | 982 | va_list argp); |
1003 | 983 | ||
1004 | 984 | ||
1005 | /** | 985 | /** |
@@ -1014,13 +994,13 @@ GNUNET_CRYPTO_hkdf_v (void *result, | |||
1014 | * @return #GNUNET_YES on success | 994 | * @return #GNUNET_YES on success |
1015 | */ | 995 | */ |
1016 | int | 996 | int |
1017 | GNUNET_CRYPTO_kdf_v (void *result, | 997 | GNUNET_CRYPTO_kdf_v(void *result, |
1018 | size_t out_len, | 998 | size_t out_len, |
1019 | const void *xts, | 999 | const void *xts, |
1020 | size_t xts_len, | 1000 | size_t xts_len, |
1021 | const void *skm, | 1001 | const void *skm, |
1022 | size_t skm_len, | 1002 | size_t skm_len, |
1023 | va_list argp); | 1003 | va_list argp); |
1024 | 1004 | ||
1025 | 1005 | ||
1026 | /** | 1006 | /** |
@@ -1036,13 +1016,13 @@ GNUNET_CRYPTO_kdf_v (void *result, | |||
1036 | * @param ctx context string | 1016 | * @param ctx context string |
1037 | */ | 1017 | */ |
1038 | void | 1018 | void |
1039 | GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r, | 1019 | GNUNET_CRYPTO_kdf_mod_mpi(gcry_mpi_t *r, |
1040 | gcry_mpi_t n, | 1020 | gcry_mpi_t n, |
1041 | const void *xts, | 1021 | const void *xts, |
1042 | size_t xts_len, | 1022 | size_t xts_len, |
1043 | const void *skm, | 1023 | const void *skm, |
1044 | size_t skm_len, | 1024 | size_t skm_len, |
1045 | const char *ctx); | 1025 | const char *ctx); |
1046 | 1026 | ||
1047 | 1027 | ||
1048 | /** | 1028 | /** |
@@ -1058,13 +1038,13 @@ GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r, | |||
1058 | * @return #GNUNET_YES on success | 1038 | * @return #GNUNET_YES on success |
1059 | */ | 1039 | */ |
1060 | int | 1040 | int |
1061 | GNUNET_CRYPTO_kdf (void *result, | 1041 | GNUNET_CRYPTO_kdf(void *result, |
1062 | size_t out_len, | 1042 | size_t out_len, |
1063 | const void *xts, | 1043 | const void *xts, |
1064 | size_t xts_len, | 1044 | size_t xts_len, |
1065 | const void *skm, | 1045 | const void *skm, |
1066 | size_t skm_len, | 1046 | size_t skm_len, |
1067 | ...); | 1047 | ...); |
1068 | 1048 | ||
1069 | 1049 | ||
1070 | /** | 1050 | /** |
@@ -1075,7 +1055,7 @@ GNUNET_CRYPTO_kdf (void *result, | |||
1075 | * @param pub where to write the public key | 1055 | * @param pub where to write the public key |
1076 | */ | 1056 | */ |
1077 | void | 1057 | void |
1078 | GNUNET_CRYPTO_ecdsa_key_get_public ( | 1058 | GNUNET_CRYPTO_ecdsa_key_get_public( |
1079 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | 1059 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, |
1080 | struct GNUNET_CRYPTO_EcdsaPublicKey *pub); | 1060 | struct GNUNET_CRYPTO_EcdsaPublicKey *pub); |
1081 | 1061 | ||
@@ -1087,7 +1067,7 @@ GNUNET_CRYPTO_ecdsa_key_get_public ( | |||
1087 | * @param pub where to write the public key | 1067 | * @param pub where to write the public key |
1088 | */ | 1068 | */ |
1089 | void | 1069 | void |
1090 | GNUNET_CRYPTO_eddsa_key_get_public ( | 1070 | GNUNET_CRYPTO_eddsa_key_get_public( |
1091 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | 1071 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, |
1092 | struct GNUNET_CRYPTO_EddsaPublicKey *pub); | 1072 | struct GNUNET_CRYPTO_EddsaPublicKey *pub); |
1093 | 1073 | ||
@@ -1100,7 +1080,7 @@ GNUNET_CRYPTO_eddsa_key_get_public ( | |||
1100 | * @param pub where to write the public key | 1080 | * @param pub where to write the public key |
1101 | */ | 1081 | */ |
1102 | void | 1082 | void |
1103 | GNUNET_CRYPTO_ecdhe_key_get_public ( | 1083 | GNUNET_CRYPTO_ecdhe_key_get_public( |
1104 | const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | 1084 | const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, |
1105 | struct GNUNET_CRYPTO_EcdhePublicKey *pub); | 1085 | struct GNUNET_CRYPTO_EcdhePublicKey *pub); |
1106 | 1086 | ||
@@ -1112,7 +1092,7 @@ GNUNET_CRYPTO_ecdhe_key_get_public ( | |||
1112 | * @return string representing @a pub | 1092 | * @return string representing @a pub |
1113 | */ | 1093 | */ |
1114 | char * | 1094 | char * |
1115 | GNUNET_CRYPTO_ecdsa_public_key_to_string ( | 1095 | GNUNET_CRYPTO_ecdsa_public_key_to_string( |
1116 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub); | 1096 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub); |
1117 | 1097 | ||
1118 | /** | 1098 | /** |
@@ -1122,7 +1102,7 @@ GNUNET_CRYPTO_ecdsa_public_key_to_string ( | |||
1122 | * @return string representing @a priv | 1102 | * @return string representing @a priv |
1123 | */ | 1103 | */ |
1124 | char * | 1104 | char * |
1125 | GNUNET_CRYPTO_ecdsa_private_key_to_string ( | 1105 | GNUNET_CRYPTO_ecdsa_private_key_to_string( |
1126 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv); | 1106 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv); |
1127 | 1107 | ||
1128 | 1108 | ||
@@ -1133,7 +1113,7 @@ GNUNET_CRYPTO_ecdsa_private_key_to_string ( | |||
1133 | * @return string representing @a pub | 1113 | * @return string representing @a pub |
1134 | */ | 1114 | */ |
1135 | char * | 1115 | char * |
1136 | GNUNET_CRYPTO_eddsa_private_key_to_string ( | 1116 | GNUNET_CRYPTO_eddsa_private_key_to_string( |
1137 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv); | 1117 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv); |
1138 | 1118 | ||
1139 | 1119 | ||
@@ -1144,7 +1124,7 @@ GNUNET_CRYPTO_eddsa_private_key_to_string ( | |||
1144 | * @return string representing @a pub | 1124 | * @return string representing @a pub |
1145 | */ | 1125 | */ |
1146 | char * | 1126 | char * |
1147 | GNUNET_CRYPTO_eddsa_public_key_to_string ( | 1127 | GNUNET_CRYPTO_eddsa_public_key_to_string( |
1148 | const struct GNUNET_CRYPTO_EddsaPublicKey *pub); | 1128 | const struct GNUNET_CRYPTO_EddsaPublicKey *pub); |
1149 | 1129 | ||
1150 | 1130 | ||
@@ -1157,7 +1137,7 @@ GNUNET_CRYPTO_eddsa_public_key_to_string ( | |||
1157 | * @return #GNUNET_OK on success | 1137 | * @return #GNUNET_OK on success |
1158 | */ | 1138 | */ |
1159 | int | 1139 | int |
1160 | GNUNET_CRYPTO_ecdsa_public_key_from_string ( | 1140 | GNUNET_CRYPTO_ecdsa_public_key_from_string( |
1161 | const char *enc, | 1141 | const char *enc, |
1162 | size_t enclen, | 1142 | size_t enclen, |
1163 | struct GNUNET_CRYPTO_EcdsaPublicKey *pub); | 1143 | struct GNUNET_CRYPTO_EcdsaPublicKey *pub); |
@@ -1172,7 +1152,7 @@ GNUNET_CRYPTO_ecdsa_public_key_from_string ( | |||
1172 | * @return #GNUNET_OK on success | 1152 | * @return #GNUNET_OK on success |
1173 | */ | 1153 | */ |
1174 | int | 1154 | int |
1175 | GNUNET_CRYPTO_eddsa_private_key_from_string ( | 1155 | GNUNET_CRYPTO_eddsa_private_key_from_string( |
1176 | const char *enc, | 1156 | const char *enc, |
1177 | size_t enclen, | 1157 | size_t enclen, |
1178 | struct GNUNET_CRYPTO_EddsaPrivateKey *pub); | 1158 | struct GNUNET_CRYPTO_EddsaPrivateKey *pub); |
@@ -1187,7 +1167,7 @@ GNUNET_CRYPTO_eddsa_private_key_from_string ( | |||
1187 | * @return #GNUNET_OK on success | 1167 | * @return #GNUNET_OK on success |
1188 | */ | 1168 | */ |
1189 | int | 1169 | int |
1190 | GNUNET_CRYPTO_eddsa_public_key_from_string ( | 1170 | GNUNET_CRYPTO_eddsa_public_key_from_string( |
1191 | const char *enc, | 1171 | const char *enc, |
1192 | size_t enclen, | 1172 | size_t enclen, |
1193 | struct GNUNET_CRYPTO_EddsaPublicKey *pub); | 1173 | struct GNUNET_CRYPTO_EddsaPublicKey *pub); |
@@ -1209,7 +1189,7 @@ GNUNET_CRYPTO_eddsa_public_key_from_string ( | |||
1209 | * permission denied); free using #GNUNET_free | 1189 | * permission denied); free using #GNUNET_free |
1210 | */ | 1190 | */ |
1211 | struct GNUNET_CRYPTO_EcdsaPrivateKey * | 1191 | struct GNUNET_CRYPTO_EcdsaPrivateKey * |
1212 | GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename); | 1192 | GNUNET_CRYPTO_ecdsa_key_create_from_file(const char *filename); |
1213 | 1193 | ||
1214 | 1194 | ||
1215 | /** | 1195 | /** |
@@ -1228,7 +1208,7 @@ GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename); | |||
1228 | * permission denied); free using #GNUNET_free | 1208 | * permission denied); free using #GNUNET_free |
1229 | */ | 1209 | */ |
1230 | struct GNUNET_CRYPTO_EddsaPrivateKey * | 1210 | struct GNUNET_CRYPTO_EddsaPrivateKey * |
1231 | GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename); | 1211 | GNUNET_CRYPTO_eddsa_key_create_from_file(const char *filename); |
1232 | 1212 | ||
1233 | 1213 | ||
1234 | /** | 1214 | /** |
@@ -1247,7 +1227,7 @@ struct GNUNET_CONFIGURATION_Handle; | |||
1247 | * permission denied); free using #GNUNET_free | 1227 | * permission denied); free using #GNUNET_free |
1248 | */ | 1228 | */ |
1249 | struct GNUNET_CRYPTO_EddsaPrivateKey * | 1229 | struct GNUNET_CRYPTO_EddsaPrivateKey * |
1250 | GNUNET_CRYPTO_eddsa_key_create_from_configuration ( | 1230 | GNUNET_CRYPTO_eddsa_key_create_from_configuration( |
1251 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 1231 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
1252 | 1232 | ||
1253 | 1233 | ||
@@ -1258,7 +1238,7 @@ GNUNET_CRYPTO_eddsa_key_create_from_configuration ( | |||
1258 | * @return fresh private key; free using #GNUNET_free | 1238 | * @return fresh private key; free using #GNUNET_free |
1259 | */ | 1239 | */ |
1260 | struct GNUNET_CRYPTO_EcdsaPrivateKey * | 1240 | struct GNUNET_CRYPTO_EcdsaPrivateKey * |
1261 | GNUNET_CRYPTO_ecdsa_key_create (void); | 1241 | GNUNET_CRYPTO_ecdsa_key_create(void); |
1262 | 1242 | ||
1263 | 1243 | ||
1264 | /** | 1244 | /** |
@@ -1268,7 +1248,7 @@ GNUNET_CRYPTO_ecdsa_key_create (void); | |||
1268 | * @return fresh private key; free using #GNUNET_free | 1248 | * @return fresh private key; free using #GNUNET_free |
1269 | */ | 1249 | */ |
1270 | struct GNUNET_CRYPTO_EddsaPrivateKey * | 1250 | struct GNUNET_CRYPTO_EddsaPrivateKey * |
1271 | GNUNET_CRYPTO_eddsa_key_create (void); | 1251 | GNUNET_CRYPTO_eddsa_key_create(void); |
1272 | 1252 | ||
1273 | 1253 | ||
1274 | /** | 1254 | /** |
@@ -1279,7 +1259,7 @@ GNUNET_CRYPTO_eddsa_key_create (void); | |||
1279 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 1259 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
1280 | */ | 1260 | */ |
1281 | int | 1261 | int |
1282 | GNUNET_CRYPTO_ecdhe_key_create2 (struct GNUNET_CRYPTO_EcdhePrivateKey *pk); | 1262 | GNUNET_CRYPTO_ecdhe_key_create2(struct GNUNET_CRYPTO_EcdhePrivateKey *pk); |
1283 | 1263 | ||
1284 | 1264 | ||
1285 | /** | 1265 | /** |
@@ -1289,7 +1269,7 @@ GNUNET_CRYPTO_ecdhe_key_create2 (struct GNUNET_CRYPTO_EcdhePrivateKey *pk); | |||
1289 | * @return fresh private key; free using #GNUNET_free | 1269 | * @return fresh private key; free using #GNUNET_free |
1290 | */ | 1270 | */ |
1291 | struct GNUNET_CRYPTO_EcdhePrivateKey * | 1271 | struct GNUNET_CRYPTO_EcdhePrivateKey * |
1292 | GNUNET_CRYPTO_ecdhe_key_create (void); | 1272 | GNUNET_CRYPTO_ecdhe_key_create(void); |
1293 | 1273 | ||
1294 | 1274 | ||
1295 | /** | 1275 | /** |
@@ -1299,7 +1279,7 @@ GNUNET_CRYPTO_ecdhe_key_create (void); | |||
1299 | * @param pk location of the key | 1279 | * @param pk location of the key |
1300 | */ | 1280 | */ |
1301 | void | 1281 | void |
1302 | GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk); | 1282 | GNUNET_CRYPTO_eddsa_key_clear(struct GNUNET_CRYPTO_EddsaPrivateKey *pk); |
1303 | 1283 | ||
1304 | 1284 | ||
1305 | /** | 1285 | /** |
@@ -1309,7 +1289,7 @@ GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk); | |||
1309 | * @param pk location of the key | 1289 | * @param pk location of the key |
1310 | */ | 1290 | */ |
1311 | void | 1291 | void |
1312 | GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); | 1292 | GNUNET_CRYPTO_ecdsa_key_clear(struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); |
1313 | 1293 | ||
1314 | 1294 | ||
1315 | /** | 1295 | /** |
@@ -1319,7 +1299,7 @@ GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); | |||
1319 | * @param pk location of the key | 1299 | * @param pk location of the key |
1320 | */ | 1300 | */ |
1321 | void | 1301 | void |
1322 | GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk); | 1302 | GNUNET_CRYPTO_ecdhe_key_clear(struct GNUNET_CRYPTO_EcdhePrivateKey *pk); |
1323 | 1303 | ||
1324 | 1304 | ||
1325 | /** | 1305 | /** |
@@ -1329,7 +1309,7 @@ GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk); | |||
1329 | * @return "anonymous" private key; do not free | 1309 | * @return "anonymous" private key; do not free |
1330 | */ | 1310 | */ |
1331 | const struct GNUNET_CRYPTO_EcdsaPrivateKey * | 1311 | const struct GNUNET_CRYPTO_EcdsaPrivateKey * |
1332 | GNUNET_CRYPTO_ecdsa_key_get_anonymous (void); | 1312 | GNUNET_CRYPTO_ecdsa_key_get_anonymous(void); |
1333 | 1313 | ||
1334 | 1314 | ||
1335 | /** | 1315 | /** |
@@ -1338,11 +1318,11 @@ GNUNET_CRYPTO_ecdsa_key_get_anonymous (void); | |||
1338 | * configuration file (!). This function is used so that | 1318 | * configuration file (!). This function is used so that |
1339 | * at a later point code can be certain that reading a | 1319 | * at a later point code can be certain that reading a |
1340 | * hostkey is fast (for example in time-dependent testcases). | 1320 | * hostkey is fast (for example in time-dependent testcases). |
1341 | * | 1321 | * |
1342 | * @param cfg_name name of the configuration file to use | 1322 | * @param cfg_name name of the configuration file to use |
1343 | */ | 1323 | */ |
1344 | void | 1324 | void |
1345 | GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name); | 1325 | GNUNET_CRYPTO_eddsa_setup_hostkey(const char *cfg_name); |
1346 | 1326 | ||
1347 | 1327 | ||
1348 | /** | 1328 | /** |
@@ -1355,8 +1335,8 @@ GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name); | |||
1355 | * could not be retrieved | 1335 | * could not be retrieved |
1356 | */ | 1336 | */ |
1357 | int | 1337 | int |
1358 | GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1338 | GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, |
1359 | struct GNUNET_PeerIdentity *dst); | 1339 | struct GNUNET_PeerIdentity *dst); |
1360 | 1340 | ||
1361 | 1341 | ||
1362 | /** | 1342 | /** |
@@ -1369,8 +1349,7 @@ struct GNUNET_CRYPTO_EccDlogContext; | |||
1369 | * Point on a curve (always for Curve25519) encoded in a format suitable | 1349 | * Point on a curve (always for Curve25519) encoded in a format suitable |
1370 | * for network transmission (ECDH), see http://cr.yp.to/ecdh.html. | 1350 | * for network transmission (ECDH), see http://cr.yp.to/ecdh.html. |
1371 | */ | 1351 | */ |
1372 | struct GNUNET_CRYPTO_EccPoint | 1352 | struct GNUNET_CRYPTO_EccPoint { |
1373 | { | ||
1374 | /** | 1353 | /** |
1375 | * Q consists of an x- and a y-value, each mod p (256 bits), given | 1354 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
1376 | * here in affine coordinates and Ed25519 standard compact format. | 1355 | * here in affine coordinates and Ed25519 standard compact format. |
@@ -1387,7 +1366,7 @@ struct GNUNET_CRYPTO_EccPoint | |||
1387 | * @return NULL on error | 1366 | * @return NULL on error |
1388 | */ | 1367 | */ |
1389 | struct GNUNET_CRYPTO_EccDlogContext * | 1368 | struct GNUNET_CRYPTO_EccDlogContext * |
1390 | GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max, unsigned int mem); | 1369 | GNUNET_CRYPTO_ecc_dlog_prepare(unsigned int max, unsigned int mem); |
1391 | 1370 | ||
1392 | 1371 | ||
1393 | /** | 1372 | /** |
@@ -1399,8 +1378,8 @@ GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max, unsigned int mem); | |||
1399 | * @return INT_MAX if dlog failed, otherwise the factor | 1378 | * @return INT_MAX if dlog failed, otherwise the factor |
1400 | */ | 1379 | */ |
1401 | int | 1380 | int |
1402 | GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1381 | GNUNET_CRYPTO_ecc_dlog(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1403 | gcry_mpi_point_t input); | 1382 | gcry_mpi_point_t input); |
1404 | 1383 | ||
1405 | 1384 | ||
1406 | /** | 1385 | /** |
@@ -1417,7 +1396,7 @@ GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1417 | * must be freed using #GNUNET_CRYPTO_ecc_free() | 1396 | * must be freed using #GNUNET_CRYPTO_ecc_free() |
1418 | */ | 1397 | */ |
1419 | gcry_mpi_point_t | 1398 | gcry_mpi_point_t |
1420 | GNUNET_CRYPTO_ecc_dexp (struct GNUNET_CRYPTO_EccDlogContext *edc, int val); | 1399 | GNUNET_CRYPTO_ecc_dexp(struct GNUNET_CRYPTO_EccDlogContext *edc, int val); |
1421 | 1400 | ||
1422 | 1401 | ||
1423 | /** | 1402 | /** |
@@ -1430,8 +1409,8 @@ GNUNET_CRYPTO_ecc_dexp (struct GNUNET_CRYPTO_EccDlogContext *edc, int val); | |||
1430 | * must be freed using #GNUNET_CRYPTO_ecc_free() | 1409 | * must be freed using #GNUNET_CRYPTO_ecc_free() |
1431 | */ | 1410 | */ |
1432 | gcry_mpi_point_t | 1411 | gcry_mpi_point_t |
1433 | GNUNET_CRYPTO_ecc_dexp_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1412 | GNUNET_CRYPTO_ecc_dexp_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1434 | gcry_mpi_t val); | 1413 | gcry_mpi_t val); |
1435 | 1414 | ||
1436 | 1415 | ||
1437 | /** | 1416 | /** |
@@ -1444,9 +1423,9 @@ GNUNET_CRYPTO_ecc_dexp_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1444 | * must be freed using #GNUNET_CRYPTO_ecc_free() | 1423 | * must be freed using #GNUNET_CRYPTO_ecc_free() |
1445 | */ | 1424 | */ |
1446 | gcry_mpi_point_t | 1425 | gcry_mpi_point_t |
1447 | GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1426 | GNUNET_CRYPTO_ecc_pmul_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1448 | gcry_mpi_point_t p, | 1427 | gcry_mpi_point_t p, |
1449 | gcry_mpi_t val); | 1428 | gcry_mpi_t val); |
1450 | 1429 | ||
1451 | 1430 | ||
1452 | /** | 1431 | /** |
@@ -1457,9 +1436,9 @@ GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1457 | * @param[out] bin binary point representation | 1436 | * @param[out] bin binary point representation |
1458 | */ | 1437 | */ |
1459 | void | 1438 | void |
1460 | GNUNET_CRYPTO_ecc_point_to_bin (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1439 | GNUNET_CRYPTO_ecc_point_to_bin(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1461 | gcry_mpi_point_t point, | 1440 | gcry_mpi_point_t point, |
1462 | struct GNUNET_CRYPTO_EccPoint *bin); | 1441 | struct GNUNET_CRYPTO_EccPoint *bin); |
1463 | 1442 | ||
1464 | 1443 | ||
1465 | /** | 1444 | /** |
@@ -1470,8 +1449,8 @@ GNUNET_CRYPTO_ecc_point_to_bin (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1470 | * @return computational representation | 1449 | * @return computational representation |
1471 | */ | 1450 | */ |
1472 | gcry_mpi_point_t | 1451 | gcry_mpi_point_t |
1473 | GNUNET_CRYPTO_ecc_bin_to_point (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1452 | GNUNET_CRYPTO_ecc_bin_to_point(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1474 | const struct GNUNET_CRYPTO_EccPoint *bin); | 1453 | const struct GNUNET_CRYPTO_EccPoint *bin); |
1475 | 1454 | ||
1476 | 1455 | ||
1477 | /** | 1456 | /** |
@@ -1483,9 +1462,9 @@ GNUNET_CRYPTO_ecc_bin_to_point (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1483 | * @return @a a + @a b, must be freed using #GNUNET_CRYPTO_ecc_free() | 1462 | * @return @a a + @a b, must be freed using #GNUNET_CRYPTO_ecc_free() |
1484 | */ | 1463 | */ |
1485 | gcry_mpi_point_t | 1464 | gcry_mpi_point_t |
1486 | GNUNET_CRYPTO_ecc_add (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1465 | GNUNET_CRYPTO_ecc_add(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1487 | gcry_mpi_point_t a, | 1466 | gcry_mpi_point_t a, |
1488 | gcry_mpi_point_t b); | 1467 | gcry_mpi_point_t b); |
1489 | 1468 | ||
1490 | 1469 | ||
1491 | /** | 1470 | /** |
@@ -1498,9 +1477,9 @@ GNUNET_CRYPTO_ecc_add (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1498 | * @param[out] r_inv set to the additive inverse of @a r | 1477 | * @param[out] r_inv set to the additive inverse of @a r |
1499 | */ | 1478 | */ |
1500 | void | 1479 | void |
1501 | GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1480 | GNUNET_CRYPTO_ecc_rnd(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1502 | gcry_mpi_point_t *r, | 1481 | gcry_mpi_point_t *r, |
1503 | gcry_mpi_point_t *r_inv); | 1482 | gcry_mpi_point_t *r_inv); |
1504 | 1483 | ||
1505 | 1484 | ||
1506 | /** | 1485 | /** |
@@ -1512,9 +1491,9 @@ GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1512 | * @param[out] r_inv set to the multiplicative inverse of @a r | 1491 | * @param[out] r_inv set to the multiplicative inverse of @a r |
1513 | */ | 1492 | */ |
1514 | void | 1493 | void |
1515 | GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | 1494 | GNUNET_CRYPTO_ecc_rnd_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, |
1516 | gcry_mpi_t *r, | 1495 | gcry_mpi_t *r, |
1517 | gcry_mpi_t *r_inv); | 1496 | gcry_mpi_t *r_inv); |
1518 | 1497 | ||
1519 | 1498 | ||
1520 | /** | 1499 | /** |
@@ -1524,7 +1503,7 @@ GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc, | |||
1524 | * @return random value mod n. | 1503 | * @return random value mod n. |
1525 | */ | 1504 | */ |
1526 | gcry_mpi_t | 1505 | gcry_mpi_t |
1527 | GNUNET_CRYPTO_ecc_random_mod_n (struct GNUNET_CRYPTO_EccDlogContext *edc); | 1506 | GNUNET_CRYPTO_ecc_random_mod_n(struct GNUNET_CRYPTO_EccDlogContext *edc); |
1528 | 1507 | ||
1529 | 1508 | ||
1530 | /** | 1509 | /** |
@@ -1533,7 +1512,7 @@ GNUNET_CRYPTO_ecc_random_mod_n (struct GNUNET_CRYPTO_EccDlogContext *edc); | |||
1533 | * @param p point to free | 1512 | * @param p point to free |
1534 | */ | 1513 | */ |
1535 | void | 1514 | void |
1536 | GNUNET_CRYPTO_ecc_free (gcry_mpi_point_t p); | 1515 | GNUNET_CRYPTO_ecc_free(gcry_mpi_point_t p); |
1537 | 1516 | ||
1538 | 1517 | ||
1539 | /** | 1518 | /** |
@@ -1542,7 +1521,7 @@ GNUNET_CRYPTO_ecc_free (gcry_mpi_point_t p); | |||
1542 | * @param dlc dlog context | 1521 | * @param dlc dlog context |
1543 | */ | 1522 | */ |
1544 | void | 1523 | void |
1545 | GNUNET_CRYPTO_ecc_dlog_release (struct GNUNET_CRYPTO_EccDlogContext *dlc); | 1524 | GNUNET_CRYPTO_ecc_dlog_release(struct GNUNET_CRYPTO_EccDlogContext *dlc); |
1546 | 1525 | ||
1547 | 1526 | ||
1548 | /** | 1527 | /** |
@@ -1555,9 +1534,9 @@ GNUNET_CRYPTO_ecc_dlog_release (struct GNUNET_CRYPTO_EccDlogContext *dlc); | |||
1555 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1534 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1556 | */ | 1535 | */ |
1557 | int | 1536 | int |
1558 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | 1537 | GNUNET_CRYPTO_ecc_ecdh(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, |
1559 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, | 1538 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, |
1560 | struct GNUNET_HashCode *key_material); | 1539 | struct GNUNET_HashCode *key_material); |
1561 | 1540 | ||
1562 | 1541 | ||
1563 | /** | 1542 | /** |
@@ -1571,9 +1550,9 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | |||
1571 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1550 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1572 | */ | 1551 | */ |
1573 | int | 1552 | int |
1574 | GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | 1553 | GNUNET_CRYPTO_eddsa_ecdh(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, |
1575 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, | 1554 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, |
1576 | struct GNUNET_HashCode *key_material); | 1555 | struct GNUNET_HashCode *key_material); |
1577 | 1556 | ||
1578 | /** | 1557 | /** |
1579 | * @ingroup crypto | 1558 | * @ingroup crypto |
@@ -1586,9 +1565,9 @@ GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | |||
1586 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1565 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1587 | */ | 1566 | */ |
1588 | int | 1567 | int |
1589 | GNUNET_CRYPTO_ecdsa_ecdh (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | 1568 | GNUNET_CRYPTO_ecdsa_ecdh(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, |
1590 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, | 1569 | const struct GNUNET_CRYPTO_EcdhePublicKey *pub, |
1591 | struct GNUNET_HashCode *key_material); | 1570 | struct GNUNET_HashCode *key_material); |
1592 | 1571 | ||
1593 | 1572 | ||
1594 | /** | 1573 | /** |
@@ -1602,9 +1581,9 @@ GNUNET_CRYPTO_ecdsa_ecdh (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | |||
1602 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1581 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1603 | */ | 1582 | */ |
1604 | int | 1583 | int |
1605 | GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | 1584 | GNUNET_CRYPTO_ecdh_eddsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, |
1606 | const struct GNUNET_CRYPTO_EddsaPublicKey *pub, | 1585 | const struct GNUNET_CRYPTO_EddsaPublicKey *pub, |
1607 | struct GNUNET_HashCode *key_material); | 1586 | struct GNUNET_HashCode *key_material); |
1608 | 1587 | ||
1609 | /** | 1588 | /** |
1610 | * @ingroup crypto | 1589 | * @ingroup crypto |
@@ -1617,9 +1596,9 @@ GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | |||
1617 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1596 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1618 | */ | 1597 | */ |
1619 | int | 1598 | int |
1620 | GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | 1599 | GNUNET_CRYPTO_ecdh_ecdsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, |
1621 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, | 1600 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, |
1622 | struct GNUNET_HashCode *key_material); | 1601 | struct GNUNET_HashCode *key_material); |
1623 | 1602 | ||
1624 | 1603 | ||
1625 | /** | 1604 | /** |
@@ -1632,7 +1611,7 @@ GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | |||
1632 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1611 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1633 | */ | 1612 | */ |
1634 | int | 1613 | int |
1635 | GNUNET_CRYPTO_eddsa_sign ( | 1614 | GNUNET_CRYPTO_eddsa_sign( |
1636 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | 1615 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, |
1637 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 1616 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
1638 | struct GNUNET_CRYPTO_EddsaSignature *sig); | 1617 | struct GNUNET_CRYPTO_EddsaSignature *sig); |
@@ -1648,7 +1627,7 @@ GNUNET_CRYPTO_eddsa_sign ( | |||
1648 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1627 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1649 | */ | 1628 | */ |
1650 | int | 1629 | int |
1651 | GNUNET_CRYPTO_ecdsa_sign ( | 1630 | GNUNET_CRYPTO_ecdsa_sign( |
1652 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | 1631 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, |
1653 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 1632 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
1654 | struct GNUNET_CRYPTO_EcdsaSignature *sig); | 1633 | struct GNUNET_CRYPTO_EcdsaSignature *sig); |
@@ -1664,7 +1643,7 @@ GNUNET_CRYPTO_ecdsa_sign ( | |||
1664 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid | 1643 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid |
1665 | */ | 1644 | */ |
1666 | int | 1645 | int |
1667 | GNUNET_CRYPTO_eddsa_verify ( | 1646 | GNUNET_CRYPTO_eddsa_verify( |
1668 | uint32_t purpose, | 1647 | uint32_t purpose, |
1669 | const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, | 1648 | const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, |
1670 | const struct GNUNET_CRYPTO_EddsaSignature *sig, | 1649 | const struct GNUNET_CRYPTO_EddsaSignature *sig, |
@@ -1682,7 +1661,7 @@ GNUNET_CRYPTO_eddsa_verify ( | |||
1682 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid | 1661 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid |
1683 | */ | 1662 | */ |
1684 | int | 1663 | int |
1685 | GNUNET_CRYPTO_ecdsa_verify ( | 1664 | GNUNET_CRYPTO_ecdsa_verify( |
1686 | uint32_t purpose, | 1665 | uint32_t purpose, |
1687 | const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, | 1666 | const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, |
1688 | const struct GNUNET_CRYPTO_EcdsaSignature *sig, | 1667 | const struct GNUNET_CRYPTO_EcdsaSignature *sig, |
@@ -1703,7 +1682,7 @@ GNUNET_CRYPTO_ecdsa_verify ( | |||
1703 | * @return derived private key | 1682 | * @return derived private key |
1704 | */ | 1683 | */ |
1705 | struct GNUNET_CRYPTO_EcdsaPrivateKey * | 1684 | struct GNUNET_CRYPTO_EcdsaPrivateKey * |
1706 | GNUNET_CRYPTO_ecdsa_private_key_derive ( | 1685 | GNUNET_CRYPTO_ecdsa_private_key_derive( |
1707 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, | 1686 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, |
1708 | const char *label, | 1687 | const char *label, |
1709 | const char *context); | 1688 | const char *context); |
@@ -1721,7 +1700,7 @@ GNUNET_CRYPTO_ecdsa_private_key_derive ( | |||
1721 | * @param result where to write the derived public key | 1700 | * @param result where to write the derived public key |
1722 | */ | 1701 | */ |
1723 | void | 1702 | void |
1724 | GNUNET_CRYPTO_ecdsa_public_key_derive ( | 1703 | GNUNET_CRYPTO_ecdsa_public_key_derive( |
1725 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, | 1704 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, |
1726 | const char *label, | 1705 | const char *label, |
1727 | const char *context, | 1706 | const char *context, |
@@ -1737,7 +1716,7 @@ GNUNET_CRYPTO_ecdsa_public_key_derive ( | |||
1737 | * @param val value to write to @a buf | 1716 | * @param val value to write to @a buf |
1738 | */ | 1717 | */ |
1739 | void | 1718 | void |
1740 | GNUNET_CRYPTO_mpi_print_unsigned (void *buf, size_t size, gcry_mpi_t val); | 1719 | GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val); |
1741 | 1720 | ||
1742 | 1721 | ||
1743 | /** | 1722 | /** |
@@ -1750,9 +1729,9 @@ GNUNET_CRYPTO_mpi_print_unsigned (void *buf, size_t size, gcry_mpi_t val); | |||
1750 | * @param size number of bytes in @a data | 1729 | * @param size number of bytes in @a data |
1751 | */ | 1730 | */ |
1752 | void | 1731 | void |
1753 | GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, | 1732 | GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, |
1754 | const void *data, | 1733 | const void *data, |
1755 | size_t size); | 1734 | size_t size); |
1756 | 1735 | ||
1757 | 1736 | ||
1758 | /** | 1737 | /** |
@@ -1762,7 +1741,7 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, | |||
1762 | * @param[out] private_key Where to store the private key? | 1741 | * @param[out] private_key Where to store the private key? |
1763 | */ | 1742 | */ |
1764 | void | 1743 | void |
1765 | GNUNET_CRYPTO_paillier_create ( | 1744 | GNUNET_CRYPTO_paillier_create( |
1766 | struct GNUNET_CRYPTO_PaillierPublicKey *public_key, | 1745 | struct GNUNET_CRYPTO_PaillierPublicKey *public_key, |
1767 | struct GNUNET_CRYPTO_PaillierPrivateKey *private_key); | 1746 | struct GNUNET_CRYPTO_PaillierPrivateKey *private_key); |
1768 | 1747 | ||
@@ -1779,7 +1758,7 @@ GNUNET_CRYPTO_paillier_create ( | |||
1779 | * or -1 if less than one homomorphic operation is possible | 1758 | * or -1 if less than one homomorphic operation is possible |
1780 | */ | 1759 | */ |
1781 | int | 1760 | int |
1782 | GNUNET_CRYPTO_paillier_encrypt ( | 1761 | GNUNET_CRYPTO_paillier_encrypt( |
1783 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, | 1762 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, |
1784 | const gcry_mpi_t m, | 1763 | const gcry_mpi_t m, |
1785 | int desired_ops, | 1764 | int desired_ops, |
@@ -1795,7 +1774,7 @@ GNUNET_CRYPTO_paillier_encrypt ( | |||
1795 | * @param[out] m Decryption of @a ciphertext with @private_key. | 1774 | * @param[out] m Decryption of @a ciphertext with @private_key. |
1796 | */ | 1775 | */ |
1797 | void | 1776 | void |
1798 | GNUNET_CRYPTO_paillier_decrypt ( | 1777 | GNUNET_CRYPTO_paillier_decrypt( |
1799 | const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key, | 1778 | const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key, |
1800 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, | 1779 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, |
1801 | const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext, | 1780 | const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext, |
@@ -1816,7 +1795,7 @@ GNUNET_CRYPTO_paillier_decrypt ( | |||
1816 | * #GNUNET_SYSERR if no more homomorphic operations are remaining. | 1795 | * #GNUNET_SYSERR if no more homomorphic operations are remaining. |
1817 | */ | 1796 | */ |
1818 | int | 1797 | int |
1819 | GNUNET_CRYPTO_paillier_hom_add ( | 1798 | GNUNET_CRYPTO_paillier_hom_add( |
1820 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, | 1799 | const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, |
1821 | const struct GNUNET_CRYPTO_PaillierCiphertext *c1, | 1800 | const struct GNUNET_CRYPTO_PaillierCiphertext *c1, |
1822 | const struct GNUNET_CRYPTO_PaillierCiphertext *c2, | 1801 | const struct GNUNET_CRYPTO_PaillierCiphertext *c2, |
@@ -1830,7 +1809,7 @@ GNUNET_CRYPTO_paillier_hom_add ( | |||
1830 | * @return the number of remaining homomorphic operations | 1809 | * @return the number of remaining homomorphic operations |
1831 | */ | 1810 | */ |
1832 | int | 1811 | int |
1833 | GNUNET_CRYPTO_paillier_hom_get_remaining ( | 1812 | GNUNET_CRYPTO_paillier_hom_get_remaining( |
1834 | const struct GNUNET_CRYPTO_PaillierCiphertext *c); | 1813 | const struct GNUNET_CRYPTO_PaillierCiphertext *c); |
1835 | 1814 | ||
1836 | 1815 | ||
@@ -1850,8 +1829,7 @@ struct GNUNET_CRYPTO_RsaPublicKey; | |||
1850 | /** | 1829 | /** |
1851 | * Constant-size pre-secret for blinding key generation. | 1830 | * Constant-size pre-secret for blinding key generation. |
1852 | */ | 1831 | */ |
1853 | struct GNUNET_CRYPTO_RsaBlindingKeySecret | 1832 | struct GNUNET_CRYPTO_RsaBlindingKeySecret { |
1854 | { | ||
1855 | /** | 1833 | /** |
1856 | * Bits used to generate the blinding key. 256 bits | 1834 | * Bits used to generate the blinding key. 256 bits |
1857 | * of entropy is enough. | 1835 | * of entropy is enough. |
@@ -1872,7 +1850,7 @@ struct GNUNET_CRYPTO_RsaSignature; | |||
1872 | * @return fresh private key | 1850 | * @return fresh private key |
1873 | */ | 1851 | */ |
1874 | struct GNUNET_CRYPTO_RsaPrivateKey * | 1852 | struct GNUNET_CRYPTO_RsaPrivateKey * |
1875 | GNUNET_CRYPTO_rsa_private_key_create (unsigned int len); | 1853 | GNUNET_CRYPTO_rsa_private_key_create(unsigned int len); |
1876 | 1854 | ||
1877 | 1855 | ||
1878 | /** | 1856 | /** |
@@ -1881,7 +1859,7 @@ GNUNET_CRYPTO_rsa_private_key_create (unsigned int len); | |||
1881 | * @param key pointer to the memory to free | 1859 | * @param key pointer to the memory to free |
1882 | */ | 1860 | */ |
1883 | void | 1861 | void |
1884 | GNUNET_CRYPTO_rsa_private_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *key); | 1862 | GNUNET_CRYPTO_rsa_private_key_free(struct GNUNET_CRYPTO_RsaPrivateKey *key); |
1885 | 1863 | ||
1886 | 1864 | ||
1887 | /** | 1865 | /** |
@@ -1893,7 +1871,7 @@ GNUNET_CRYPTO_rsa_private_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *key); | |||
1893 | * @return size of memory allocatedin @a buffer | 1871 | * @return size of memory allocatedin @a buffer |
1894 | */ | 1872 | */ |
1895 | size_t | 1873 | size_t |
1896 | GNUNET_CRYPTO_rsa_private_key_encode ( | 1874 | GNUNET_CRYPTO_rsa_private_key_encode( |
1897 | const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 1875 | const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
1898 | char **buffer); | 1876 | char **buffer); |
1899 | 1877 | ||
@@ -1907,7 +1885,7 @@ GNUNET_CRYPTO_rsa_private_key_encode ( | |||
1907 | * @return NULL on error | 1885 | * @return NULL on error |
1908 | */ | 1886 | */ |
1909 | struct GNUNET_CRYPTO_RsaPrivateKey * | 1887 | struct GNUNET_CRYPTO_RsaPrivateKey * |
1910 | GNUNET_CRYPTO_rsa_private_key_decode (const char *buf, size_t len); | 1888 | GNUNET_CRYPTO_rsa_private_key_decode(const char *buf, size_t len); |
1911 | 1889 | ||
1912 | 1890 | ||
1913 | /** | 1891 | /** |
@@ -1917,7 +1895,7 @@ GNUNET_CRYPTO_rsa_private_key_decode (const char *buf, size_t len); | |||
1917 | * @return the duplicate key; NULL upon error | 1895 | * @return the duplicate key; NULL upon error |
1918 | */ | 1896 | */ |
1919 | struct GNUNET_CRYPTO_RsaPrivateKey * | 1897 | struct GNUNET_CRYPTO_RsaPrivateKey * |
1920 | GNUNET_CRYPTO_rsa_private_key_dup ( | 1898 | GNUNET_CRYPTO_rsa_private_key_dup( |
1921 | const struct GNUNET_CRYPTO_RsaPrivateKey *key); | 1899 | const struct GNUNET_CRYPTO_RsaPrivateKey *key); |
1922 | 1900 | ||
1923 | 1901 | ||
@@ -1928,7 +1906,7 @@ GNUNET_CRYPTO_rsa_private_key_dup ( | |||
1928 | * @retur NULL on error, otherwise the public key | 1906 | * @retur NULL on error, otherwise the public key |
1929 | */ | 1907 | */ |
1930 | struct GNUNET_CRYPTO_RsaPublicKey * | 1908 | struct GNUNET_CRYPTO_RsaPublicKey * |
1931 | GNUNET_CRYPTO_rsa_private_key_get_public ( | 1909 | GNUNET_CRYPTO_rsa_private_key_get_public( |
1932 | const struct GNUNET_CRYPTO_RsaPrivateKey *priv); | 1910 | const struct GNUNET_CRYPTO_RsaPrivateKey *priv); |
1933 | 1911 | ||
1934 | 1912 | ||
@@ -1939,8 +1917,8 @@ GNUNET_CRYPTO_rsa_private_key_get_public ( | |||
1939 | * @param hc where to store the hash code | 1917 | * @param hc where to store the hash code |
1940 | */ | 1918 | */ |
1941 | void | 1919 | void |
1942 | GNUNET_CRYPTO_rsa_public_key_hash (const struct GNUNET_CRYPTO_RsaPublicKey *key, | 1920 | GNUNET_CRYPTO_rsa_public_key_hash(const struct GNUNET_CRYPTO_RsaPublicKey *key, |
1943 | struct GNUNET_HashCode *hc); | 1921 | struct GNUNET_HashCode *hc); |
1944 | 1922 | ||
1945 | 1923 | ||
1946 | /** | 1924 | /** |
@@ -1950,7 +1928,7 @@ GNUNET_CRYPTO_rsa_public_key_hash (const struct GNUNET_CRYPTO_RsaPublicKey *key, | |||
1950 | * @return length of the key in bits | 1928 | * @return length of the key in bits |
1951 | */ | 1929 | */ |
1952 | unsigned int | 1930 | unsigned int |
1953 | GNUNET_CRYPTO_rsa_public_key_len (const struct GNUNET_CRYPTO_RsaPublicKey *key); | 1931 | GNUNET_CRYPTO_rsa_public_key_len(const struct GNUNET_CRYPTO_RsaPublicKey *key); |
1954 | 1932 | ||
1955 | 1933 | ||
1956 | /** | 1934 | /** |
@@ -1959,7 +1937,7 @@ GNUNET_CRYPTO_rsa_public_key_len (const struct GNUNET_CRYPTO_RsaPublicKey *key); | |||
1959 | * @param key pointer to the memory to free | 1937 | * @param key pointer to the memory to free |
1960 | */ | 1938 | */ |
1961 | void | 1939 | void |
1962 | GNUNET_CRYPTO_rsa_public_key_free (struct GNUNET_CRYPTO_RsaPublicKey *key); | 1940 | GNUNET_CRYPTO_rsa_public_key_free(struct GNUNET_CRYPTO_RsaPublicKey *key); |
1963 | 1941 | ||
1964 | 1942 | ||
1965 | /** | 1943 | /** |
@@ -1971,7 +1949,7 @@ GNUNET_CRYPTO_rsa_public_key_free (struct GNUNET_CRYPTO_RsaPublicKey *key); | |||
1971 | * @return size of memory allocated in @a buffer | 1949 | * @return size of memory allocated in @a buffer |
1972 | */ | 1950 | */ |
1973 | size_t | 1951 | size_t |
1974 | GNUNET_CRYPTO_rsa_public_key_encode ( | 1952 | GNUNET_CRYPTO_rsa_public_key_encode( |
1975 | const struct GNUNET_CRYPTO_RsaPublicKey *key, | 1953 | const struct GNUNET_CRYPTO_RsaPublicKey *key, |
1976 | char **buffer); | 1954 | char **buffer); |
1977 | 1955 | ||
@@ -1985,7 +1963,7 @@ GNUNET_CRYPTO_rsa_public_key_encode ( | |||
1985 | * @return NULL on error | 1963 | * @return NULL on error |
1986 | */ | 1964 | */ |
1987 | struct GNUNET_CRYPTO_RsaPublicKey * | 1965 | struct GNUNET_CRYPTO_RsaPublicKey * |
1988 | GNUNET_CRYPTO_rsa_public_key_decode (const char *buf, size_t len); | 1966 | GNUNET_CRYPTO_rsa_public_key_decode(const char *buf, size_t len); |
1989 | 1967 | ||
1990 | 1968 | ||
1991 | /** | 1969 | /** |
@@ -1995,7 +1973,7 @@ GNUNET_CRYPTO_rsa_public_key_decode (const char *buf, size_t len); | |||
1995 | * @return the duplicate key; NULL upon error | 1973 | * @return the duplicate key; NULL upon error |
1996 | */ | 1974 | */ |
1997 | struct GNUNET_CRYPTO_RsaPublicKey * | 1975 | struct GNUNET_CRYPTO_RsaPublicKey * |
1998 | GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key); | 1976 | GNUNET_CRYPTO_rsa_public_key_dup(const struct GNUNET_CRYPTO_RsaPublicKey *key); |
1999 | 1977 | ||
2000 | 1978 | ||
2001 | /** | 1979 | /** |
@@ -2006,8 +1984,8 @@ GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key); | |||
2006 | * @return 0 if the two are equal | 1984 | * @return 0 if the two are equal |
2007 | */ | 1985 | */ |
2008 | int | 1986 | int |
2009 | GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_RsaSignature *s1, | 1987 | GNUNET_CRYPTO_rsa_signature_cmp(struct GNUNET_CRYPTO_RsaSignature *s1, |
2010 | struct GNUNET_CRYPTO_RsaSignature *s2); | 1988 | struct GNUNET_CRYPTO_RsaSignature *s2); |
2011 | 1989 | ||
2012 | /** | 1990 | /** |
2013 | * Compare the values of two private keys. | 1991 | * Compare the values of two private keys. |
@@ -2017,8 +1995,8 @@ GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_RsaSignature *s1, | |||
2017 | * @return 0 if the two are equal | 1995 | * @return 0 if the two are equal |
2018 | */ | 1996 | */ |
2019 | int | 1997 | int |
2020 | GNUNET_CRYPTO_rsa_private_key_cmp (struct GNUNET_CRYPTO_RsaPrivateKey *p1, | 1998 | GNUNET_CRYPTO_rsa_private_key_cmp(struct GNUNET_CRYPTO_RsaPrivateKey *p1, |
2021 | struct GNUNET_CRYPTO_RsaPrivateKey *p2); | 1999 | struct GNUNET_CRYPTO_RsaPrivateKey *p2); |
2022 | 2000 | ||
2023 | 2001 | ||
2024 | /** | 2002 | /** |
@@ -2029,8 +2007,8 @@ GNUNET_CRYPTO_rsa_private_key_cmp (struct GNUNET_CRYPTO_RsaPrivateKey *p1, | |||
2029 | * @return 0 if the two are equal | 2007 | * @return 0 if the two are equal |
2030 | */ | 2008 | */ |
2031 | int | 2009 | int |
2032 | GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_RsaPublicKey *p1, | 2010 | GNUNET_CRYPTO_rsa_public_key_cmp(struct GNUNET_CRYPTO_RsaPublicKey *p1, |
2033 | struct GNUNET_CRYPTO_RsaPublicKey *p2); | 2011 | struct GNUNET_CRYPTO_RsaPublicKey *p2); |
2034 | 2012 | ||
2035 | 2013 | ||
2036 | /** | 2014 | /** |
@@ -2044,11 +2022,11 @@ GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_RsaPublicKey *p1, | |||
2044 | * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious | 2022 | * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious |
2045 | */ | 2023 | */ |
2046 | int | 2024 | int |
2047 | GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, | 2025 | GNUNET_CRYPTO_rsa_blind(const struct GNUNET_HashCode *hash, |
2048 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, | 2026 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, |
2049 | struct GNUNET_CRYPTO_RsaPublicKey *pkey, | 2027 | struct GNUNET_CRYPTO_RsaPublicKey *pkey, |
2050 | char **buf, | 2028 | char **buf, |
2051 | size_t *buf_size); | 2029 | size_t *buf_size); |
2052 | 2030 | ||
2053 | 2031 | ||
2054 | /** | 2032 | /** |
@@ -2060,9 +2038,9 @@ GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, | |||
2060 | * @return NULL on error, signature on success | 2038 | * @return NULL on error, signature on success |
2061 | */ | 2039 | */ |
2062 | struct GNUNET_CRYPTO_RsaSignature * | 2040 | struct GNUNET_CRYPTO_RsaSignature * |
2063 | GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 2041 | GNUNET_CRYPTO_rsa_sign_blinded(const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
2064 | const void *msg, | 2042 | const void *msg, |
2065 | size_t msg_len); | 2043 | size_t msg_len); |
2066 | 2044 | ||
2067 | 2045 | ||
2068 | /** | 2046 | /** |
@@ -2073,8 +2051,8 @@ GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
2073 | * @return NULL on error, including a malicious RSA key, signature on success | 2051 | * @return NULL on error, including a malicious RSA key, signature on success |
2074 | */ | 2052 | */ |
2075 | struct GNUNET_CRYPTO_RsaSignature * | 2053 | struct GNUNET_CRYPTO_RsaSignature * |
2076 | GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 2054 | GNUNET_CRYPTO_rsa_sign_fdh(const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
2077 | const struct GNUNET_HashCode *hash); | 2055 | const struct GNUNET_HashCode *hash); |
2078 | 2056 | ||
2079 | 2057 | ||
2080 | /** | 2058 | /** |
@@ -2083,7 +2061,7 @@ GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
2083 | * @param sig memory to free | 2061 | * @param sig memory to free |
2084 | */ | 2062 | */ |
2085 | void | 2063 | void |
2086 | GNUNET_CRYPTO_rsa_signature_free (struct GNUNET_CRYPTO_RsaSignature *sig); | 2064 | GNUNET_CRYPTO_rsa_signature_free(struct GNUNET_CRYPTO_RsaSignature *sig); |
2087 | 2065 | ||
2088 | 2066 | ||
2089 | /** | 2067 | /** |
@@ -2094,7 +2072,7 @@ GNUNET_CRYPTO_rsa_signature_free (struct GNUNET_CRYPTO_RsaSignature *sig); | |||
2094 | * @return size of memory allocated in @a buffer | 2072 | * @return size of memory allocated in @a buffer |
2095 | */ | 2073 | */ |
2096 | size_t | 2074 | size_t |
2097 | GNUNET_CRYPTO_rsa_signature_encode ( | 2075 | GNUNET_CRYPTO_rsa_signature_encode( |
2098 | const struct GNUNET_CRYPTO_RsaSignature *sig, | 2076 | const struct GNUNET_CRYPTO_RsaSignature *sig, |
2099 | char **buffer); | 2077 | char **buffer); |
2100 | 2078 | ||
@@ -2108,7 +2086,7 @@ GNUNET_CRYPTO_rsa_signature_encode ( | |||
2108 | * @return NULL on error | 2086 | * @return NULL on error |
2109 | */ | 2087 | */ |
2110 | struct GNUNET_CRYPTO_RsaSignature * | 2088 | struct GNUNET_CRYPTO_RsaSignature * |
2111 | GNUNET_CRYPTO_rsa_signature_decode (const char *buf, size_t len); | 2089 | GNUNET_CRYPTO_rsa_signature_decode(const char *buf, size_t len); |
2112 | 2090 | ||
2113 | 2091 | ||
2114 | /** | 2092 | /** |
@@ -2118,7 +2096,7 @@ GNUNET_CRYPTO_rsa_signature_decode (const char *buf, size_t len); | |||
2118 | * @return the duplicate key; NULL upon error | 2096 | * @return the duplicate key; NULL upon error |
2119 | */ | 2097 | */ |
2120 | struct GNUNET_CRYPTO_RsaSignature * | 2098 | struct GNUNET_CRYPTO_RsaSignature * |
2121 | GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig); | 2099 | GNUNET_CRYPTO_rsa_signature_dup(const struct GNUNET_CRYPTO_RsaSignature *sig); |
2122 | 2100 | ||
2123 | 2101 | ||
2124 | /** | 2102 | /** |
@@ -2132,9 +2110,9 @@ GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig); | |||
2132 | * @return unblinded signature on success, NULL if RSA key is bad or malicious. | 2110 | * @return unblinded signature on success, NULL if RSA key is bad or malicious. |
2133 | */ | 2111 | */ |
2134 | struct GNUNET_CRYPTO_RsaSignature * | 2112 | struct GNUNET_CRYPTO_RsaSignature * |
2135 | GNUNET_CRYPTO_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig, | 2113 | GNUNET_CRYPTO_rsa_unblind(const struct GNUNET_CRYPTO_RsaSignature *sig, |
2136 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, | 2114 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, |
2137 | struct GNUNET_CRYPTO_RsaPublicKey *pkey); | 2115 | struct GNUNET_CRYPTO_RsaPublicKey *pkey); |
2138 | 2116 | ||
2139 | 2117 | ||
2140 | /** | 2118 | /** |
@@ -2147,9 +2125,9 @@ GNUNET_CRYPTO_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig, | |||
2147 | * @returns #GNUNET_YES if ok, #GNUNET_NO if RSA key is malicious, #GNUNET_SYSERR if signature | 2125 | * @returns #GNUNET_YES if ok, #GNUNET_NO if RSA key is malicious, #GNUNET_SYSERR if signature |
2148 | */ | 2126 | */ |
2149 | int | 2127 | int |
2150 | GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, | 2128 | GNUNET_CRYPTO_rsa_verify(const struct GNUNET_HashCode *hash, |
2151 | const struct GNUNET_CRYPTO_RsaSignature *sig, | 2129 | const struct GNUNET_CRYPTO_RsaSignature *sig, |
2152 | const struct GNUNET_CRYPTO_RsaPublicKey *public_key); | 2130 | const struct GNUNET_CRYPTO_RsaPublicKey *public_key); |
2153 | 2131 | ||
2154 | 2132 | ||
2155 | #if 0 /* keep Emacsens' auto-indent happy */ | 2133 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index e9378794e..af0e929a5 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. | 3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file src/include/gnunet_curl_lib.h | 21 | * @file src/include/gnunet_curl_lib.h |
22 | * @brief library to make it easy to download JSON replies over HTTP | 22 | * @brief library to make it easy to download JSON replies over HTTP |
@@ -54,9 +54,7 @@ typedef void | |||
54 | * @brief Buffer data structure we use to buffer the HTTP download | 54 | * @brief Buffer data structure we use to buffer the HTTP download |
55 | * before giving it to the JSON parser. | 55 | * before giving it to the JSON parser. |
56 | */ | 56 | */ |
57 | struct GNUNET_CURL_DownloadBuffer | 57 | struct GNUNET_CURL_DownloadBuffer { |
58 | { | ||
59 | |||
60 | /** | 58 | /** |
61 | * Download buffer | 59 | * Download buffer |
62 | */ | 60 | */ |
@@ -72,7 +70,6 @@ struct GNUNET_CURL_DownloadBuffer | |||
72 | * (i.e. response too large). | 70 | * (i.e. response too large). |
73 | */ | 71 | */ |
74 | int eno; | 72 | int eno; |
75 | |||
76 | }; | 73 | }; |
77 | 74 | ||
78 | 75 | ||
@@ -91,7 +88,7 @@ typedef void * | |||
91 | 88 | ||
92 | /** | 89 | /** |
93 | * Deallocate the response. | 90 | * Deallocate the response. |
94 | * | 91 | * |
95 | * @param response object to clean | 92 | * @param response object to clean |
96 | */ | 93 | */ |
97 | typedef void | 94 | typedef void |
@@ -106,8 +103,8 @@ typedef void | |||
106 | * @return library context | 103 | * @return library context |
107 | */ | 104 | */ |
108 | struct GNUNET_CURL_Context * | 105 | struct GNUNET_CURL_Context * |
109 | GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb, | 106 | GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb, |
110 | void *cb_cls); | 107 | void *cb_cls); |
111 | 108 | ||
112 | 109 | ||
113 | /** | 110 | /** |
@@ -137,12 +134,12 @@ GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb, | |||
137 | * proceed immediately with #GNUNET_CURL_perform(). | 134 | * proceed immediately with #GNUNET_CURL_perform(). |
138 | */ | 135 | */ |
139 | void | 136 | void |
140 | GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx, | 137 | GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx, |
141 | fd_set *read_fd_set, | 138 | fd_set *read_fd_set, |
142 | fd_set *write_fd_set, | 139 | fd_set *write_fd_set, |
143 | fd_set *except_fd_set, | 140 | fd_set *except_fd_set, |
144 | int *max_fd, | 141 | int *max_fd, |
145 | long *timeout); | 142 | long *timeout); |
146 | 143 | ||
147 | 144 | ||
148 | /** | 145 | /** |
@@ -153,8 +150,8 @@ GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx, | |||
153 | * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. | 150 | * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. |
154 | */ | 151 | */ |
155 | int | 152 | int |
156 | GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, | 153 | GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx, |
157 | const char *header); | 154 | const char *header); |
158 | 155 | ||
159 | /** | 156 | /** |
160 | * Run the main event loop for the CURL interaction. | 157 | * Run the main event loop for the CURL interaction. |
@@ -162,7 +159,7 @@ GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, | |||
162 | * @param ctx the library context | 159 | * @param ctx the library context |
163 | */ | 160 | */ |
164 | void | 161 | void |
165 | GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx); | 162 | GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx); |
166 | 163 | ||
167 | 164 | ||
168 | /** | 165 | /** |
@@ -174,9 +171,9 @@ GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx); | |||
174 | * @param rc cleans/frees the response | 171 | * @param rc cleans/frees the response |
175 | */ | 172 | */ |
176 | void | 173 | void |
177 | GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx, | 174 | GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx, |
178 | GNUNET_CURL_RawParser rp, | 175 | GNUNET_CURL_RawParser rp, |
179 | GNUNET_CURL_ResponseCleaner rc); | 176 | GNUNET_CURL_ResponseCleaner rc); |
180 | 177 | ||
181 | /** | 178 | /** |
182 | * Cleanup library initialisation resources. This function should be called | 179 | * Cleanup library initialisation resources. This function should be called |
@@ -186,7 +183,7 @@ GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx, | |||
186 | * @param ctx the library context | 183 | * @param ctx the library context |
187 | */ | 184 | */ |
188 | void | 185 | void |
189 | GNUNET_CURL_fini (struct GNUNET_CURL_Context *ctx); | 186 | GNUNET_CURL_fini(struct GNUNET_CURL_Context *ctx); |
190 | 187 | ||
191 | 188 | ||
192 | /** | 189 | /** |
@@ -224,11 +221,11 @@ typedef void | |||
224 | * @return NULL on error (in this case, @eh is still released!) | 221 | * @return NULL on error (in this case, @eh is still released!) |
225 | */ | 222 | */ |
226 | struct GNUNET_CURL_Job * | 223 | struct GNUNET_CURL_Job * |
227 | GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, | 224 | GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx, |
228 | CURL *eh, | 225 | CURL *eh, |
229 | int add_json, | 226 | int add_json, |
230 | GNUNET_CURL_JobCompletionCallback jcc, | 227 | GNUNET_CURL_JobCompletionCallback jcc, |
231 | void *jcc_cls); | 228 | void *jcc_cls); |
232 | 229 | ||
233 | 230 | ||
234 | /** | 231 | /** |
@@ -248,7 +245,7 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, | |||
248 | * @return NULL on error (in this case, @eh is still released!) | 245 | * @return NULL on error (in this case, @eh is still released!) |
249 | */ | 246 | */ |
250 | struct GNUNET_CURL_Job * | 247 | struct GNUNET_CURL_Job * |
251 | GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx, | 248 | GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx, |
252 | CURL *eh, | 249 | CURL *eh, |
253 | const struct curl_slist *job_headers, | 250 | const struct curl_slist *job_headers, |
254 | GNUNET_CURL_JobCompletionCallback jcc, | 251 | GNUNET_CURL_JobCompletionCallback jcc, |
@@ -262,7 +259,7 @@ GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx, | |||
262 | * @param job job to cancel | 259 | * @param job job to cancel |
263 | */ | 260 | */ |
264 | void | 261 | void |
265 | GNUNET_CURL_job_cancel (struct GNUNET_CURL_Job *job); | 262 | GNUNET_CURL_job_cancel(struct GNUNET_CURL_Job *job); |
266 | 263 | ||
267 | 264 | ||
268 | /* ******* GNUnet SCHEDULER integration ************ */ | 265 | /* ******* GNUnet SCHEDULER integration ************ */ |
@@ -281,7 +278,7 @@ struct GNUNET_CURL_RescheduleContext; | |||
281 | * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). | 278 | * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). |
282 | */ | 279 | */ |
283 | struct GNUNET_CURL_RescheduleContext * | 280 | struct GNUNET_CURL_RescheduleContext * |
284 | GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx); | 281 | GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx); |
285 | 282 | ||
286 | /** | 283 | /** |
287 | * Initialize reschedule context; with custom response parser | 284 | * Initialize reschedule context; with custom response parser |
@@ -290,9 +287,9 @@ GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx); | |||
290 | * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). | 287 | * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). |
291 | */ | 288 | */ |
292 | struct GNUNET_CURL_RescheduleContext * | 289 | struct GNUNET_CURL_RescheduleContext * |
293 | GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, | 290 | GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, |
294 | GNUNET_CURL_RawParser rp, | 291 | GNUNET_CURL_RawParser rp, |
295 | GNUNET_CURL_ResponseCleaner rc); | 292 | GNUNET_CURL_ResponseCleaner rc); |
296 | 293 | ||
297 | 294 | ||
298 | /** | 295 | /** |
@@ -301,7 +298,7 @@ GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, | |||
301 | * @param rc context to destroy | 298 | * @param rc context to destroy |
302 | */ | 299 | */ |
303 | void | 300 | void |
304 | GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc); | 301 | GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc); |
305 | 302 | ||
306 | 303 | ||
307 | /** | 304 | /** |
@@ -314,7 +311,7 @@ GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc); | |||
314 | * (pointer to a pointer!) | 311 | * (pointer to a pointer!) |
315 | */ | 312 | */ |
316 | void | 313 | void |
317 | GNUNET_CURL_gnunet_scheduler_reschedule (void *cls); | 314 | GNUNET_CURL_gnunet_scheduler_reschedule(void *cls); |
318 | 315 | ||
319 | 316 | ||
320 | /** | 317 | /** |
@@ -324,7 +321,7 @@ GNUNET_CURL_gnunet_scheduler_reschedule (void *cls); | |||
324 | * @param header_name name of the header to send. | 321 | * @param header_name name of the header to send. |
325 | */ | 322 | */ |
326 | void | 323 | void |
327 | GNUNET_CURL_enable_async_scope_header (struct GNUNET_CURL_Context *ctx, const char *header_name); | 324 | GNUNET_CURL_enable_async_scope_header(struct GNUNET_CURL_Context *ctx, const char *header_name); |
328 | 325 | ||
329 | 326 | ||
330 | #endif | 327 | #endif |
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 568e60d42..19de3ceea 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -63,8 +63,8 @@ struct GNUNET_DATACACHE_Handle; | |||
63 | * @return handle to use to access the service | 63 | * @return handle to use to access the service |
64 | */ | 64 | */ |
65 | struct GNUNET_DATACACHE_Handle * | 65 | struct GNUNET_DATACACHE_Handle * |
66 | GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 66 | GNUNET_DATACACHE_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
67 | const char *section); | 67 | const char *section); |
68 | 68 | ||
69 | 69 | ||
70 | /** | 70 | /** |
@@ -73,7 +73,7 @@ GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
73 | * @param h handle to the datastore | 73 | * @param h handle to the datastore |
74 | */ | 74 | */ |
75 | void | 75 | void |
76 | GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | 76 | GNUNET_DATACACHE_destroy(struct GNUNET_DATACACHE_Handle *h); |
77 | 77 | ||
78 | 78 | ||
79 | /** | 79 | /** |
@@ -115,15 +115,15 @@ typedef int | |||
115 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error, #GNUNET_NO if duplicate | 115 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error, #GNUNET_NO if duplicate |
116 | */ | 116 | */ |
117 | int | 117 | int |
118 | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | 118 | GNUNET_DATACACHE_put(struct GNUNET_DATACACHE_Handle *h, |
119 | const struct GNUNET_HashCode *key, | 119 | const struct GNUNET_HashCode *key, |
120 | uint32_t xor_distance, | 120 | uint32_t xor_distance, |
121 | size_t data_size, | 121 | size_t data_size, |
122 | const char *data, | 122 | const char *data, |
123 | enum GNUNET_BLOCK_Type type, | 123 | enum GNUNET_BLOCK_Type type, |
124 | struct GNUNET_TIME_Absolute discard_time, | 124 | struct GNUNET_TIME_Absolute discard_time, |
125 | unsigned int path_info_len, | 125 | unsigned int path_info_len, |
126 | const struct GNUNET_PeerIdentity *path_info); | 126 | const struct GNUNET_PeerIdentity *path_info); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -138,11 +138,11 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | |||
138 | * @return the number of results found | 138 | * @return the number of results found |
139 | */ | 139 | */ |
140 | unsigned int | 140 | unsigned int |
141 | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | 141 | GNUNET_DATACACHE_get(struct GNUNET_DATACACHE_Handle *h, |
142 | const struct GNUNET_HashCode *key, | 142 | const struct GNUNET_HashCode *key, |
143 | enum GNUNET_BLOCK_Type type, | 143 | enum GNUNET_BLOCK_Type type, |
144 | GNUNET_DATACACHE_Iterator iter, | 144 | GNUNET_DATACACHE_Iterator iter, |
145 | void *iter_cls); | 145 | void *iter_cls); |
146 | 146 | ||
147 | 147 | ||
148 | /** | 148 | /** |
@@ -154,9 +154,9 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | |||
154 | * @return the number of results found (zero or 1) | 154 | * @return the number of results found (zero or 1) |
155 | */ | 155 | */ |
156 | unsigned int | 156 | unsigned int |
157 | GNUNET_DATACACHE_get_random (struct GNUNET_DATACACHE_Handle *h, | 157 | GNUNET_DATACACHE_get_random(struct GNUNET_DATACACHE_Handle *h, |
158 | GNUNET_DATACACHE_Iterator iter, | 158 | GNUNET_DATACACHE_Iterator iter, |
159 | void *iter_cls); | 159 | void *iter_cls); |
160 | 160 | ||
161 | 161 | ||
162 | /** | 162 | /** |
@@ -173,11 +173,11 @@ GNUNET_DATACACHE_get_random (struct GNUNET_DATACACHE_Handle *h, | |||
173 | * @return the number of results found | 173 | * @return the number of results found |
174 | */ | 174 | */ |
175 | unsigned int | 175 | unsigned int |
176 | GNUNET_DATACACHE_get_closest (struct GNUNET_DATACACHE_Handle *h, | 176 | GNUNET_DATACACHE_get_closest(struct GNUNET_DATACACHE_Handle *h, |
177 | const struct GNUNET_HashCode *key, | 177 | const struct GNUNET_HashCode *key, |
178 | unsigned int num_results, | 178 | unsigned int num_results, |
179 | GNUNET_DATACACHE_Iterator iter, | 179 | GNUNET_DATACACHE_Iterator iter, |
180 | void *iter_cls); | 180 | void *iter_cls); |
181 | 181 | ||
182 | 182 | ||
183 | #if 0 /* keep Emacsens' auto-indent happy */ | 183 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h index 5a4e6dc0d..b4e6dbe8e 100644 --- a/src/include/gnunet_datacache_plugin.h +++ b/src/include/gnunet_datacache_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -61,9 +61,7 @@ typedef void | |||
61 | * of this type as the first and only argument to the | 61 | * of this type as the first and only argument to the |
62 | * entry point of each datastore plugin. | 62 | * entry point of each datastore plugin. |
63 | */ | 63 | */ |
64 | struct GNUNET_DATACACHE_PluginEnvironment | 64 | struct GNUNET_DATACACHE_PluginEnvironment { |
65 | { | ||
66 | |||
67 | /** | 65 | /** |
68 | * Configuration to use. | 66 | * Configuration to use. |
69 | */ | 67 | */ |
@@ -89,16 +87,13 @@ struct GNUNET_DATACACHE_PluginEnvironment | |||
89 | * How much space are we allowed to use? | 87 | * How much space are we allowed to use? |
90 | */ | 88 | */ |
91 | unsigned long long quota; | 89 | unsigned long long quota; |
92 | |||
93 | }; | 90 | }; |
94 | 91 | ||
95 | 92 | ||
96 | /** | 93 | /** |
97 | * @brief struct returned by the initialization function of the plugin | 94 | * @brief struct returned by the initialization function of the plugin |
98 | */ | 95 | */ |
99 | struct GNUNET_DATACACHE_PluginFunctions | 96 | struct GNUNET_DATACACHE_PluginFunctions { |
100 | { | ||
101 | |||
102 | /** | 97 | /** |
103 | * Closure to pass to all plugin functions. | 98 | * Closure to pass to all plugin functions. |
104 | */ | 99 | */ |
@@ -122,11 +117,11 @@ struct GNUNET_DATACACHE_PluginFunctions | |||
122 | const struct GNUNET_HashCode *key, | 117 | const struct GNUNET_HashCode *key, |
123 | uint32_t xor_distance, | 118 | uint32_t xor_distance, |
124 | size_t size, | 119 | size_t size, |
125 | const char *data, | 120 | const char *data, |
126 | enum GNUNET_BLOCK_Type type, | 121 | enum GNUNET_BLOCK_Type type, |
127 | struct GNUNET_TIME_Absolute discard_time, | 122 | struct GNUNET_TIME_Absolute discard_time, |
128 | unsigned int path_info_len, | 123 | unsigned int path_info_len, |
129 | const struct GNUNET_PeerIdentity *path_info); | 124 | const struct GNUNET_PeerIdentity *path_info); |
130 | 125 | ||
131 | /** | 126 | /** |
132 | * Iterate over the results for a particular key | 127 | * Iterate over the results for a particular key |
@@ -185,7 +180,6 @@ struct GNUNET_DATACACHE_PluginFunctions | |||
185 | unsigned int num_results, | 180 | unsigned int num_results, |
186 | GNUNET_DATACACHE_Iterator iter, | 181 | GNUNET_DATACACHE_Iterator iter, |
187 | void *iter_cls); | 182 | void *iter_cls); |
188 | |||
189 | }; | 183 | }; |
190 | 184 | ||
191 | 185 | ||
diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h index ccd604845..95b12f7ad 100644 --- a/src/include/gnunet_datastore_plugin.h +++ b/src/include/gnunet_datastore_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -55,7 +55,7 @@ | |||
55 | */ | 55 | */ |
56 | typedef void | 56 | typedef void |
57 | (*GNUNET_DATASTORE_DiskUtilizationChange) (void *cls, | 57 | (*GNUNET_DATASTORE_DiskUtilizationChange) (void *cls, |
58 | int delta); | 58 | int delta); |
59 | 59 | ||
60 | 60 | ||
61 | /** | 61 | /** |
@@ -63,8 +63,7 @@ typedef void | |||
63 | * of this type as the first and only argument to the | 63 | * of this type as the first and only argument to the |
64 | * entry point of each datastore plugin. | 64 | * entry point of each datastore plugin. |
65 | */ | 65 | */ |
66 | struct GNUNET_DATASTORE_PluginEnvironment | 66 | struct GNUNET_DATASTORE_PluginEnvironment { |
67 | { | ||
68 | /** | 67 | /** |
69 | * Configuration to use. | 68 | * Configuration to use. |
70 | */ | 69 | */ |
@@ -79,7 +78,6 @@ struct GNUNET_DATASTORE_PluginEnvironment | |||
79 | * Closure. | 78 | * Closure. |
80 | */ | 79 | */ |
81 | void *cls; | 80 | void *cls; |
82 | |||
83 | }; | 81 | }; |
84 | 82 | ||
85 | 83 | ||
@@ -125,7 +123,7 @@ typedef int | |||
125 | */ | 123 | */ |
126 | typedef void | 124 | typedef void |
127 | (*PluginEstimateSize) (void *cls, | 125 | (*PluginEstimateSize) (void *cls, |
128 | unsigned long long *estimate); | 126 | unsigned long long *estimate); |
129 | 127 | ||
130 | 128 | ||
131 | /** | 129 | /** |
@@ -140,10 +138,10 @@ typedef void | |||
140 | */ | 138 | */ |
141 | typedef void | 139 | typedef void |
142 | (*PluginPutCont) (void *cls, | 140 | (*PluginPutCont) (void *cls, |
143 | const struct GNUNET_HashCode *key, | 141 | const struct GNUNET_HashCode *key, |
144 | uint32_t size, | 142 | uint32_t size, |
145 | int status, | 143 | int status, |
146 | const char *msg); | 144 | const char *msg); |
147 | 145 | ||
148 | 146 | ||
149 | /** | 147 | /** |
@@ -188,8 +186,8 @@ typedef void | |||
188 | */ | 186 | */ |
189 | typedef void | 187 | typedef void |
190 | (*PluginKeyProcessor) (void *cls, | 188 | (*PluginKeyProcessor) (void *cls, |
191 | const struct GNUNET_HashCode *key, | 189 | const struct GNUNET_HashCode *key, |
192 | unsigned int count); | 190 | unsigned int count); |
193 | 191 | ||
194 | 192 | ||
195 | /** | 193 | /** |
@@ -201,7 +199,7 @@ typedef void | |||
201 | */ | 199 | */ |
202 | typedef void | 200 | typedef void |
203 | (*PluginGetKeys) (void *cls, | 201 | (*PluginGetKeys) (void *cls, |
204 | PluginKeyProcessor proc, | 202 | PluginKeyProcessor proc, |
205 | void *proc_cls); | 203 | void *proc_cls); |
206 | 204 | ||
207 | 205 | ||
@@ -277,8 +275,8 @@ typedef void | |||
277 | */ | 275 | */ |
278 | typedef void | 276 | typedef void |
279 | (*PluginGetRandom) (void *cls, | 277 | (*PluginGetRandom) (void *cls, |
280 | PluginDatumProcessor proc, | 278 | PluginDatumProcessor proc, |
281 | void *proc_cls); | 279 | void *proc_cls); |
282 | 280 | ||
283 | 281 | ||
284 | /** | 282 | /** |
@@ -313,9 +311,7 @@ typedef void | |||
313 | * Each plugin is required to return a pointer to a struct of this | 311 | * Each plugin is required to return a pointer to a struct of this |
314 | * type as the return value from its entry point. | 312 | * type as the return value from its entry point. |
315 | */ | 313 | */ |
316 | struct GNUNET_DATASTORE_PluginFunctions | 314 | struct GNUNET_DATASTORE_PluginFunctions { |
317 | { | ||
318 | |||
319 | /** | 315 | /** |
320 | * Closure to use for all of the following callbacks | 316 | * Closure to use for all of the following callbacks |
321 | * (except "next_request"). | 317 | * (except "next_request"). |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index b5b9d4306..e4cd4a915 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -72,7 +72,7 @@ struct GNUNET_DATASTORE_Handle; | |||
72 | * @return handle to use to access the service | 72 | * @return handle to use to access the service |
73 | */ | 73 | */ |
74 | struct GNUNET_DATASTORE_Handle * | 74 | struct GNUNET_DATASTORE_Handle * |
75 | GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 75 | GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
76 | 76 | ||
77 | 77 | ||
78 | /** | 78 | /** |
@@ -83,8 +83,8 @@ GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
83 | * @param drop set to #GNUNET_YES to delete all data in datastore (!) | 83 | * @param drop set to #GNUNET_YES to delete all data in datastore (!) |
84 | */ | 84 | */ |
85 | void | 85 | void |
86 | GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, | 86 | GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, |
87 | int drop); | 87 | int drop); |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
@@ -123,11 +123,11 @@ typedef void | |||
123 | * (or rather, will already have been invoked) | 123 | * (or rather, will already have been invoked) |
124 | */ | 124 | */ |
125 | struct GNUNET_DATASTORE_QueueEntry * | 125 | struct GNUNET_DATASTORE_QueueEntry * |
126 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | 126 | GNUNET_DATASTORE_reserve(struct GNUNET_DATASTORE_Handle *h, |
127 | uint64_t amount, | 127 | uint64_t amount, |
128 | uint32_t entries, | 128 | uint32_t entries, |
129 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 129 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
130 | void *cont_cls); | 130 | void *cont_cls); |
131 | 131 | ||
132 | 132 | ||
133 | /** | 133 | /** |
@@ -156,20 +156,20 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
156 | * (or rather, will already have been invoked) | 156 | * (or rather, will already have been invoked) |
157 | */ | 157 | */ |
158 | struct GNUNET_DATASTORE_QueueEntry * | 158 | struct GNUNET_DATASTORE_QueueEntry * |
159 | GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | 159 | GNUNET_DATASTORE_put(struct GNUNET_DATASTORE_Handle *h, |
160 | uint32_t rid, | 160 | uint32_t rid, |
161 | const struct GNUNET_HashCode *key, | 161 | const struct GNUNET_HashCode *key, |
162 | size_t size, | 162 | size_t size, |
163 | const void *data, | 163 | const void *data, |
164 | enum GNUNET_BLOCK_Type type, | 164 | enum GNUNET_BLOCK_Type type, |
165 | uint32_t priority, | 165 | uint32_t priority, |
166 | uint32_t anonymity, | 166 | uint32_t anonymity, |
167 | uint32_t replication, | 167 | uint32_t replication, |
168 | struct GNUNET_TIME_Absolute expiration, | 168 | struct GNUNET_TIME_Absolute expiration, |
169 | unsigned int queue_priority, | 169 | unsigned int queue_priority, |
170 | unsigned int max_queue_size, | 170 | unsigned int max_queue_size, |
171 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 171 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
172 | void *cont_cls); | 172 | void *cont_cls); |
173 | 173 | ||
174 | 174 | ||
175 | /** | 175 | /** |
@@ -193,11 +193,11 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
193 | * (or rather, will already have been invoked) | 193 | * (or rather, will already have been invoked) |
194 | */ | 194 | */ |
195 | struct GNUNET_DATASTORE_QueueEntry * | 195 | struct GNUNET_DATASTORE_QueueEntry * |
196 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | 196 | GNUNET_DATASTORE_release_reserve(struct GNUNET_DATASTORE_Handle *h, |
197 | uint32_t rid, unsigned int queue_priority, | 197 | uint32_t rid, unsigned int queue_priority, |
198 | unsigned int max_queue_size, | 198 | unsigned int max_queue_size, |
199 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 199 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
200 | void *cont_cls); | 200 | void *cont_cls); |
201 | 201 | ||
202 | 202 | ||
203 | /** | 203 | /** |
@@ -220,14 +220,14 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
220 | * (or rather, will already have been invoked) | 220 | * (or rather, will already have been invoked) |
221 | */ | 221 | */ |
222 | struct GNUNET_DATASTORE_QueueEntry * | 222 | struct GNUNET_DATASTORE_QueueEntry * |
223 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | 223 | GNUNET_DATASTORE_remove(struct GNUNET_DATASTORE_Handle *h, |
224 | const struct GNUNET_HashCode *key, | 224 | const struct GNUNET_HashCode *key, |
225 | size_t size, | 225 | size_t size, |
226 | const void *data, | 226 | const void *data, |
227 | unsigned int queue_priority, | 227 | unsigned int queue_priority, |
228 | unsigned int max_queue_size, | 228 | unsigned int max_queue_size, |
229 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 229 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
230 | void *cont_cls); | 230 | void *cont_cls); |
231 | 231 | ||
232 | 232 | ||
233 | /** | 233 | /** |
@@ -277,15 +277,15 @@ typedef void | |||
277 | * cancel | 277 | * cancel |
278 | */ | 278 | */ |
279 | struct GNUNET_DATASTORE_QueueEntry * | 279 | struct GNUNET_DATASTORE_QueueEntry * |
280 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, | 280 | GNUNET_DATASTORE_get_key(struct GNUNET_DATASTORE_Handle *h, |
281 | uint64_t next_uid, | 281 | uint64_t next_uid, |
282 | bool random, | 282 | bool random, |
283 | const struct GNUNET_HashCode *key, | 283 | const struct GNUNET_HashCode *key, |
284 | enum GNUNET_BLOCK_Type type, | 284 | enum GNUNET_BLOCK_Type type, |
285 | unsigned int queue_priority, | 285 | unsigned int queue_priority, |
286 | unsigned int max_queue_size, | 286 | unsigned int max_queue_size, |
287 | GNUNET_DATASTORE_DatumProcessor proc, | 287 | GNUNET_DATASTORE_DatumProcessor proc, |
288 | void *proc_cls); | 288 | void *proc_cls); |
289 | 289 | ||
290 | 290 | ||
291 | /** | 291 | /** |
@@ -305,13 +305,13 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, | |||
305 | * cancel | 305 | * cancel |
306 | */ | 306 | */ |
307 | struct GNUNET_DATASTORE_QueueEntry * | 307 | struct GNUNET_DATASTORE_QueueEntry * |
308 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | 308 | GNUNET_DATASTORE_get_zero_anonymity(struct GNUNET_DATASTORE_Handle *h, |
309 | uint64_t next_uid, | 309 | uint64_t next_uid, |
310 | unsigned int queue_priority, | 310 | unsigned int queue_priority, |
311 | unsigned int max_queue_size, | 311 | unsigned int max_queue_size, |
312 | enum GNUNET_BLOCK_Type type, | 312 | enum GNUNET_BLOCK_Type type, |
313 | GNUNET_DATASTORE_DatumProcessor proc, | 313 | GNUNET_DATASTORE_DatumProcessor proc, |
314 | void *proc_cls); | 314 | void *proc_cls); |
315 | 315 | ||
316 | 316 | ||
317 | /** | 317 | /** |
@@ -333,11 +333,11 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | |||
333 | * cancel | 333 | * cancel |
334 | */ | 334 | */ |
335 | struct GNUNET_DATASTORE_QueueEntry * | 335 | struct GNUNET_DATASTORE_QueueEntry * |
336 | GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, | 336 | GNUNET_DATASTORE_get_for_replication(struct GNUNET_DATASTORE_Handle *h, |
337 | unsigned int queue_priority, | 337 | unsigned int queue_priority, |
338 | unsigned int max_queue_size, | 338 | unsigned int max_queue_size, |
339 | GNUNET_DATASTORE_DatumProcessor proc, | 339 | GNUNET_DATASTORE_DatumProcessor proc, |
340 | void *proc_cls); | 340 | void *proc_cls); |
341 | 341 | ||
342 | 342 | ||
343 | 343 | ||
@@ -348,7 +348,7 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, | |||
348 | * @param qe operation to cancel | 348 | * @param qe operation to cancel |
349 | */ | 349 | */ |
350 | void | 350 | void |
351 | GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | 351 | GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe); |
352 | 352 | ||
353 | 353 | ||
354 | #if 0 /* keep Emacsens' auto-indent happy */ | 354 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h index ea3b8d519..c7568c934 100644 --- a/src/include/gnunet_db_lib.h +++ b/src/include/gnunet_db_lib.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2017 GNUnet e.V. | 3 | Copyright (C) 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file include/gnunet_db_lib.h | 21 | * @file include/gnunet_db_lib.h |
22 | * @brief shared defintions for transactional databases | 22 | * @brief shared defintions for transactional databases |
@@ -31,8 +31,7 @@ | |||
31 | * Can be combined with a function that returns the number | 31 | * Can be combined with a function that returns the number |
32 | * of results, so all non-negative values indicate success. | 32 | * of results, so all non-negative values indicate success. |
33 | */ | 33 | */ |
34 | enum GNUNET_DB_QueryStatus | 34 | enum GNUNET_DB_QueryStatus { |
35 | { | ||
36 | /** | 35 | /** |
37 | * A hard error occurred, retrying will not help. | 36 | * A hard error occurred, retrying will not help. |
38 | */ | 37 | */ |
@@ -57,9 +56,8 @@ enum GNUNET_DB_QueryStatus | |||
57 | */ | 56 | */ |
58 | GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1 | 57 | GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1 |
59 | 58 | ||
60 | /* Larger values may be returned for SELECT statements | 59 | /* Larger values may be returned for SELECT statements |
61 | that returned more than one result. */ | 60 | that returned more than one result. */ |
62 | |||
63 | }; | 61 | }; |
64 | 62 | ||
65 | #endif | 63 | #endif |
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index d9bbccbdf..e22d2b5df 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -74,8 +74,7 @@ struct GNUNET_DHT_FindPeerHandle; | |||
74 | /** | 74 | /** |
75 | * Options for routing. | 75 | * Options for routing. |
76 | */ | 76 | */ |
77 | enum GNUNET_DHT_RouteOption | 77 | enum GNUNET_DHT_RouteOption { |
78 | { | ||
79 | /** | 78 | /** |
80 | * Default. Do nothing special. | 79 | * Default. Do nothing special. |
81 | */ | 80 | */ |
@@ -119,8 +118,8 @@ enum GNUNET_DHT_RouteOption | |||
119 | * @return NULL on error | 118 | * @return NULL on error |
120 | */ | 119 | */ |
121 | struct GNUNET_DHT_Handle * | 120 | struct GNUNET_DHT_Handle * |
122 | GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 121 | GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
123 | unsigned int ht_len); | 122 | unsigned int ht_len); |
124 | 123 | ||
125 | 124 | ||
126 | /** | 125 | /** |
@@ -129,7 +128,7 @@ GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
129 | * @param handle connection to shut down | 128 | * @param handle connection to shut down |
130 | */ | 129 | */ |
131 | void | 130 | void |
132 | GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | 131 | GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle); |
133 | 132 | ||
134 | 133 | ||
135 | /* *************** Standard API: get and put ******************* */ | 134 | /* *************** Standard API: get and put ******************* */ |
@@ -160,16 +159,16 @@ struct GNUNET_DHT_PutHandle; | |||
160 | * (size too big) | 159 | * (size too big) |
161 | */ | 160 | */ |
162 | struct GNUNET_DHT_PutHandle * | 161 | struct GNUNET_DHT_PutHandle * |
163 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | 162 | GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle, |
164 | const struct GNUNET_HashCode *key, | 163 | const struct GNUNET_HashCode *key, |
165 | uint32_t desired_replication_level, | 164 | uint32_t desired_replication_level, |
166 | enum GNUNET_DHT_RouteOption options, | 165 | enum GNUNET_DHT_RouteOption options, |
167 | enum GNUNET_BLOCK_Type type, | 166 | enum GNUNET_BLOCK_Type type, |
168 | size_t size, | 167 | size_t size, |
169 | const void *data, | 168 | const void *data, |
170 | struct GNUNET_TIME_Absolute exp, | 169 | struct GNUNET_TIME_Absolute exp, |
171 | GNUNET_SCHEDULER_TaskCallback cont, | 170 | GNUNET_SCHEDULER_TaskCallback cont, |
172 | void *cont_cls); | 171 | void *cont_cls); |
173 | 172 | ||
174 | 173 | ||
175 | /** | 174 | /** |
@@ -184,7 +183,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | |||
184 | * @param ph put operation to cancel ('cont' will no longer be called) | 183 | * @param ph put operation to cancel ('cont' will no longer be called) |
185 | */ | 184 | */ |
186 | void | 185 | void |
187 | GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph); | 186 | GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph); |
188 | 187 | ||
189 | 188 | ||
190 | /** | 189 | /** |
@@ -234,15 +233,15 @@ typedef void | |||
234 | * @return handle to stop the async get | 233 | * @return handle to stop the async get |
235 | */ | 234 | */ |
236 | struct GNUNET_DHT_GetHandle * | 235 | struct GNUNET_DHT_GetHandle * |
237 | GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | 236 | GNUNET_DHT_get_start(struct GNUNET_DHT_Handle *handle, |
238 | enum GNUNET_BLOCK_Type type, | 237 | enum GNUNET_BLOCK_Type type, |
239 | const struct GNUNET_HashCode *key, | 238 | const struct GNUNET_HashCode *key, |
240 | uint32_t desired_replication_level, | 239 | uint32_t desired_replication_level, |
241 | enum GNUNET_DHT_RouteOption options, | 240 | enum GNUNET_DHT_RouteOption options, |
242 | const void *xquery, | 241 | const void *xquery, |
243 | size_t xquery_size, | 242 | size_t xquery_size, |
244 | GNUNET_DHT_GetIterator iter, | 243 | GNUNET_DHT_GetIterator iter, |
245 | void *iter_cls); | 244 | void *iter_cls); |
246 | 245 | ||
247 | 246 | ||
248 | /** | 247 | /** |
@@ -256,9 +255,9 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | |||
256 | * to be blocked | 255 | * to be blocked |
257 | */ | 256 | */ |
258 | void | 257 | void |
259 | GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, | 258 | GNUNET_DHT_get_filter_known_results(struct GNUNET_DHT_GetHandle *get_handle, |
260 | unsigned int num_results, | 259 | unsigned int num_results, |
261 | const struct GNUNET_HashCode *results); | 260 | const struct GNUNET_HashCode *results); |
262 | 261 | ||
263 | /** | 262 | /** |
264 | * Stop async DHT-get. Frees associated resources. | 263 | * Stop async DHT-get. Frees associated resources. |
@@ -266,7 +265,7 @@ GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, | |||
266 | * @param get_handle GET operation to stop. | 265 | * @param get_handle GET operation to stop. |
267 | */ | 266 | */ |
268 | void | 267 | void |
269 | GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | 268 | GNUNET_DHT_get_stop(struct GNUNET_DHT_GetHandle *get_handle); |
270 | 269 | ||
271 | 270 | ||
272 | /* *************** Extended API: monitor ******************* */ | 271 | /* *************** Extended API: monitor ******************* */ |
@@ -369,13 +368,13 @@ typedef void | |||
369 | * @return Handle to stop monitoring. | 368 | * @return Handle to stop monitoring. |
370 | */ | 369 | */ |
371 | struct GNUNET_DHT_MonitorHandle * | 370 | struct GNUNET_DHT_MonitorHandle * |
372 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | 371 | GNUNET_DHT_monitor_start(struct GNUNET_DHT_Handle *handle, |
373 | enum GNUNET_BLOCK_Type type, | 372 | enum GNUNET_BLOCK_Type type, |
374 | const struct GNUNET_HashCode *key, | 373 | const struct GNUNET_HashCode *key, |
375 | GNUNET_DHT_MonitorGetCB get_cb, | 374 | GNUNET_DHT_MonitorGetCB get_cb, |
376 | GNUNET_DHT_MonitorGetRespCB get_resp_cb, | 375 | GNUNET_DHT_MonitorGetRespCB get_resp_cb, |
377 | GNUNET_DHT_MonitorPutCB put_cb, | 376 | GNUNET_DHT_MonitorPutCB put_cb, |
378 | void *cb_cls); | 377 | void *cb_cls); |
379 | 378 | ||
380 | 379 | ||
381 | /** | 380 | /** |
@@ -386,7 +385,7 @@ GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | |||
386 | * #GNUNET_DHT_monitor_start(). | 385 | * #GNUNET_DHT_monitor_start(). |
387 | */ | 386 | */ |
388 | void | 387 | void |
389 | GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle); | 388 | GNUNET_DHT_monitor_stop(struct GNUNET_DHT_MonitorHandle *handle); |
390 | 389 | ||
391 | 390 | ||
392 | #if 0 /* keep Emacsens' auto-indent happy */ | 391 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 367789722..f693615f1 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -38,8 +38,7 @@ struct GNUNET_DISK_PipeHandle; | |||
38 | /** | 38 | /** |
39 | * Type of a handle. | 39 | * Type of a handle. |
40 | */ | 40 | */ |
41 | enum GNUNET_FILE_Type | 41 | enum GNUNET_FILE_Type { |
42 | { | ||
43 | /** | 42 | /** |
44 | * Handle represents an event. | 43 | * Handle represents an event. |
45 | */ | 44 | */ |
@@ -59,9 +58,7 @@ enum GNUNET_FILE_Type | |||
59 | /** | 58 | /** |
60 | * Handle used to access files (and pipes). | 59 | * Handle used to access files (and pipes). |
61 | */ | 60 | */ |
62 | struct GNUNET_DISK_FileHandle | 61 | struct GNUNET_DISK_FileHandle { |
63 | { | ||
64 | |||
65 | #if WINDOWS | 62 | #if WINDOWS |
66 | /** | 63 | /** |
67 | * File handle under W32. | 64 | * File handle under W32. |
@@ -83,12 +80,10 @@ struct GNUNET_DISK_FileHandle | |||
83 | */ | 80 | */ |
84 | OVERLAPPED *oOverlapWrite; | 81 | OVERLAPPED *oOverlapWrite; |
85 | #else | 82 | #else |
86 | |||
87 | /** | 83 | /** |
88 | * File handle on other OSes. | 84 | * File handle on other OSes. |
89 | */ | 85 | */ |
90 | int fd; | 86 | int fd; |
91 | |||
92 | #endif | 87 | #endif |
93 | }; | 88 | }; |
94 | 89 | ||
@@ -113,9 +108,7 @@ extern "C" | |||
113 | /** | 108 | /** |
114 | * Specifies how a file should be opened. | 109 | * Specifies how a file should be opened. |
115 | */ | 110 | */ |
116 | enum GNUNET_DISK_OpenFlags | 111 | enum GNUNET_DISK_OpenFlags { |
117 | { | ||
118 | |||
119 | /** | 112 | /** |
120 | * Open the file for reading | 113 | * Open the file for reading |
121 | */ | 114 | */ |
@@ -155,8 +148,7 @@ enum GNUNET_DISK_OpenFlags | |||
155 | /** | 148 | /** |
156 | * Specifies what type of memory map is desired. | 149 | * Specifies what type of memory map is desired. |
157 | */ | 150 | */ |
158 | enum GNUNET_DISK_MapType | 151 | enum GNUNET_DISK_MapType { |
159 | { | ||
160 | /** | 152 | /** |
161 | * Read-only memory map. | 153 | * Read-only memory map. |
162 | */ | 154 | */ |
@@ -177,8 +169,7 @@ enum GNUNET_DISK_MapType | |||
177 | /** | 169 | /** |
178 | * File access permissions, UNIX-style. | 170 | * File access permissions, UNIX-style. |
179 | */ | 171 | */ |
180 | enum GNUNET_DISK_AccessPermissions | 172 | enum GNUNET_DISK_AccessPermissions { |
181 | { | ||
182 | /** | 173 | /** |
183 | * Nobody is allowed to do anything to the file. | 174 | * Nobody is allowed to do anything to the file. |
184 | */ | 175 | */ |
@@ -235,8 +226,7 @@ enum GNUNET_DISK_AccessPermissions | |||
235 | * Constants for specifying how to seek. Do not change values or order, | 226 | * Constants for specifying how to seek. Do not change values or order, |
236 | * some of the code depends on the specific numeric values! | 227 | * some of the code depends on the specific numeric values! |
237 | */ | 228 | */ |
238 | enum GNUNET_DISK_Seek | 229 | enum GNUNET_DISK_Seek { |
239 | { | ||
240 | /** | 230 | /** |
241 | * Seek an absolute position (from the start of the file). | 231 | * Seek an absolute position (from the start of the file). |
242 | */ | 232 | */ |
@@ -257,8 +247,7 @@ enum GNUNET_DISK_Seek | |||
257 | /** | 247 | /** |
258 | * Enumeration identifying the two ends of a pipe. | 248 | * Enumeration identifying the two ends of a pipe. |
259 | */ | 249 | */ |
260 | enum GNUNET_DISK_PipeEnd | 250 | enum GNUNET_DISK_PipeEnd { |
261 | { | ||
262 | /** | 251 | /** |
263 | * The reading-end of a pipe. | 252 | * The reading-end of a pipe. |
264 | */ | 253 | */ |
@@ -278,7 +267,7 @@ enum GNUNET_DISK_PipeEnd | |||
278 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid | 267 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid |
279 | */ | 268 | */ |
280 | int | 269 | int |
281 | GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | 270 | GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h); |
282 | 271 | ||
283 | 272 | ||
284 | /** | 273 | /** |
@@ -290,7 +279,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | |||
290 | * else (will print an error message in that case, too). | 279 | * else (will print an error message in that case, too). |
291 | */ | 280 | */ |
292 | int | 281 | int |
293 | GNUNET_DISK_file_test (const char *fil); | 282 | GNUNET_DISK_file_test(const char *fil); |
294 | 283 | ||
295 | 284 | ||
296 | /** | 285 | /** |
@@ -301,7 +290,7 @@ GNUNET_DISK_file_test (const char *fil); | |||
301 | * @param fil name of the file to back up | 290 | * @param fil name of the file to back up |
302 | */ | 291 | */ |
303 | void | 292 | void |
304 | GNUNET_DISK_file_backup (const char *fil); | 293 | GNUNET_DISK_file_backup(const char *fil); |
305 | 294 | ||
306 | 295 | ||
307 | /** | 296 | /** |
@@ -312,8 +301,8 @@ GNUNET_DISK_file_backup (const char *fil); | |||
312 | * @return the new position on success, GNUNET_SYSERR otherwise | 301 | * @return the new position on success, GNUNET_SYSERR otherwise |
313 | */ | 302 | */ |
314 | off_t | 303 | off_t |
315 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, | 304 | GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, |
316 | enum GNUNET_DISK_Seek whence); | 305 | enum GNUNET_DISK_Seek whence); |
317 | 306 | ||
318 | 307 | ||
319 | /** | 308 | /** |
@@ -331,10 +320,10 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, | |||
331 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 320 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
332 | */ | 321 | */ |
333 | int | 322 | int |
334 | GNUNET_DISK_file_size (const char *filename, | 323 | GNUNET_DISK_file_size(const char *filename, |
335 | uint64_t *size, | 324 | uint64_t *size, |
336 | int include_symbolic_links, | 325 | int include_symbolic_links, |
337 | int single_file_mode); | 326 | int single_file_mode); |
338 | 327 | ||
339 | 328 | ||
340 | /** | 329 | /** |
@@ -353,9 +342,9 @@ GNUNET_DISK_file_size (const char *filename, | |||
353 | * @return #GNUNET_OK on success | 342 | * @return #GNUNET_OK on success |
354 | */ | 343 | */ |
355 | int | 344 | int |
356 | GNUNET_DISK_file_get_identifiers (const char *filename, | 345 | GNUNET_DISK_file_get_identifiers(const char *filename, |
357 | uint64_t *dev, | 346 | uint64_t *dev, |
358 | uint64_t *ino); | 347 | uint64_t *ino); |
359 | 348 | ||
360 | 349 | ||
361 | /** | 350 | /** |
@@ -370,7 +359,7 @@ GNUNET_DISK_file_get_identifiers (const char *filename, | |||
370 | * file on disk in directory for temporary files | 359 | * file on disk in directory for temporary files |
371 | */ | 360 | */ |
372 | char * | 361 | char * |
373 | GNUNET_DISK_mktemp (const char *t); | 362 | GNUNET_DISK_mktemp(const char *t); |
374 | 363 | ||
375 | 364 | ||
376 | /** | 365 | /** |
@@ -383,7 +372,7 @@ GNUNET_DISK_mktemp (const char *t); | |||
383 | * @return NULL on error, otherwise name of freshly created directory | 372 | * @return NULL on error, otherwise name of freshly created directory |
384 | */ | 373 | */ |
385 | char * | 374 | char * |
386 | GNUNET_DISK_mkdtemp (const char *t); | 375 | GNUNET_DISK_mkdtemp(const char *t); |
387 | 376 | ||
388 | 377 | ||
389 | /** | 378 | /** |
@@ -399,9 +388,9 @@ GNUNET_DISK_mkdtemp (const char *t); | |||
399 | * @return IO handle on success, NULL on error | 388 | * @return IO handle on success, NULL on error |
400 | */ | 389 | */ |
401 | struct GNUNET_DISK_FileHandle * | 390 | struct GNUNET_DISK_FileHandle * |
402 | GNUNET_DISK_file_open (const char *fn, | 391 | GNUNET_DISK_file_open(const char *fn, |
403 | enum GNUNET_DISK_OpenFlags flags, | 392 | enum GNUNET_DISK_OpenFlags flags, |
404 | enum GNUNET_DISK_AccessPermissions perm); | 393 | enum GNUNET_DISK_AccessPermissions perm); |
405 | 394 | ||
406 | 395 | ||
407 | /** | 396 | /** |
@@ -412,8 +401,8 @@ GNUNET_DISK_file_open (const char *fn, | |||
412 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 401 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
413 | */ | 402 | */ |
414 | int | 403 | int |
415 | GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | 404 | GNUNET_DISK_file_handle_size(struct GNUNET_DISK_FileHandle *fh, |
416 | off_t *size); | 405 | off_t *size); |
417 | 406 | ||
418 | 407 | ||
419 | /** | 408 | /** |
@@ -426,10 +415,10 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | |||
426 | * @return handle to the new pipe, NULL on error | 415 | * @return handle to the new pipe, NULL on error |
427 | */ | 416 | */ |
428 | struct GNUNET_DISK_PipeHandle * | 417 | struct GNUNET_DISK_PipeHandle * |
429 | GNUNET_DISK_pipe (int blocking_read, | 418 | GNUNET_DISK_pipe(int blocking_read, |
430 | int blocking_write, | 419 | int blocking_write, |
431 | int inherit_read, | 420 | int inherit_read, |
432 | int inherit_write); | 421 | int inherit_write); |
433 | 422 | ||
434 | 423 | ||
435 | /** | 424 | /** |
@@ -443,9 +432,9 @@ GNUNET_DISK_pipe (int blocking_read, | |||
443 | * @return handle to the new pipe, NULL on error | 432 | * @return handle to the new pipe, NULL on error |
444 | */ | 433 | */ |
445 | struct GNUNET_DISK_PipeHandle * | 434 | struct GNUNET_DISK_PipeHandle * |
446 | GNUNET_DISK_pipe_from_fd (int blocking_read, | 435 | GNUNET_DISK_pipe_from_fd(int blocking_read, |
447 | int blocking_write, | 436 | int blocking_write, |
448 | int fd[2]); | 437 | int fd[2]); |
449 | 438 | ||
450 | 439 | ||
451 | /** | 440 | /** |
@@ -454,7 +443,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, | |||
454 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 443 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
455 | */ | 444 | */ |
456 | int | 445 | int |
457 | GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | 446 | GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p); |
458 | 447 | ||
459 | 448 | ||
460 | /** | 449 | /** |
@@ -465,8 +454,8 @@ GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | |||
465 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 454 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
466 | */ | 455 | */ |
467 | int | 456 | int |
468 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | 457 | GNUNET_DISK_pipe_close_end(struct GNUNET_DISK_PipeHandle *p, |
469 | enum GNUNET_DISK_PipeEnd end); | 458 | enum GNUNET_DISK_PipeEnd end); |
470 | 459 | ||
471 | 460 | ||
472 | /** | 461 | /** |
@@ -482,8 +471,8 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
482 | * (or if that end is not present or is closed). | 471 | * (or if that end is not present or is closed). |
483 | */ | 472 | */ |
484 | struct GNUNET_DISK_FileHandle * | 473 | struct GNUNET_DISK_FileHandle * |
485 | GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, | 474 | GNUNET_DISK_pipe_detach_end(struct GNUNET_DISK_PipeHandle *p, |
486 | enum GNUNET_DISK_PipeEnd end); | 475 | enum GNUNET_DISK_PipeEnd end); |
487 | 476 | ||
488 | /** | 477 | /** |
489 | * Close an open file. | 478 | * Close an open file. |
@@ -492,7 +481,7 @@ GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, | |||
492 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 481 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
493 | */ | 482 | */ |
494 | int | 483 | int |
495 | GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | 484 | GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h); |
496 | 485 | ||
497 | 486 | ||
498 | /** | 487 | /** |
@@ -503,8 +492,8 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | |||
503 | * @return handle for the respective end | 492 | * @return handle for the respective end |
504 | */ | 493 | */ |
505 | const struct GNUNET_DISK_FileHandle * | 494 | const struct GNUNET_DISK_FileHandle * |
506 | GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, | 495 | GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, |
507 | enum GNUNET_DISK_PipeEnd n); | 496 | enum GNUNET_DISK_PipeEnd n); |
508 | 497 | ||
509 | 498 | ||
510 | #if WINDOWS | 499 | #if WINDOWS |
@@ -516,7 +505,7 @@ GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, | |||
516 | * @return GNUnet file handle corresponding to the W32 handle | 505 | * @return GNUnet file handle corresponding to the W32 handle |
517 | */ | 506 | */ |
518 | struct GNUNET_DISK_FileHandle * | 507 | struct GNUNET_DISK_FileHandle * |
519 | GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh); | 508 | GNUNET_DISK_get_handle_from_w32_handle(HANDLE osfh); |
520 | #endif | 509 | #endif |
521 | 510 | ||
522 | /** | 511 | /** |
@@ -529,9 +518,9 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh); | |||
529 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set | 518 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set |
530 | */ | 519 | */ |
531 | void | 520 | void |
532 | GNUNET_DISK_fix_permissions (const char *fn, | 521 | GNUNET_DISK_fix_permissions(const char *fn, |
533 | int require_uid_match, | 522 | int require_uid_match, |
534 | int require_gid_match); | 523 | int require_gid_match); |
535 | 524 | ||
536 | 525 | ||
537 | /** | 526 | /** |
@@ -541,7 +530,7 @@ GNUNET_DISK_fix_permissions (const char *fn, | |||
541 | * @return file handle corresponding to the descriptor | 530 | * @return file handle corresponding to the descriptor |
542 | */ | 531 | */ |
543 | struct GNUNET_DISK_FileHandle * | 532 | struct GNUNET_DISK_FileHandle * |
544 | GNUNET_DISK_get_handle_from_int_fd (int fno); | 533 | GNUNET_DISK_get_handle_from_int_fd(int fno); |
545 | 534 | ||
546 | 535 | ||
547 | /** | 536 | /** |
@@ -551,7 +540,7 @@ GNUNET_DISK_get_handle_from_int_fd (int fno); | |||
551 | * @return file handle corresponding to the descriptor | 540 | * @return file handle corresponding to the descriptor |
552 | */ | 541 | */ |
553 | struct GNUNET_DISK_FileHandle * | 542 | struct GNUNET_DISK_FileHandle * |
554 | GNUNET_DISK_get_handle_from_native (FILE *fd); | 543 | GNUNET_DISK_get_handle_from_native(FILE *fd); |
555 | 544 | ||
556 | 545 | ||
557 | /** | 546 | /** |
@@ -563,9 +552,9 @@ GNUNET_DISK_get_handle_from_native (FILE *fd); | |||
563 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 552 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
564 | */ | 553 | */ |
565 | ssize_t | 554 | ssize_t |
566 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | 555 | GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, |
567 | void *result, | 556 | void *result, |
568 | size_t len); | 557 | size_t len); |
569 | 558 | ||
570 | 559 | ||
571 | /** | 560 | /** |
@@ -579,9 +568,9 @@ GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | |||
579 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 568 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
580 | */ | 569 | */ |
581 | ssize_t | 570 | ssize_t |
582 | GNUNET_DISK_file_read_non_blocking (const struct GNUNET_DISK_FileHandle * h, | 571 | GNUNET_DISK_file_read_non_blocking(const struct GNUNET_DISK_FileHandle * h, |
583 | void *result, | 572 | void *result, |
584 | size_t len); | 573 | size_t len); |
585 | 574 | ||
586 | 575 | ||
587 | /** | 576 | /** |
@@ -593,9 +582,9 @@ GNUNET_DISK_file_read_non_blocking (const struct GNUNET_DISK_FileHandle * h, | |||
593 | * @return number of bytes read, #GNUNET_SYSERR on failure | 582 | * @return number of bytes read, #GNUNET_SYSERR on failure |
594 | */ | 583 | */ |
595 | ssize_t | 584 | ssize_t |
596 | GNUNET_DISK_fn_read (const char *fn, | 585 | GNUNET_DISK_fn_read(const char *fn, |
597 | void *result, | 586 | void *result, |
598 | size_t len); | 587 | size_t len); |
599 | 588 | ||
600 | 589 | ||
601 | /** | 590 | /** |
@@ -607,9 +596,9 @@ GNUNET_DISK_fn_read (const char *fn, | |||
607 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 596 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
608 | */ | 597 | */ |
609 | ssize_t | 598 | ssize_t |
610 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | 599 | GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, |
611 | const void *buffer, | 600 | const void *buffer, |
612 | size_t n); | 601 | size_t n); |
613 | 602 | ||
614 | 603 | ||
615 | /** | 604 | /** |
@@ -621,9 +610,9 @@ GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | |||
621 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 610 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
622 | */ | 611 | */ |
623 | ssize_t | 612 | ssize_t |
624 | GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, | 613 | GNUNET_DISK_file_write_blocking(const struct GNUNET_DISK_FileHandle *h, |
625 | const void *buffer, | 614 | const void *buffer, |
626 | size_t n); | 615 | size_t n); |
627 | 616 | ||
628 | 617 | ||
629 | /** | 618 | /** |
@@ -637,10 +626,10 @@ GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, | |||
637 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 626 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
638 | */ | 627 | */ |
639 | ssize_t | 628 | ssize_t |
640 | GNUNET_DISK_fn_write (const char *fn, | 629 | GNUNET_DISK_fn_write(const char *fn, |
641 | const void *buffer, | 630 | const void *buffer, |
642 | size_t n, | 631 | size_t n, |
643 | enum GNUNET_DISK_AccessPermissions mode); | 632 | enum GNUNET_DISK_AccessPermissions mode); |
644 | 633 | ||
645 | 634 | ||
646 | /** | 635 | /** |
@@ -651,8 +640,8 @@ GNUNET_DISK_fn_write (const char *fn, | |||
651 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 640 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
652 | */ | 641 | */ |
653 | int | 642 | int |
654 | GNUNET_DISK_file_copy (const char *src, | 643 | GNUNET_DISK_file_copy(const char *src, |
655 | const char *dst); | 644 | const char *dst); |
656 | 645 | ||
657 | 646 | ||
658 | /** | 647 | /** |
@@ -664,9 +653,9 @@ GNUNET_DISK_file_copy (const char *src, | |||
664 | * @return the number of files found, -1 on error | 653 | * @return the number of files found, -1 on error |
665 | */ | 654 | */ |
666 | int | 655 | int |
667 | GNUNET_DISK_directory_scan (const char *dir_name, | 656 | GNUNET_DISK_directory_scan(const char *dir_name, |
668 | GNUNET_FileNameCallback callback, | 657 | GNUNET_FileNameCallback callback, |
669 | void *callback_cls); | 658 | void *callback_cls); |
670 | 659 | ||
671 | 660 | ||
672 | /** | 661 | /** |
@@ -678,7 +667,7 @@ GNUNET_DISK_directory_scan (const char *dir_name, | |||
678 | * #GNUNET_NO if directory exists but is not writeable | 667 | * #GNUNET_NO if directory exists but is not writeable |
679 | */ | 668 | */ |
680 | int | 669 | int |
681 | GNUNET_DISK_directory_create_for_file (const char *filename); | 670 | GNUNET_DISK_directory_create_for_file(const char *filename); |
682 | 671 | ||
683 | 672 | ||
684 | /** | 673 | /** |
@@ -694,7 +683,7 @@ GNUNET_DISK_directory_create_for_file (const char *filename); | |||
694 | * does not exist or `stat`ed | 683 | * does not exist or `stat`ed |
695 | */ | 684 | */ |
696 | int | 685 | int |
697 | GNUNET_DISK_directory_test (const char *fil, int is_readable); | 686 | GNUNET_DISK_directory_test(const char *fil, int is_readable); |
698 | 687 | ||
699 | 688 | ||
700 | /** | 689 | /** |
@@ -705,7 +694,7 @@ GNUNET_DISK_directory_test (const char *fil, int is_readable); | |||
705 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 694 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
706 | */ | 695 | */ |
707 | int | 696 | int |
708 | GNUNET_DISK_directory_remove (const char *filename); | 697 | GNUNET_DISK_directory_remove(const char *filename); |
709 | 698 | ||
710 | 699 | ||
711 | /** | 700 | /** |
@@ -716,8 +705,8 @@ GNUNET_DISK_directory_remove (const char *filename); | |||
716 | * @param option option with the dir name to purge | 705 | * @param option option with the dir name to purge |
717 | */ | 706 | */ |
718 | void | 707 | void |
719 | GNUNET_DISK_purge_cfg_dir (const char *cfg_filename, | 708 | GNUNET_DISK_purge_cfg_dir(const char *cfg_filename, |
720 | const char *option); | 709 | const char *option); |
721 | 710 | ||
722 | 711 | ||
723 | /** | 712 | /** |
@@ -727,7 +716,7 @@ GNUNET_DISK_purge_cfg_dir (const char *cfg_filename, | |||
727 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise | 716 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise |
728 | */ | 717 | */ |
729 | int | 718 | int |
730 | GNUNET_DISK_directory_create (const char *dir); | 719 | GNUNET_DISK_directory_create(const char *dir); |
731 | 720 | ||
732 | 721 | ||
733 | /** | 722 | /** |
@@ -740,9 +729,9 @@ GNUNET_DISK_directory_create (const char *dir); | |||
740 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 729 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
741 | */ | 730 | */ |
742 | int | 731 | int |
743 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, | 732 | GNUNET_DISK_file_lock(struct GNUNET_DISK_FileHandle *fh, |
744 | off_t lock_start, | 733 | off_t lock_start, |
745 | off_t lock_end, int excl); | 734 | off_t lock_end, int excl); |
746 | 735 | ||
747 | 736 | ||
748 | /** | 737 | /** |
@@ -754,9 +743,9 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, | |||
754 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 743 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
755 | */ | 744 | */ |
756 | int | 745 | int |
757 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | 746 | GNUNET_DISK_file_unlock(struct GNUNET_DISK_FileHandle *fh, |
758 | off_t unlock_start, | 747 | off_t unlock_start, |
759 | off_t unlock_end); | 748 | off_t unlock_end); |
760 | 749 | ||
761 | 750 | ||
762 | /** | 751 | /** |
@@ -764,7 +753,7 @@ GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | |||
764 | * @param fn the filename to canonicalize | 753 | * @param fn the filename to canonicalize |
765 | */ | 754 | */ |
766 | void | 755 | void |
767 | GNUNET_DISK_filename_canonicalize (char *fn); | 756 | GNUNET_DISK_filename_canonicalize(char *fn); |
768 | 757 | ||
769 | 758 | ||
770 | /** | 759 | /** |
@@ -774,8 +763,8 @@ GNUNET_DISK_filename_canonicalize (char *fn); | |||
774 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 763 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
775 | */ | 764 | */ |
776 | int | 765 | int |
777 | GNUNET_DISK_file_change_owner (const char *filename, | 766 | GNUNET_DISK_file_change_owner(const char *filename, |
778 | const char *user); | 767 | const char *user); |
779 | 768 | ||
780 | 769 | ||
781 | /** | 770 | /** |
@@ -793,10 +782,10 @@ struct GNUNET_DISK_MapHandle; | |||
793 | * @return pointer to the mapped memory region, NULL on failure | 782 | * @return pointer to the mapped memory region, NULL on failure |
794 | */ | 783 | */ |
795 | void * | 784 | void * |
796 | GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | 785 | GNUNET_DISK_file_map(const struct GNUNET_DISK_FileHandle *h, |
797 | struct GNUNET_DISK_MapHandle **m, | 786 | struct GNUNET_DISK_MapHandle **m, |
798 | enum GNUNET_DISK_MapType access, | 787 | enum GNUNET_DISK_MapType access, |
799 | size_t len); | 788 | size_t len); |
800 | 789 | ||
801 | 790 | ||
802 | /** | 791 | /** |
@@ -806,7 +795,7 @@ GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | |||
806 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 795 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
807 | */ | 796 | */ |
808 | int | 797 | int |
809 | GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | 798 | GNUNET_DISK_file_unmap(struct GNUNET_DISK_MapHandle *h); |
810 | 799 | ||
811 | 800 | ||
812 | /** | 801 | /** |
@@ -816,7 +805,7 @@ GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | |||
816 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 805 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
817 | */ | 806 | */ |
818 | int | 807 | int |
819 | GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | 808 | GNUNET_DISK_file_sync(const struct GNUNET_DISK_FileHandle *h); |
820 | 809 | ||
821 | 810 | ||
822 | #if 0 /* keep Emacsens' auto-indent happy */ | 811 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h index d31476d87..e97429d1d 100644 --- a/src/include/gnunet_dns_service.h +++ b/src/include/gnunet_dns_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -49,9 +49,7 @@ struct GNUNET_DNS_RequestHandle; | |||
49 | /** | 49 | /** |
50 | * Flags that specify when to call the client's handler. | 50 | * Flags that specify when to call the client's handler. |
51 | */ | 51 | */ |
52 | enum GNUNET_DNS_Flags | 52 | enum GNUNET_DNS_Flags { |
53 | { | ||
54 | |||
55 | /** | 53 | /** |
56 | * Useless option: never call the client. | 54 | * Useless option: never call the client. |
57 | */ | 55 | */ |
@@ -94,7 +92,6 @@ enum GNUNET_DNS_Flags | |||
94 | * not allowed for MONITOR peers. | 92 | * not allowed for MONITOR peers. |
95 | */ | 93 | */ |
96 | GNUNET_DNS_FLAG_RESPONSE_MONITOR = 8 | 94 | GNUNET_DNS_FLAG_RESPONSE_MONITOR = 8 |
97 | |||
98 | }; | 95 | }; |
99 | 96 | ||
100 | 97 | ||
@@ -137,7 +134,7 @@ typedef void | |||
137 | * @param rh request that should now be forwarded | 134 | * @param rh request that should now be forwarded |
138 | */ | 135 | */ |
139 | void | 136 | void |
140 | GNUNET_DNS_request_forward (struct GNUNET_DNS_RequestHandle *rh); | 137 | GNUNET_DNS_request_forward(struct GNUNET_DNS_RequestHandle *rh); |
141 | 138 | ||
142 | 139 | ||
143 | /** | 140 | /** |
@@ -147,7 +144,7 @@ GNUNET_DNS_request_forward (struct GNUNET_DNS_RequestHandle *rh); | |||
147 | * @param rh request that should now be dropped | 144 | * @param rh request that should now be dropped |
148 | */ | 145 | */ |
149 | void | 146 | void |
150 | GNUNET_DNS_request_drop (struct GNUNET_DNS_RequestHandle *rh); | 147 | GNUNET_DNS_request_drop(struct GNUNET_DNS_RequestHandle *rh); |
151 | 148 | ||
152 | 149 | ||
153 | /** | 150 | /** |
@@ -161,9 +158,9 @@ GNUNET_DNS_request_drop (struct GNUNET_DNS_RequestHandle *rh); | |||
161 | * @param reply reply data | 158 | * @param reply reply data |
162 | */ | 159 | */ |
163 | void | 160 | void |
164 | GNUNET_DNS_request_answer (struct GNUNET_DNS_RequestHandle *rh, | 161 | GNUNET_DNS_request_answer(struct GNUNET_DNS_RequestHandle *rh, |
165 | uint16_t reply_length, | 162 | uint16_t reply_length, |
166 | const char *reply); | 163 | const char *reply); |
167 | 164 | ||
168 | 165 | ||
169 | /** | 166 | /** |
@@ -176,10 +173,10 @@ GNUNET_DNS_request_answer (struct GNUNET_DNS_RequestHandle *rh, | |||
176 | * @return DNS handle | 173 | * @return DNS handle |
177 | */ | 174 | */ |
178 | struct GNUNET_DNS_Handle * | 175 | struct GNUNET_DNS_Handle * |
179 | GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 176 | GNUNET_DNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
180 | enum GNUNET_DNS_Flags flags, | 177 | enum GNUNET_DNS_Flags flags, |
181 | GNUNET_DNS_RequestHandler rh, | 178 | GNUNET_DNS_RequestHandler rh, |
182 | void *rh_cls); | 179 | void *rh_cls); |
183 | 180 | ||
184 | 181 | ||
185 | /** | 182 | /** |
@@ -188,7 +185,7 @@ GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
188 | * @param dh DNS handle | 185 | * @param dh DNS handle |
189 | */ | 186 | */ |
190 | void | 187 | void |
191 | GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh); | 188 | GNUNET_DNS_disconnect(struct GNUNET_DNS_Handle *dh); |
192 | 189 | ||
193 | 190 | ||
194 | #endif | 191 | #endif |
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index 6f81c8e04..bf1869b91 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h | |||
@@ -92,9 +92,7 @@ | |||
92 | /** | 92 | /** |
93 | * A DNS query. | 93 | * A DNS query. |
94 | */ | 94 | */ |
95 | struct GNUNET_DNSPARSER_Query | 95 | struct GNUNET_DNSPARSER_Query { |
96 | { | ||
97 | |||
98 | /** | 96 | /** |
99 | * Name of the record that the query is for (0-terminated). | 97 | * Name of the record that the query is for (0-terminated). |
100 | * In UTF-8 format. The library will convert from and to DNS-IDNA | 98 | * In UTF-8 format. The library will convert from and to DNS-IDNA |
@@ -113,16 +111,13 @@ struct GNUNET_DNSPARSER_Query | |||
113 | * See GNUNET_TUN_DNS_CLASS_*. | 111 | * See GNUNET_TUN_DNS_CLASS_*. |
114 | */ | 112 | */ |
115 | uint16_t dns_traffic_class; | 113 | uint16_t dns_traffic_class; |
116 | |||
117 | }; | 114 | }; |
118 | 115 | ||
119 | 116 | ||
120 | /** | 117 | /** |
121 | * Information from MX records (RFC 1035). | 118 | * Information from MX records (RFC 1035). |
122 | */ | 119 | */ |
123 | struct GNUNET_DNSPARSER_MxRecord | 120 | struct GNUNET_DNSPARSER_MxRecord { |
124 | { | ||
125 | |||
126 | /** | 121 | /** |
127 | * Preference for this entry (lower value is higher preference). | 122 | * Preference for this entry (lower value is higher preference). |
128 | */ | 123 | */ |
@@ -136,16 +131,13 @@ struct GNUNET_DNSPARSER_MxRecord | |||
136 | * creating the DNS packet will fail. | 131 | * creating the DNS packet will fail. |
137 | */ | 132 | */ |
138 | char *mxhost; | 133 | char *mxhost; |
139 | |||
140 | }; | 134 | }; |
141 | 135 | ||
142 | 136 | ||
143 | /** | 137 | /** |
144 | * Information from SRV records (RFC 2782). | 138 | * Information from SRV records (RFC 2782). |
145 | */ | 139 | */ |
146 | struct GNUNET_DNSPARSER_SrvRecord | 140 | struct GNUNET_DNSPARSER_SrvRecord { |
147 | { | ||
148 | |||
149 | /** | 141 | /** |
150 | * Hostname offering the service. | 142 | * Hostname offering the service. |
151 | * In UTF-8 format. The library will convert from and to DNS-IDNA | 143 | * In UTF-8 format. The library will convert from and to DNS-IDNA |
@@ -173,15 +165,13 @@ struct GNUNET_DNSPARSER_SrvRecord | |||
173 | * TCP or UDP port of the service. | 165 | * TCP or UDP port of the service. |
174 | */ | 166 | */ |
175 | uint16_t port; | 167 | uint16_t port; |
176 | |||
177 | }; | 168 | }; |
178 | 169 | ||
179 | 170 | ||
180 | /** | 171 | /** |
181 | * DNS CERT types as defined in RFC 4398. | 172 | * DNS CERT types as defined in RFC 4398. |
182 | */ | 173 | */ |
183 | enum GNUNET_DNSPARSER_CertType | 174 | enum GNUNET_DNSPARSER_CertType { |
184 | { | ||
185 | /** | 175 | /** |
186 | * Reserved value | 176 | * Reserved value |
187 | */ | 177 | */ |
@@ -233,8 +223,7 @@ enum GNUNET_DNSPARSER_CertType | |||
233 | * DNSCERT algorithms as defined in http://www.iana.org/assignments/ | 223 | * DNSCERT algorithms as defined in http://www.iana.org/assignments/ |
234 | * dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml, under dns-sec-alg-numbers-1 | 224 | * dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml, under dns-sec-alg-numbers-1 |
235 | */ | 225 | */ |
236 | enum GNUNET_DNSPARSER_CertAlgorithm | 226 | enum GNUNET_DNSPARSER_CertAlgorithm { |
237 | { | ||
238 | /** | 227 | /** |
239 | * No defined | 228 | * No defined |
240 | */ | 229 | */ |
@@ -304,16 +293,13 @@ enum GNUNET_DNSPARSER_CertAlgorithm | |||
304 | * ECDSA Curve P-384/SHA384 | 293 | * ECDSA Curve P-384/SHA384 |
305 | */ | 294 | */ |
306 | GNUNET_DNSPARSER_CERTALGO_ECDSA_P384SHA384 = 14 | 295 | GNUNET_DNSPARSER_CERTALGO_ECDSA_P384SHA384 = 14 |
307 | |||
308 | }; | 296 | }; |
309 | 297 | ||
310 | 298 | ||
311 | /** | 299 | /** |
312 | * Information from CERT records (RFC 4034). | 300 | * Information from CERT records (RFC 4034). |
313 | */ | 301 | */ |
314 | struct GNUNET_DNSPARSER_CertRecord | 302 | struct GNUNET_DNSPARSER_CertRecord { |
315 | { | ||
316 | |||
317 | /** | 303 | /** |
318 | * Certificate type | 304 | * Certificate type |
319 | */ | 305 | */ |
@@ -338,16 +324,13 @@ struct GNUNET_DNSPARSER_CertRecord | |||
338 | * Data of the certificate. | 324 | * Data of the certificate. |
339 | */ | 325 | */ |
340 | char *certificate_data; | 326 | char *certificate_data; |
341 | |||
342 | }; | 327 | }; |
343 | 328 | ||
344 | 329 | ||
345 | /** | 330 | /** |
346 | * Information from SOA records (RFC 1035). | 331 | * Information from SOA records (RFC 1035). |
347 | */ | 332 | */ |
348 | struct GNUNET_DNSPARSER_SoaRecord | 333 | struct GNUNET_DNSPARSER_SoaRecord { |
349 | { | ||
350 | |||
351 | /** | 334 | /** |
352 | * The domainname of the name server that was the | 335 | * The domainname of the name server that was the |
353 | * original or primary source of data for this zone. | 336 | * original or primary source of data for this zone. |
@@ -395,7 +378,6 @@ struct GNUNET_DNSPARSER_SoaRecord | |||
395 | * from this zone. | 378 | * from this zone. |
396 | */ | 379 | */ |
397 | uint32_t minimum_ttl; | 380 | uint32_t minimum_ttl; |
398 | |||
399 | }; | 381 | }; |
400 | 382 | ||
401 | 383 | ||
@@ -404,8 +386,7 @@ struct GNUNET_DNSPARSER_SoaRecord | |||
404 | * The tag is followed by the tag_len. | 386 | * The tag is followed by the tag_len. |
405 | * The value is followed by the tag for (d - tag_len - 2) bytes | 387 | * The value is followed by the tag for (d - tag_len - 2) bytes |
406 | */ | 388 | */ |
407 | struct GNUNET_DNSPARSER_CaaRecord | 389 | struct GNUNET_DNSPARSER_CaaRecord { |
408 | { | ||
409 | /** | 390 | /** |
410 | * The flags of the CAA record. | 391 | * The flags of the CAA record. |
411 | */ | 392 | */ |
@@ -422,9 +403,7 @@ struct GNUNET_DNSPARSER_CaaRecord | |||
422 | /** | 403 | /** |
423 | * Binary record information (unparsed). | 404 | * Binary record information (unparsed). |
424 | */ | 405 | */ |
425 | struct GNUNET_DNSPARSER_RawRecord | 406 | struct GNUNET_DNSPARSER_RawRecord { |
426 | { | ||
427 | |||
428 | /** | 407 | /** |
429 | * Binary record data. | 408 | * Binary record data. |
430 | */ | 409 | */ |
@@ -440,9 +419,7 @@ struct GNUNET_DNSPARSER_RawRecord | |||
440 | /** | 419 | /** |
441 | * A DNS response record. | 420 | * A DNS response record. |
442 | */ | 421 | */ |
443 | struct GNUNET_DNSPARSER_Record | 422 | struct GNUNET_DNSPARSER_Record { |
444 | { | ||
445 | |||
446 | /** | 423 | /** |
447 | * Name of the record that the query is for (0-terminated). | 424 | * Name of the record that the query is for (0-terminated). |
448 | * In UTF-8 format. The library will convert from and to DNS-IDNA | 425 | * In UTF-8 format. The library will convert from and to DNS-IDNA |
@@ -455,9 +432,7 @@ struct GNUNET_DNSPARSER_Record | |||
455 | /** | 432 | /** |
456 | * Payload of the record (which one of these is valid depends on the 'type'). | 433 | * Payload of the record (which one of these is valid depends on the 'type'). |
457 | */ | 434 | */ |
458 | union | 435 | union { |
459 | { | ||
460 | |||
461 | /** | 436 | /** |
462 | * For NS, CNAME and PTR records, this is the uncompressed 0-terminated hostname. | 437 | * For NS, CNAME and PTR records, this is the uncompressed 0-terminated hostname. |
463 | * In UTF-8 format. The library will convert from and to DNS-IDNA | 438 | * In UTF-8 format. The library will convert from and to DNS-IDNA |
@@ -491,7 +466,6 @@ struct GNUNET_DNSPARSER_Record | |||
491 | * Raw data for all other types. | 466 | * Raw data for all other types. |
492 | */ | 467 | */ |
493 | struct GNUNET_DNSPARSER_RawRecord raw; | 468 | struct GNUNET_DNSPARSER_RawRecord raw; |
494 | |||
495 | } data; | 469 | } data; |
496 | 470 | ||
497 | 471 | ||
@@ -509,15 +483,13 @@ struct GNUNET_DNSPARSER_Record | |||
509 | * See GNUNET_TUN_DNS_CLASS_*. | 483 | * See GNUNET_TUN_DNS_CLASS_*. |
510 | */ | 484 | */ |
511 | uint16_t dns_traffic_class; | 485 | uint16_t dns_traffic_class; |
512 | |||
513 | }; | 486 | }; |
514 | 487 | ||
515 | 488 | ||
516 | /** | 489 | /** |
517 | * Easy-to-process, parsed version of a DNS packet. | 490 | * Easy-to-process, parsed version of a DNS packet. |
518 | */ | 491 | */ |
519 | struct GNUNET_DNSPARSER_Packet | 492 | struct GNUNET_DNSPARSER_Packet { |
520 | { | ||
521 | /** | 493 | /** |
522 | * Array of all queries in the packet, must contain "num_queries" entries. | 494 | * Array of all queries in the packet, must contain "num_queries" entries. |
523 | */ | 495 | */ |
@@ -567,7 +539,6 @@ struct GNUNET_DNSPARSER_Packet | |||
567 | * DNS ID (to match replies to requests). | 539 | * DNS ID (to match replies to requests). |
568 | */ | 540 | */ |
569 | uint16_t id; | 541 | uint16_t id; |
570 | |||
571 | }; | 542 | }; |
572 | 543 | ||
573 | 544 | ||
@@ -580,7 +551,7 @@ struct GNUNET_DNSPARSER_Packet | |||
580 | * #GNUNET_SYSERR if the label is not valid for DNS names | 551 | * #GNUNET_SYSERR if the label is not valid for DNS names |
581 | */ | 552 | */ |
582 | int | 553 | int |
583 | GNUNET_DNSPARSER_check_label (const char *label); | 554 | GNUNET_DNSPARSER_check_label(const char *label); |
584 | 555 | ||
585 | 556 | ||
586 | /** | 557 | /** |
@@ -593,7 +564,7 @@ GNUNET_DNSPARSER_check_label (const char *label); | |||
593 | * #GNUNET_SYSERR if the label is not valid for DNS names | 564 | * #GNUNET_SYSERR if the label is not valid for DNS names |
594 | */ | 565 | */ |
595 | int | 566 | int |
596 | GNUNET_DNSPARSER_check_name (const char *name); | 567 | GNUNET_DNSPARSER_check_name(const char *name); |
597 | 568 | ||
598 | 569 | ||
599 | /** | 570 | /** |
@@ -605,8 +576,8 @@ GNUNET_DNSPARSER_check_name (const char *name); | |||
605 | * @return NULL on error, otherwise the parsed packet | 576 | * @return NULL on error, otherwise the parsed packet |
606 | */ | 577 | */ |
607 | struct GNUNET_DNSPARSER_Packet * | 578 | struct GNUNET_DNSPARSER_Packet * |
608 | GNUNET_DNSPARSER_parse (const char *udp_payload, | 579 | GNUNET_DNSPARSER_parse(const char *udp_payload, |
609 | size_t udp_payload_length); | 580 | size_t udp_payload_length); |
610 | 581 | ||
611 | 582 | ||
612 | /** | 583 | /** |
@@ -615,7 +586,7 @@ GNUNET_DNSPARSER_parse (const char *udp_payload, | |||
615 | * @param p packet to free | 586 | * @param p packet to free |
616 | */ | 587 | */ |
617 | void | 588 | void |
618 | GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p); | 589 | GNUNET_DNSPARSER_free_packet(struct GNUNET_DNSPARSER_Packet *p); |
619 | 590 | ||
620 | 591 | ||
621 | /** | 592 | /** |
@@ -633,10 +604,10 @@ GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p); | |||
633 | * #GNUNET_OK if @a p was packed completely into @a buf | 604 | * #GNUNET_OK if @a p was packed completely into @a buf |
634 | */ | 605 | */ |
635 | int | 606 | int |
636 | GNUNET_DNSPARSER_pack (const struct GNUNET_DNSPARSER_Packet *p, | 607 | GNUNET_DNSPARSER_pack(const struct GNUNET_DNSPARSER_Packet *p, |
637 | uint16_t max, | 608 | uint16_t max, |
638 | char **buf, | 609 | char **buf, |
639 | size_t *buf_length); | 610 | size_t *buf_length); |
640 | 611 | ||
641 | /* ***************** low-level packing API ******************** */ | 612 | /* ***************** low-level packing API ******************** */ |
642 | 613 | ||
@@ -654,10 +625,10 @@ GNUNET_DNSPARSER_pack (const struct GNUNET_DNSPARSER_Packet *p, | |||
654 | * #GNUNET_OK if @a name was added to @a dst | 625 | * #GNUNET_OK if @a name was added to @a dst |
655 | */ | 626 | */ |
656 | int | 627 | int |
657 | GNUNET_DNSPARSER_builder_add_name (char *dst, | 628 | GNUNET_DNSPARSER_builder_add_name(char *dst, |
658 | size_t dst_len, | 629 | size_t dst_len, |
659 | size_t *off, | 630 | size_t *off, |
660 | const char *name); | 631 | const char *name); |
661 | 632 | ||
662 | 633 | ||
663 | /** | 634 | /** |
@@ -673,10 +644,10 @@ GNUNET_DNSPARSER_builder_add_name (char *dst, | |||
673 | * #GNUNET_OK if @a query was added to @a dst | 644 | * #GNUNET_OK if @a query was added to @a dst |
674 | */ | 645 | */ |
675 | int | 646 | int |
676 | GNUNET_DNSPARSER_builder_add_query (char *dst, | 647 | GNUNET_DNSPARSER_builder_add_query(char *dst, |
677 | size_t dst_len, | 648 | size_t dst_len, |
678 | size_t *off, | 649 | size_t *off, |
679 | const struct GNUNET_DNSPARSER_Query *query); | 650 | const struct GNUNET_DNSPARSER_Query *query); |
680 | 651 | ||
681 | 652 | ||
682 | /** | 653 | /** |
@@ -692,10 +663,10 @@ GNUNET_DNSPARSER_builder_add_query (char *dst, | |||
692 | * #GNUNET_OK if @a mx was added to @a dst | 663 | * #GNUNET_OK if @a mx was added to @a dst |
693 | */ | 664 | */ |
694 | int | 665 | int |
695 | GNUNET_DNSPARSER_builder_add_mx (char *dst, | 666 | GNUNET_DNSPARSER_builder_add_mx(char *dst, |
696 | size_t dst_len, | 667 | size_t dst_len, |
697 | size_t *off, | 668 | size_t *off, |
698 | const struct GNUNET_DNSPARSER_MxRecord *mx); | 669 | const struct GNUNET_DNSPARSER_MxRecord *mx); |
699 | 670 | ||
700 | 671 | ||
701 | /** | 672 | /** |
@@ -711,10 +682,10 @@ GNUNET_DNSPARSER_builder_add_mx (char *dst, | |||
711 | * #GNUNET_OK if @a soa was added to @a dst | 682 | * #GNUNET_OK if @a soa was added to @a dst |
712 | */ | 683 | */ |
713 | int | 684 | int |
714 | GNUNET_DNSPARSER_builder_add_soa (char *dst, | 685 | GNUNET_DNSPARSER_builder_add_soa(char *dst, |
715 | size_t dst_len, | 686 | size_t dst_len, |
716 | size_t *off, | 687 | size_t *off, |
717 | const struct GNUNET_DNSPARSER_SoaRecord *soa); | 688 | const struct GNUNET_DNSPARSER_SoaRecord *soa); |
718 | 689 | ||
719 | 690 | ||
720 | /** | 691 | /** |
@@ -730,10 +701,10 @@ GNUNET_DNSPARSER_builder_add_soa (char *dst, | |||
730 | * #GNUNET_OK if @a soa was added to @a dst | 701 | * #GNUNET_OK if @a soa was added to @a dst |
731 | */ | 702 | */ |
732 | int | 703 | int |
733 | GNUNET_DNSPARSER_builder_add_cert (char *dst, | 704 | GNUNET_DNSPARSER_builder_add_cert(char *dst, |
734 | size_t dst_len, | 705 | size_t dst_len, |
735 | size_t *off, | 706 | size_t *off, |
736 | const struct GNUNET_DNSPARSER_CertRecord *cert); | 707 | const struct GNUNET_DNSPARSER_CertRecord *cert); |
737 | 708 | ||
738 | 709 | ||
739 | /** | 710 | /** |
@@ -749,10 +720,10 @@ GNUNET_DNSPARSER_builder_add_cert (char *dst, | |||
749 | * #GNUNET_OK if @a srv was added to @a dst | 720 | * #GNUNET_OK if @a srv was added to @a dst |
750 | */ | 721 | */ |
751 | int | 722 | int |
752 | GNUNET_DNSPARSER_builder_add_srv (char *dst, | 723 | GNUNET_DNSPARSER_builder_add_srv(char *dst, |
753 | size_t dst_len, | 724 | size_t dst_len, |
754 | size_t *off, | 725 | size_t *off, |
755 | const struct GNUNET_DNSPARSER_SrvRecord *srv); | 726 | const struct GNUNET_DNSPARSER_SrvRecord *srv); |
756 | 727 | ||
757 | /* ***************** low-level parsing API ******************** */ | 728 | /* ***************** low-level parsing API ******************** */ |
758 | 729 | ||
@@ -767,10 +738,10 @@ GNUNET_DNSPARSER_builder_add_srv (char *dst, | |||
767 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the record is malformed | 738 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the record is malformed |
768 | */ | 739 | */ |
769 | int | 740 | int |
770 | GNUNET_DNSPARSER_parse_record (const char *udp_payload, | 741 | GNUNET_DNSPARSER_parse_record(const char *udp_payload, |
771 | size_t udp_payload_length, | 742 | size_t udp_payload_length, |
772 | size_t *off, | 743 | size_t *off, |
773 | struct GNUNET_DNSPARSER_Record *r); | 744 | struct GNUNET_DNSPARSER_Record *r); |
774 | 745 | ||
775 | 746 | ||
776 | /** | 747 | /** |
@@ -783,9 +754,9 @@ GNUNET_DNSPARSER_parse_record (const char *udp_payload, | |||
783 | * @return name as 0-terminated C string on success, NULL if the payload is malformed | 754 | * @return name as 0-terminated C string on success, NULL if the payload is malformed |
784 | */ | 755 | */ |
785 | char * | 756 | char * |
786 | GNUNET_DNSPARSER_parse_name (const char *udp_payload, | 757 | GNUNET_DNSPARSER_parse_name(const char *udp_payload, |
787 | size_t udp_payload_length, | 758 | size_t udp_payload_length, |
788 | size_t *off); | 759 | size_t *off); |
789 | 760 | ||
790 | 761 | ||
791 | /** | 762 | /** |
@@ -799,10 +770,10 @@ GNUNET_DNSPARSER_parse_name (const char *udp_payload, | |||
799 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the query is malformed | 770 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the query is malformed |
800 | */ | 771 | */ |
801 | int | 772 | int |
802 | GNUNET_DNSPARSER_parse_query (const char *udp_payload, | 773 | GNUNET_DNSPARSER_parse_query(const char *udp_payload, |
803 | size_t udp_payload_length, | 774 | size_t udp_payload_length, |
804 | size_t *off, | 775 | size_t *off, |
805 | struct GNUNET_DNSPARSER_Query *q); | 776 | struct GNUNET_DNSPARSER_Query *q); |
806 | 777 | ||
807 | 778 | ||
808 | /** | 779 | /** |
@@ -815,9 +786,9 @@ GNUNET_DNSPARSER_parse_query (const char *udp_payload, | |||
815 | * @return the parsed SOA record, NULL on error | 786 | * @return the parsed SOA record, NULL on error |
816 | */ | 787 | */ |
817 | struct GNUNET_DNSPARSER_SoaRecord * | 788 | struct GNUNET_DNSPARSER_SoaRecord * |
818 | GNUNET_DNSPARSER_parse_soa (const char *udp_payload, | 789 | GNUNET_DNSPARSER_parse_soa(const char *udp_payload, |
819 | size_t udp_payload_length, | 790 | size_t udp_payload_length, |
820 | size_t *off); | 791 | size_t *off); |
821 | 792 | ||
822 | 793 | ||
823 | /** | 794 | /** |
@@ -830,9 +801,9 @@ GNUNET_DNSPARSER_parse_soa (const char *udp_payload, | |||
830 | * @return the parsed CERT record, NULL on error | 801 | * @return the parsed CERT record, NULL on error |
831 | */ | 802 | */ |
832 | struct GNUNET_DNSPARSER_CertRecord * | 803 | struct GNUNET_DNSPARSER_CertRecord * |
833 | GNUNET_DNSPARSER_parse_cert (const char *udp_payload, | 804 | GNUNET_DNSPARSER_parse_cert(const char *udp_payload, |
834 | size_t udp_payload_length, | 805 | size_t udp_payload_length, |
835 | size_t *off); | 806 | size_t *off); |
836 | 807 | ||
837 | 808 | ||
838 | /** | 809 | /** |
@@ -845,9 +816,9 @@ GNUNET_DNSPARSER_parse_cert (const char *udp_payload, | |||
845 | * @return the parsed MX record, NULL on error | 816 | * @return the parsed MX record, NULL on error |
846 | */ | 817 | */ |
847 | struct GNUNET_DNSPARSER_MxRecord * | 818 | struct GNUNET_DNSPARSER_MxRecord * |
848 | GNUNET_DNSPARSER_parse_mx (const char *udp_payload, | 819 | GNUNET_DNSPARSER_parse_mx(const char *udp_payload, |
849 | size_t udp_payload_length, | 820 | size_t udp_payload_length, |
850 | size_t *off); | 821 | size_t *off); |
851 | 822 | ||
852 | 823 | ||
853 | /** | 824 | /** |
@@ -860,9 +831,9 @@ GNUNET_DNSPARSER_parse_mx (const char *udp_payload, | |||
860 | * @return the parsed SRV record, NULL on error | 831 | * @return the parsed SRV record, NULL on error |
861 | */ | 832 | */ |
862 | struct GNUNET_DNSPARSER_SrvRecord * | 833 | struct GNUNET_DNSPARSER_SrvRecord * |
863 | GNUNET_DNSPARSER_parse_srv (const char *udp_payload, | 834 | GNUNET_DNSPARSER_parse_srv(const char *udp_payload, |
864 | size_t udp_payload_length, | 835 | size_t udp_payload_length, |
865 | size_t *off); | 836 | size_t *off); |
866 | 837 | ||
867 | /* ***************** low-level duplication API ******************** */ | 838 | /* ***************** low-level duplication API ******************** */ |
868 | 839 | ||
@@ -873,7 +844,7 @@ GNUNET_DNSPARSER_parse_srv (const char *udp_payload, | |||
873 | * @return the newly allocated record | 844 | * @return the newly allocated record |
874 | */ | 845 | */ |
875 | struct GNUNET_DNSPARSER_Record * | 846 | struct GNUNET_DNSPARSER_Record * |
876 | GNUNET_DNSPARSER_duplicate_record (const struct GNUNET_DNSPARSER_Record *r); | 847 | GNUNET_DNSPARSER_duplicate_record(const struct GNUNET_DNSPARSER_Record *r); |
877 | 848 | ||
878 | 849 | ||
879 | /** | 850 | /** |
@@ -883,7 +854,7 @@ GNUNET_DNSPARSER_duplicate_record (const struct GNUNET_DNSPARSER_Record *r); | |||
883 | * @return the newly allocated record | 854 | * @return the newly allocated record |
884 | */ | 855 | */ |
885 | struct GNUNET_DNSPARSER_SoaRecord * | 856 | struct GNUNET_DNSPARSER_SoaRecord * |
886 | GNUNET_DNSPARSER_duplicate_soa_record (const struct GNUNET_DNSPARSER_SoaRecord *r); | 857 | GNUNET_DNSPARSER_duplicate_soa_record(const struct GNUNET_DNSPARSER_SoaRecord *r); |
887 | 858 | ||
888 | 859 | ||
889 | /** | 860 | /** |
@@ -893,7 +864,7 @@ GNUNET_DNSPARSER_duplicate_soa_record (const struct GNUNET_DNSPARSER_SoaRecord * | |||
893 | * @return the newly allocated record | 864 | * @return the newly allocated record |
894 | */ | 865 | */ |
895 | struct GNUNET_DNSPARSER_CertRecord * | 866 | struct GNUNET_DNSPARSER_CertRecord * |
896 | GNUNET_DNSPARSER_duplicate_cert_record (const struct GNUNET_DNSPARSER_CertRecord *r); | 867 | GNUNET_DNSPARSER_duplicate_cert_record(const struct GNUNET_DNSPARSER_CertRecord *r); |
897 | 868 | ||
898 | 869 | ||
899 | /** | 870 | /** |
@@ -903,7 +874,7 @@ GNUNET_DNSPARSER_duplicate_cert_record (const struct GNUNET_DNSPARSER_CertRecord | |||
903 | * @return the newly allocated record | 874 | * @return the newly allocated record |
904 | */ | 875 | */ |
905 | struct GNUNET_DNSPARSER_MxRecord * | 876 | struct GNUNET_DNSPARSER_MxRecord * |
906 | GNUNET_DNSPARSER_duplicate_mx_record (const struct GNUNET_DNSPARSER_MxRecord *r); | 877 | GNUNET_DNSPARSER_duplicate_mx_record(const struct GNUNET_DNSPARSER_MxRecord *r); |
907 | 878 | ||
908 | 879 | ||
909 | /** | 880 | /** |
@@ -913,7 +884,7 @@ GNUNET_DNSPARSER_duplicate_mx_record (const struct GNUNET_DNSPARSER_MxRecord *r) | |||
913 | * @return the newly allocated record | 884 | * @return the newly allocated record |
914 | */ | 885 | */ |
915 | struct GNUNET_DNSPARSER_SrvRecord * | 886 | struct GNUNET_DNSPARSER_SrvRecord * |
916 | GNUNET_DNSPARSER_duplicate_srv_record (const struct GNUNET_DNSPARSER_SrvRecord *r); | 887 | GNUNET_DNSPARSER_duplicate_srv_record(const struct GNUNET_DNSPARSER_SrvRecord *r); |
917 | 888 | ||
918 | 889 | ||
919 | /* ***************** low-level deallocation API ******************** */ | 890 | /* ***************** low-level deallocation API ******************** */ |
@@ -924,7 +895,7 @@ GNUNET_DNSPARSER_duplicate_srv_record (const struct GNUNET_DNSPARSER_SrvRecord * | |||
924 | * @param r record to free | 895 | * @param r record to free |
925 | */ | 896 | */ |
926 | void | 897 | void |
927 | GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r); | 898 | GNUNET_DNSPARSER_free_record(struct GNUNET_DNSPARSER_Record *r); |
928 | 899 | ||
929 | 900 | ||
930 | /** | 901 | /** |
@@ -933,7 +904,7 @@ GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r); | |||
933 | * @param mx record to free | 904 | * @param mx record to free |
934 | */ | 905 | */ |
935 | void | 906 | void |
936 | GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx); | 907 | GNUNET_DNSPARSER_free_mx(struct GNUNET_DNSPARSER_MxRecord *mx); |
937 | 908 | ||
938 | 909 | ||
939 | /** | 910 | /** |
@@ -942,7 +913,7 @@ GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx); | |||
942 | * @param srv record to free | 913 | * @param srv record to free |
943 | */ | 914 | */ |
944 | void | 915 | void |
945 | GNUNET_DNSPARSER_free_srv (struct GNUNET_DNSPARSER_SrvRecord *srv); | 916 | GNUNET_DNSPARSER_free_srv(struct GNUNET_DNSPARSER_SrvRecord *srv); |
946 | 917 | ||
947 | 918 | ||
948 | /** | 919 | /** |
@@ -951,7 +922,7 @@ GNUNET_DNSPARSER_free_srv (struct GNUNET_DNSPARSER_SrvRecord *srv); | |||
951 | * @param soa record to free | 922 | * @param soa record to free |
952 | */ | 923 | */ |
953 | void | 924 | void |
954 | GNUNET_DNSPARSER_free_soa (struct GNUNET_DNSPARSER_SoaRecord *soa); | 925 | GNUNET_DNSPARSER_free_soa(struct GNUNET_DNSPARSER_SoaRecord *soa); |
955 | 926 | ||
956 | 927 | ||
957 | /** | 928 | /** |
@@ -960,7 +931,7 @@ GNUNET_DNSPARSER_free_soa (struct GNUNET_DNSPARSER_SoaRecord *soa); | |||
960 | * @param cert record to free | 931 | * @param cert record to free |
961 | */ | 932 | */ |
962 | void | 933 | void |
963 | GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert); | 934 | GNUNET_DNSPARSER_free_cert(struct GNUNET_DNSPARSER_CertRecord *cert); |
964 | 935 | ||
965 | 936 | ||
966 | /** | 937 | /** |
@@ -971,8 +942,8 @@ GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert); | |||
971 | * @return HEX string (lower case) | 942 | * @return HEX string (lower case) |
972 | */ | 943 | */ |
973 | char * | 944 | char * |
974 | GNUNET_DNSPARSER_bin_to_hex (const void *data, | 945 | GNUNET_DNSPARSER_bin_to_hex(const void *data, |
975 | size_t data_size); | 946 | size_t data_size); |
976 | 947 | ||
977 | 948 | ||
978 | /** | 949 | /** |
@@ -984,8 +955,8 @@ GNUNET_DNSPARSER_bin_to_hex (const void *data, | |||
984 | * @return number of bytes written to data | 955 | * @return number of bytes written to data |
985 | */ | 956 | */ |
986 | size_t | 957 | size_t |
987 | GNUNET_DNSPARSER_hex_to_bin (const char *hex, | 958 | GNUNET_DNSPARSER_hex_to_bin(const char *hex, |
988 | void *data); | 959 | void *data); |
989 | 960 | ||
990 | 961 | ||
991 | #endif | 962 | #endif |
diff --git a/src/include/gnunet_dnsstub_lib.h b/src/include/gnunet_dnsstub_lib.h index 5d134e44a..ff59e1292 100644 --- a/src/include/gnunet_dnsstub_lib.h +++ b/src/include/gnunet_dnsstub_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -52,7 +52,7 @@ struct GNUNET_DNSSTUB_RequestSocket; | |||
52 | * @return NULL on error | 52 | * @return NULL on error |
53 | */ | 53 | */ |
54 | struct GNUNET_DNSSTUB_Context * | 54 | struct GNUNET_DNSSTUB_Context * |
55 | GNUNET_DNSSTUB_start (unsigned int num_sockets); | 55 | GNUNET_DNSSTUB_start(unsigned int num_sockets); |
56 | 56 | ||
57 | 57 | ||
58 | /** | 58 | /** |
@@ -64,8 +64,8 @@ GNUNET_DNSSTUB_start (unsigned int num_sockets); | |||
64 | * @return #GNUNET_OK on success | 64 | * @return #GNUNET_OK on success |
65 | */ | 65 | */ |
66 | int | 66 | int |
67 | GNUNET_DNSSTUB_add_dns_ip (struct GNUNET_DNSSTUB_Context *ctx, | 67 | GNUNET_DNSSTUB_add_dns_ip(struct GNUNET_DNSSTUB_Context *ctx, |
68 | const char *dns_ip); | 68 | const char *dns_ip); |
69 | 69 | ||
70 | 70 | ||
71 | /** | 71 | /** |
@@ -77,8 +77,8 @@ GNUNET_DNSSTUB_add_dns_ip (struct GNUNET_DNSSTUB_Context *ctx, | |||
77 | * @return #GNUNET_OK on success | 77 | * @return #GNUNET_OK on success |
78 | */ | 78 | */ |
79 | int | 79 | int |
80 | GNUNET_DNSSTUB_add_dns_sa (struct GNUNET_DNSSTUB_Context *ctx, | 80 | GNUNET_DNSSTUB_add_dns_sa(struct GNUNET_DNSSTUB_Context *ctx, |
81 | const struct sockaddr *sa); | 81 | const struct sockaddr *sa); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
@@ -89,8 +89,8 @@ GNUNET_DNSSTUB_add_dns_sa (struct GNUNET_DNSSTUB_Context *ctx, | |||
89 | * @param retry_frequ how long to wait between retries | 89 | * @param retry_frequ how long to wait between retries |
90 | */ | 90 | */ |
91 | void | 91 | void |
92 | GNUNET_DNSSTUB_set_retry (struct GNUNET_DNSSTUB_Context *ctx, | 92 | GNUNET_DNSSTUB_set_retry(struct GNUNET_DNSSTUB_Context *ctx, |
93 | struct GNUNET_TIME_Relative retry_freq); | 93 | struct GNUNET_TIME_Relative retry_freq); |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Cleanup DNSSTUB resolver. | 96 | * Cleanup DNSSTUB resolver. |
@@ -98,7 +98,7 @@ GNUNET_DNSSTUB_set_retry (struct GNUNET_DNSSTUB_Context *ctx, | |||
98 | * @param ctx stub resolver to clean up | 98 | * @param ctx stub resolver to clean up |
99 | */ | 99 | */ |
100 | void | 100 | void |
101 | GNUNET_DNSSTUB_stop (struct GNUNET_DNSSTUB_Context *ctx); | 101 | GNUNET_DNSSTUB_stop(struct GNUNET_DNSSTUB_Context *ctx); |
102 | 102 | ||
103 | 103 | ||
104 | /** | 104 | /** |
@@ -128,11 +128,11 @@ typedef void | |||
128 | * @return socket used for the request, NULL on error | 128 | * @return socket used for the request, NULL on error |
129 | */ | 129 | */ |
130 | struct GNUNET_DNSSTUB_RequestSocket * | 130 | struct GNUNET_DNSSTUB_RequestSocket * |
131 | GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx, | 131 | GNUNET_DNSSTUB_resolve(struct GNUNET_DNSSTUB_Context *ctx, |
132 | const void *request, | 132 | const void *request, |
133 | size_t request_len, | 133 | size_t request_len, |
134 | GNUNET_DNSSTUB_ResultCallback rc, | 134 | GNUNET_DNSSTUB_ResultCallback rc, |
135 | void *rc_cls); | 135 | void *rc_cls); |
136 | 136 | ||
137 | 137 | ||
138 | /** | 138 | /** |
@@ -141,7 +141,7 @@ GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx, | |||
141 | * @param rs resolution to cancel | 141 | * @param rs resolution to cancel |
142 | */ | 142 | */ |
143 | void | 143 | void |
144 | GNUNET_DNSSTUB_resolve_cancel (struct GNUNET_DNSSTUB_RequestSocket *rs); | 144 | GNUNET_DNSSTUB_resolve_cancel(struct GNUNET_DNSSTUB_RequestSocket *rs); |
145 | 145 | ||
146 | 146 | ||
147 | #endif | 147 | #endif |
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index f76bfc23f..3004c7a44 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -88,14 +88,14 @@ typedef void | |||
88 | * @return the fragmentation context | 88 | * @return the fragmentation context |
89 | */ | 89 | */ |
90 | struct GNUNET_FRAGMENT_Context * | 90 | struct GNUNET_FRAGMENT_Context * |
91 | GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | 91 | GNUNET_FRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, |
92 | uint16_t mtu, | 92 | uint16_t mtu, |
93 | struct GNUNET_BANDWIDTH_Tracker *tracker, | 93 | struct GNUNET_BANDWIDTH_Tracker *tracker, |
94 | struct GNUNET_TIME_Relative msg_delay, | 94 | struct GNUNET_TIME_Relative msg_delay, |
95 | struct GNUNET_TIME_Relative ack_delay, | 95 | struct GNUNET_TIME_Relative ack_delay, |
96 | const struct GNUNET_MessageHeader *msg, | 96 | const struct GNUNET_MessageHeader *msg, |
97 | GNUNET_FRAGMENT_MessageProcessor proc, | 97 | GNUNET_FRAGMENT_MessageProcessor proc, |
98 | void *proc_cls); | 98 | void *proc_cls); |
99 | 99 | ||
100 | 100 | ||
101 | /** | 101 | /** |
@@ -106,7 +106,7 @@ GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
106 | * @param fc fragmentation context | 106 | * @param fc fragmentation context |
107 | */ | 107 | */ |
108 | void | 108 | void |
109 | GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); | 109 | GNUNET_FRAGMENT_context_transmission_done(struct GNUNET_FRAGMENT_Context *fc); |
110 | 110 | ||
111 | 111 | ||
112 | /** | 112 | /** |
@@ -121,8 +121,8 @@ GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); | |||
121 | * #GNUNET_SYSERR if this ack is not valid for this fc | 121 | * #GNUNET_SYSERR if this ack is not valid for this fc |
122 | */ | 122 | */ |
123 | int | 123 | int |
124 | GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | 124 | GNUNET_FRAGMENT_process_ack(struct GNUNET_FRAGMENT_Context *fc, |
125 | const struct GNUNET_MessageHeader *msg); | 125 | const struct GNUNET_MessageHeader *msg); |
126 | 126 | ||
127 | 127 | ||
128 | /** | 128 | /** |
@@ -136,9 +136,9 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
136 | * last message, set to FOREVER if the message was not fully transmitted (OUT only) | 136 | * last message, set to FOREVER if the message was not fully transmitted (OUT only) |
137 | */ | 137 | */ |
138 | void | 138 | void |
139 | GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc, | 139 | GNUNET_FRAGMENT_context_destroy(struct GNUNET_FRAGMENT_Context *fc, |
140 | struct GNUNET_TIME_Relative *msg_delay, | 140 | struct GNUNET_TIME_Relative *msg_delay, |
141 | struct GNUNET_TIME_Relative *ack_delay); | 141 | struct GNUNET_TIME_Relative *ack_delay); |
142 | 142 | ||
143 | 143 | ||
144 | /** | 144 | /** |
@@ -148,7 +148,7 @@ GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc, | |||
148 | * @return ack in human-readable format | 148 | * @return ack in human-readable format |
149 | */ | 149 | */ |
150 | const char * | 150 | const char * |
151 | GNUNET_FRAGMENT_print_ack (const struct GNUNET_MessageHeader *ack); | 151 | GNUNET_FRAGMENT_print_ack(const struct GNUNET_MessageHeader *ack); |
152 | 152 | ||
153 | 153 | ||
154 | /** | 154 | /** |
@@ -187,12 +187,12 @@ typedef void | |||
187 | * @return the defragmentation context | 187 | * @return the defragmentation context |
188 | */ | 188 | */ |
189 | struct GNUNET_DEFRAGMENT_Context * | 189 | struct GNUNET_DEFRAGMENT_Context * |
190 | GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | 190 | GNUNET_DEFRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, |
191 | uint16_t mtu, | 191 | uint16_t mtu, |
192 | unsigned int num_msgs, | 192 | unsigned int num_msgs, |
193 | void *cls, | 193 | void *cls, |
194 | GNUNET_FRAGMENT_MessageProcessor proc, | 194 | GNUNET_FRAGMENT_MessageProcessor proc, |
195 | GNUNET_DEFRAGMENT_AckProcessor ackp); | 195 | GNUNET_DEFRAGMENT_AckProcessor ackp); |
196 | 196 | ||
197 | 197 | ||
198 | /** | 198 | /** |
@@ -201,7 +201,7 @@ GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
201 | * @param dc defragmentation context | 201 | * @param dc defragmentation context |
202 | */ | 202 | */ |
203 | void | 203 | void |
204 | GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | 204 | GNUNET_DEFRAGMENT_context_destroy(struct GNUNET_DEFRAGMENT_Context *dc); |
205 | 205 | ||
206 | 206 | ||
207 | /** | 207 | /** |
@@ -214,8 +214,8 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | |||
214 | * #GNUNET_SYSERR on error | 214 | * #GNUNET_SYSERR on error |
215 | */ | 215 | */ |
216 | int | 216 | int |
217 | GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, | 217 | GNUNET_DEFRAGMENT_process_fragment(struct GNUNET_DEFRAGMENT_Context *dc, |
218 | const struct GNUNET_MessageHeader *msg); | 218 | const struct GNUNET_MessageHeader *msg); |
219 | 219 | ||
220 | 220 | ||
221 | 221 | ||
diff --git a/src/include/gnunet_friends_lib.h b/src/include/gnunet_friends_lib.h index 8a25be07c..64e7f39d8 100644 --- a/src/include/gnunet_friends_lib.h +++ b/src/include/gnunet_friends_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -61,9 +61,9 @@ typedef void (*GNUNET_FRIENDS_Callback)(void *cls, | |||
61 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on parsing errors | 61 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on parsing errors |
62 | */ | 62 | */ |
63 | int | 63 | int |
64 | GNUNET_FRIENDS_parse (const struct GNUNET_CONFIGURATION_Handle *cfg, | 64 | GNUNET_FRIENDS_parse(const struct GNUNET_CONFIGURATION_Handle *cfg, |
65 | GNUNET_FRIENDS_Callback cb, | 65 | GNUNET_FRIENDS_Callback cb, |
66 | void *cb_cls); | 66 | void *cb_cls); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -80,7 +80,7 @@ struct GNUNET_FRIENDS_Writer; | |||
80 | * @return NULL on error | 80 | * @return NULL on error |
81 | */ | 81 | */ |
82 | struct GNUNET_FRIENDS_Writer * | 82 | struct GNUNET_FRIENDS_Writer * |
83 | GNUNET_FRIENDS_write_start (const struct GNUNET_CONFIGURATION_Handle *cfg); | 83 | GNUNET_FRIENDS_write_start(const struct GNUNET_CONFIGURATION_Handle *cfg); |
84 | 84 | ||
85 | 85 | ||
86 | /** | 86 | /** |
@@ -90,7 +90,7 @@ GNUNET_FRIENDS_write_start (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
90 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 90 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
91 | */ | 91 | */ |
92 | int | 92 | int |
93 | GNUNET_FRIENDS_write_stop (struct GNUNET_FRIENDS_Writer *w); | 93 | GNUNET_FRIENDS_write_stop(struct GNUNET_FRIENDS_Writer *w); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -101,8 +101,8 @@ GNUNET_FRIENDS_write_stop (struct GNUNET_FRIENDS_Writer *w); | |||
101 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 101 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
102 | */ | 102 | */ |
103 | int | 103 | int |
104 | GNUNET_FRIENDS_write (struct GNUNET_FRIENDS_Writer *w, | 104 | GNUNET_FRIENDS_write(struct GNUNET_FRIENDS_Writer *w, |
105 | const struct GNUNET_PeerIdentity *friend_id); | 105 | const struct GNUNET_PeerIdentity *friend_id); |
106 | 106 | ||
107 | 107 | ||
108 | #if 0 /* keep Emacsens' auto-indent happy */ | 108 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 5ee863d12..688c6d489 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -80,7 +80,7 @@ extern "C" | |||
80 | * How often do we signal applications that a probe for a particular | 80 | * How often do we signal applications that a probe for a particular |
81 | * search result is running? (used to visualize probes). | 81 | * search result is running? (used to visualize probes). |
82 | */ | 82 | */ |
83 | #define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250) | 83 | #define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250) |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * A Universal Resource Identifier (URI), opaque. | 86 | * A Universal Resource Identifier (URI), opaque. |
@@ -112,8 +112,8 @@ typedef int | |||
112 | * @return #GNUNET_OK on success | 112 | * @return #GNUNET_OK on success |
113 | */ | 113 | */ |
114 | int | 114 | int |
115 | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | 115 | GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, |
116 | struct GNUNET_HashCode *key); | 116 | struct GNUNET_HashCode *key); |
117 | 117 | ||
118 | 118 | ||
119 | /** | 119 | /** |
@@ -123,7 +123,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | |||
123 | * @return the UTF-8 string | 123 | * @return the UTF-8 string |
124 | */ | 124 | */ |
125 | char * | 125 | char * |
126 | GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | 126 | GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -134,7 +134,7 @@ GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | |||
134 | * @return string with the keywords | 134 | * @return string with the keywords |
135 | */ | 135 | */ |
136 | char * | 136 | char * |
137 | GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | 137 | GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri); |
138 | 138 | ||
139 | 139 | ||
140 | /** | 140 | /** |
@@ -146,9 +146,9 @@ GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | |||
146 | * @param is_mandatory is this keyword mandatory? | 146 | * @param is_mandatory is this keyword mandatory? |
147 | */ | 147 | */ |
148 | void | 148 | void |
149 | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | 149 | GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri, |
150 | const char *keyword, | 150 | const char *keyword, |
151 | int is_mandatory); | 151 | int is_mandatory); |
152 | 152 | ||
153 | 153 | ||
154 | /** | 154 | /** |
@@ -159,8 +159,8 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | |||
159 | * @param keyword keyword to add | 159 | * @param keyword keyword to add |
160 | */ | 160 | */ |
161 | void | 161 | void |
162 | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | 162 | GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri, |
163 | const char *keyword); | 163 | const char *keyword); |
164 | 164 | ||
165 | 165 | ||
166 | /** | 166 | /** |
@@ -171,8 +171,8 @@ GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | |||
171 | * @return NULL on error | 171 | * @return NULL on error |
172 | */ | 172 | */ |
173 | struct GNUNET_FS_Uri * | 173 | struct GNUNET_FS_Uri * |
174 | GNUNET_FS_uri_parse (const char *uri, | 174 | GNUNET_FS_uri_parse(const char *uri, |
175 | char **emsg); | 175 | char **emsg); |
176 | 176 | ||
177 | 177 | ||
178 | /** | 178 | /** |
@@ -181,7 +181,7 @@ GNUNET_FS_uri_parse (const char *uri, | |||
181 | * @param uri uri to free | 181 | * @param uri uri to free |
182 | */ | 182 | */ |
183 | void | 183 | void |
184 | GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | 184 | GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri); |
185 | 185 | ||
186 | 186 | ||
187 | /** | 187 | /** |
@@ -191,7 +191,7 @@ GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | |||
191 | * @return 0 if this is not a keyword URI | 191 | * @return 0 if this is not a keyword URI |
192 | */ | 192 | */ |
193 | unsigned int | 193 | unsigned int |
194 | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | 194 | GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri); |
195 | 195 | ||
196 | 196 | ||
197 | /** | 197 | /** |
@@ -204,9 +204,9 @@ GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | |||
204 | * keywords iterated over until iterator aborted | 204 | * keywords iterated over until iterator aborted |
205 | */ | 205 | */ |
206 | int | 206 | int |
207 | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | 207 | GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri, |
208 | GNUNET_FS_KeywordIterator iterator, | 208 | GNUNET_FS_KeywordIterator iterator, |
209 | void *iterator_cls); | 209 | void *iterator_cls); |
210 | 210 | ||
211 | 211 | ||
212 | /** | 212 | /** |
@@ -217,8 +217,8 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | |||
217 | * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK | 217 | * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK |
218 | */ | 218 | */ |
219 | int | 219 | int |
220 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 220 | GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri, |
221 | struct GNUNET_PeerIdentity *peer); | 221 | struct GNUNET_PeerIdentity *peer); |
222 | 222 | ||
223 | 223 | ||
224 | /** | 224 | /** |
@@ -228,7 +228,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | |||
228 | * @return NULL if argument is not a location URI | 228 | * @return NULL if argument is not a location URI |
229 | */ | 229 | */ |
230 | struct GNUNET_FS_Uri * | 230 | struct GNUNET_FS_Uri * |
231 | GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); | 231 | GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri); |
232 | 232 | ||
233 | 233 | ||
234 | /** | 234 | /** |
@@ -238,7 +238,7 @@ GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); | |||
238 | * @return expiration time of the URI | 238 | * @return expiration time of the URI |
239 | */ | 239 | */ |
240 | struct GNUNET_TIME_Absolute | 240 | struct GNUNET_TIME_Absolute |
241 | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); | 241 | GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri); |
242 | 242 | ||
243 | 243 | ||
244 | /** | 244 | /** |
@@ -254,9 +254,9 @@ GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); | |||
254 | * @return the location URI, NULL on error | 254 | * @return the location URI, NULL on error |
255 | */ | 255 | */ |
256 | struct GNUNET_FS_Uri * | 256 | struct GNUNET_FS_Uri * |
257 | GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri, | 257 | GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri, |
258 | const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, | 258 | const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, |
259 | struct GNUNET_TIME_Absolute expiration_time); | 259 | struct GNUNET_TIME_Absolute expiration_time); |
260 | 260 | ||
261 | 261 | ||
262 | /** | 262 | /** |
@@ -267,8 +267,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri, | |||
267 | * @return merged URI, NULL on error | 267 | * @return merged URI, NULL on error |
268 | */ | 268 | */ |
269 | struct GNUNET_FS_Uri * | 269 | struct GNUNET_FS_Uri * |
270 | GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | 270 | GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1, |
271 | const struct GNUNET_FS_Uri *u2); | 271 | const struct GNUNET_FS_Uri *u2); |
272 | 272 | ||
273 | 273 | ||
274 | /** | 274 | /** |
@@ -278,7 +278,7 @@ GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | |||
278 | * @return copy of the URI | 278 | * @return copy of the URI |
279 | */ | 279 | */ |
280 | struct GNUNET_FS_Uri * | 280 | struct GNUNET_FS_Uri * |
281 | GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | 281 | GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri); |
282 | 282 | ||
283 | 283 | ||
284 | /** | 284 | /** |
@@ -299,8 +299,8 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | |||
299 | * if keywords is not legal (i.e. empty). | 299 | * if keywords is not legal (i.e. empty). |
300 | */ | 300 | */ |
301 | struct GNUNET_FS_Uri * | 301 | struct GNUNET_FS_Uri * |
302 | GNUNET_FS_uri_ksk_create (const char *keywords, | 302 | GNUNET_FS_uri_ksk_create(const char *keywords, |
303 | char **emsg); | 303 | char **emsg); |
304 | 304 | ||
305 | 305 | ||
306 | /** | 306 | /** |
@@ -321,8 +321,8 @@ GNUNET_FS_uri_ksk_create (const char *keywords, | |||
321 | * if keywords is not legal (i.e. empty). | 321 | * if keywords is not legal (i.e. empty). |
322 | */ | 322 | */ |
323 | struct GNUNET_FS_Uri * | 323 | struct GNUNET_FS_Uri * |
324 | GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | 324 | GNUNET_FS_uri_ksk_create_from_args(unsigned int argc, |
325 | const char **argv); | 325 | const char **argv); |
326 | 326 | ||
327 | 327 | ||
328 | /** | 328 | /** |
@@ -333,8 +333,8 @@ GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | |||
333 | * @return #GNUNET_YES if the URIs are equal | 333 | * @return #GNUNET_YES if the URIs are equal |
334 | */ | 334 | */ |
335 | int | 335 | int |
336 | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | 336 | GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, |
337 | const struct GNUNET_FS_Uri *u2); | 337 | const struct GNUNET_FS_Uri *u2); |
338 | 338 | ||
339 | 339 | ||
340 | /** | 340 | /** |
@@ -344,7 +344,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
344 | * @return #GNUNET_YES if this is an SKS uri | 344 | * @return #GNUNET_YES if this is an SKS uri |
345 | */ | 345 | */ |
346 | int | 346 | int |
347 | GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | 347 | GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri); |
348 | 348 | ||
349 | 349 | ||
350 | /** | 350 | /** |
@@ -355,8 +355,8 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | |||
355 | * @return an FS URI for the given namespace and identifier | 355 | * @return an FS URI for the given namespace and identifier |
356 | */ | 356 | */ |
357 | struct GNUNET_FS_Uri * | 357 | struct GNUNET_FS_Uri * |
358 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, | 358 | GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, |
359 | const char *id); | 359 | const char *id); |
360 | 360 | ||
361 | 361 | ||
362 | /** | 362 | /** |
@@ -368,8 +368,8 @@ GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, | |||
368 | * @return #GNUNET_OK on success | 368 | * @return #GNUNET_OK on success |
369 | */ | 369 | */ |
370 | int | 370 | int |
371 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 371 | GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri, |
372 | struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym); | 372 | struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym); |
373 | 373 | ||
374 | 374 | ||
375 | /** | 375 | /** |
@@ -379,7 +379,7 @@ GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | |||
379 | * @return NULL on error (not a valid SKS URI) | 379 | * @return NULL on error (not a valid SKS URI) |
380 | */ | 380 | */ |
381 | char * | 381 | char * |
382 | GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | 382 | GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri); |
383 | 383 | ||
384 | 384 | ||
385 | /** | 385 | /** |
@@ -389,7 +389,7 @@ GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | |||
389 | * @return #GNUNET_YES if this is a KSK uri | 389 | * @return #GNUNET_YES if this is a KSK uri |
390 | */ | 390 | */ |
391 | int | 391 | int |
392 | GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | 392 | GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri); |
393 | 393 | ||
394 | 394 | ||
395 | /** | 395 | /** |
@@ -399,7 +399,7 @@ GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | |||
399 | * @return #GNUNET_YES if this is a CHK uri | 399 | * @return #GNUNET_YES if this is a CHK uri |
400 | */ | 400 | */ |
401 | int | 401 | int |
402 | GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | 402 | GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri); |
403 | 403 | ||
404 | 404 | ||
405 | /** | 405 | /** |
@@ -410,7 +410,7 @@ GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | |||
410 | * @return size of the file as specified in the CHK URI | 410 | * @return size of the file as specified in the CHK URI |
411 | */ | 411 | */ |
412 | uint64_t | 412 | uint64_t |
413 | GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | 413 | GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri); |
414 | 414 | ||
415 | 415 | ||
416 | /** | 416 | /** |
@@ -420,7 +420,7 @@ GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | |||
420 | * @return #GNUNET_YES if this is a LOC uri | 420 | * @return #GNUNET_YES if this is a LOC uri |
421 | */ | 421 | */ |
422 | int | 422 | int |
423 | GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | 423 | GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri); |
424 | 424 | ||
425 | 425 | ||
426 | /** | 426 | /** |
@@ -432,8 +432,8 @@ GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | |||
432 | * @return NULL on error, otherwise a KSK URI | 432 | * @return NULL on error, otherwise a KSK URI |
433 | */ | 433 | */ |
434 | struct GNUNET_FS_Uri * | 434 | struct GNUNET_FS_Uri * |
435 | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData | 435 | GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData |
436 | *md); | 436 | *md); |
437 | 437 | ||
438 | 438 | ||
439 | /* ******************** command-line option parsing API *********************** */ | 439 | /* ******************** command-line option parsing API *********************** */ |
@@ -448,11 +448,11 @@ GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData | |||
448 | * @param[out] topKeywords set to the desired value | 448 | * @param[out] topKeywords set to the desired value |
449 | */ | 449 | */ |
450 | struct GNUNET_GETOPT_CommandLineOption | 450 | struct GNUNET_GETOPT_CommandLineOption |
451 | GNUNET_FS_GETOPT_KEYWORDS (char shortName, | 451 | GNUNET_FS_GETOPT_KEYWORDS(char shortName, |
452 | const char *name, | 452 | const char *name, |
453 | const char *argumentHelp, | 453 | const char *argumentHelp, |
454 | const char *description, | 454 | const char *description, |
455 | struct GNUNET_FS_Uri **topKeywords); | 455 | struct GNUNET_FS_Uri **topKeywords); |
456 | 456 | ||
457 | /** | 457 | /** |
458 | * Allow user to specify metadata. | 458 | * Allow user to specify metadata. |
@@ -464,11 +464,11 @@ GNUNET_FS_GETOPT_KEYWORDS (char shortName, | |||
464 | * @param[out] metadata set to the desired value | 464 | * @param[out] metadata set to the desired value |
465 | */ | 465 | */ |
466 | struct GNUNET_GETOPT_CommandLineOption | 466 | struct GNUNET_GETOPT_CommandLineOption |
467 | GNUNET_FS_GETOPT_METADATA (char shortName, | 467 | GNUNET_FS_GETOPT_METADATA(char shortName, |
468 | const char *name, | 468 | const char *name, |
469 | const char *argumentHelp, | 469 | const char *argumentHelp, |
470 | const char *description, | 470 | const char *description, |
471 | struct GNUNET_CONTAINER_MetaData **meta); | 471 | struct GNUNET_CONTAINER_MetaData **meta); |
472 | 472 | ||
473 | /** | 473 | /** |
474 | * Command-line option parser function that allows the user to specify | 474 | * Command-line option parser function that allows the user to specify |
@@ -483,10 +483,10 @@ GNUNET_FS_GETOPT_METADATA (char shortName, | |||
483 | * @return #GNUNET_OK on success | 483 | * @return #GNUNET_OK on success |
484 | */ | 484 | */ |
485 | int | 485 | int |
486 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | 486 | GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
487 | void *scls, | 487 | void *scls, |
488 | const char *option, | 488 | const char *option, |
489 | const char *value); | 489 | const char *value); |
490 | 490 | ||
491 | 491 | ||
492 | 492 | ||
@@ -504,8 +504,7 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
504 | * are typically generated either due to explicit client requests | 504 | * are typically generated either due to explicit client requests |
505 | * or because of suspend/resume operations. | 505 | * or because of suspend/resume operations. |
506 | */ | 506 | */ |
507 | enum GNUNET_FS_Status | 507 | enum GNUNET_FS_Status { |
508 | { | ||
509 | /** | 508 | /** |
510 | * Notification that we have started to publish a file structure. | 509 | * Notification that we have started to publish a file structure. |
511 | */ | 510 | */ |
@@ -724,7 +723,6 @@ enum GNUNET_FS_Status | |||
724 | * Notification that we are making progress sharing a directory. | 723 | * Notification that we are making progress sharing a directory. |
725 | */ | 724 | */ |
726 | GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY = 37 | 725 | GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY = 37 |
727 | |||
728 | }; | 726 | }; |
729 | 727 | ||
730 | 728 | ||
@@ -772,21 +770,15 @@ struct GNUNET_FS_FileInformation; | |||
772 | * Argument given to the progress callback with | 770 | * Argument given to the progress callback with |
773 | * information about what is going on. | 771 | * information about what is going on. |
774 | */ | 772 | */ |
775 | struct GNUNET_FS_ProgressInfo | 773 | struct GNUNET_FS_ProgressInfo { |
776 | { | ||
777 | |||
778 | /** | 774 | /** |
779 | * Values that depend on the event type. | 775 | * Values that depend on the event type. |
780 | */ | 776 | */ |
781 | union | 777 | union { |
782 | { | ||
783 | |||
784 | /** | 778 | /** |
785 | * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. | 779 | * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. |
786 | */ | 780 | */ |
787 | struct | 781 | struct { |
788 | { | ||
789 | |||
790 | /** | 782 | /** |
791 | * Context for controlling the upload. | 783 | * Context for controlling the upload. |
792 | */ | 784 | */ |
@@ -848,54 +840,47 @@ struct GNUNET_FS_ProgressInfo | |||
848 | /** | 840 | /** |
849 | * Additional values for specific events. | 841 | * Additional values for specific events. |
850 | */ | 842 | */ |
851 | union | 843 | union { |
852 | { | ||
853 | |||
854 | /** | 844 | /** |
855 | * These values are only valid for | 845 | * These values are only valid for |
856 | * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events. | 846 | * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events. |
857 | */ | 847 | */ |
858 | struct | 848 | struct { |
859 | { | ||
860 | |||
861 | /** | 849 | /** |
862 | * Data block we just published. | 850 | * Data block we just published. |
863 | */ | 851 | */ |
864 | const void *data; | 852 | const void *data; |
865 | 853 | ||
866 | /** | 854 | /** |
867 | * At what offset in the file is "data"? | 855 | * At what offset in the file is "data"? |
868 | */ | 856 | */ |
869 | uint64_t offset; | 857 | uint64_t offset; |
870 | 858 | ||
871 | /** | 859 | /** |
872 | * Length of the data block. | 860 | * Length of the data block. |
873 | */ | 861 | */ |
874 | uint64_t data_len; | 862 | uint64_t data_len; |
875 | 863 | ||
876 | /** | 864 | /** |
877 | * Depth of the given block in the tree; | 865 | * Depth of the given block in the tree; |
878 | * 0 would be the lowest level (DBLOCKs). | 866 | * 0 would be the lowest level (DBLOCKs). |
879 | */ | 867 | */ |
880 | unsigned int depth; | 868 | unsigned int depth; |
881 | |||
882 | } progress; | 869 | } progress; |
883 | 870 | ||
884 | /** | 871 | /** |
885 | * These values are only valid for | 872 | * These values are only valid for |
886 | * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events. | 873 | * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events. |
887 | */ | 874 | */ |
888 | struct | 875 | struct { |
889 | { | ||
890 | |||
891 | /** | 876 | /** |
892 | * How far are we along in the overall directory? | 877 | * How far are we along in the overall directory? |
893 | */ | 878 | */ |
894 | uint64_t completed; | 879 | uint64_t completed; |
895 | 880 | ||
896 | /** | 881 | /** |
897 | * How big do we estimate the entire directory to be? | 882 | * How big do we estimate the entire directory to be? |
898 | */ | 883 | */ |
899 | uint64_t total; | 884 | uint64_t total; |
900 | 885 | ||
901 | /** | 886 | /** |
@@ -905,77 +890,63 @@ struct GNUNET_FS_ProgressInfo | |||
905 | * "publish"-level of this struct.) | 890 | * "publish"-level of this struct.) |
906 | */ | 891 | */ |
907 | struct GNUNET_TIME_Relative eta; | 892 | struct GNUNET_TIME_Relative eta; |
908 | |||
909 | } progress_directory; | 893 | } progress_directory; |
910 | 894 | ||
911 | /** | 895 | /** |
912 | * These values are only valid for | 896 | * These values are only valid for |
913 | * #GNUNET_FS_STATUS_PUBLISH_RESUME events. | 897 | * #GNUNET_FS_STATUS_PUBLISH_RESUME events. |
914 | */ | 898 | */ |
915 | struct | 899 | struct { |
916 | { | ||
917 | |||
918 | /** | 900 | /** |
919 | * Error message, NULL if no error was encountered so far. | 901 | * Error message, NULL if no error was encountered so far. |
920 | */ | 902 | */ |
921 | const char *message; | 903 | const char *message; |
922 | 904 | ||
923 | /** | 905 | /** |
924 | * URI of the file (if the download had been completed) | 906 | * URI of the file (if the download had been completed) |
925 | */ | 907 | */ |
926 | const struct GNUNET_FS_Uri *chk_uri; | 908 | const struct GNUNET_FS_Uri *chk_uri; |
927 | 909 | ||
928 | /** | 910 | /** |
929 | * SKS URI of the file (if the download had been completed) | 911 | * SKS URI of the file (if the download had been completed) |
930 | */ | 912 | */ |
931 | const struct GNUNET_FS_Uri *sks_uri; | 913 | const struct GNUNET_FS_Uri *sks_uri; |
932 | |||
933 | } resume; | 914 | } resume; |
934 | 915 | ||
935 | /** | 916 | /** |
936 | * These values are only valid for | 917 | * These values are only valid for |
937 | * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events. | 918 | * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events. |
938 | */ | 919 | */ |
939 | struct | 920 | struct { |
940 | { | ||
941 | |||
942 | /** | 921 | /** |
943 | * CHK URI of the file. | 922 | * CHK URI of the file. |
944 | */ | 923 | */ |
945 | const struct GNUNET_FS_Uri *chk_uri; | 924 | const struct GNUNET_FS_Uri *chk_uri; |
946 | 925 | ||
947 | /** | 926 | /** |
948 | * SKS URI of the file (if the download had been completed) | 927 | * SKS URI of the file (if the download had been completed) |
949 | */ | 928 | */ |
950 | const struct GNUNET_FS_Uri *sks_uri; | 929 | const struct GNUNET_FS_Uri *sks_uri; |
951 | |||
952 | } completed; | 930 | } completed; |
953 | 931 | ||
954 | /** | 932 | /** |
955 | * These values are only valid for | 933 | * These values are only valid for |
956 | * #GNUNET_FS_STATUS_PUBLISH_ERROR events. | 934 | * #GNUNET_FS_STATUS_PUBLISH_ERROR events. |
957 | */ | 935 | */ |
958 | struct | 936 | struct { |
959 | { | ||
960 | |||
961 | /** | 937 | /** |
962 | * Error message, never NULL. | 938 | * Error message, never NULL. |
963 | */ | 939 | */ |
964 | const char *message; | 940 | const char *message; |
965 | |||
966 | } error; | 941 | } error; |
967 | |||
968 | } specifics; | 942 | } specifics; |
969 | |||
970 | } publish; | 943 | } publish; |
971 | 944 | ||
972 | 945 | ||
973 | /** | 946 | /** |
974 | * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. | 947 | * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. |
975 | */ | 948 | */ |
976 | struct | 949 | struct { |
977 | { | ||
978 | |||
979 | /** | 950 | /** |
980 | * Context for controlling the download. | 951 | * Context for controlling the download. |
981 | */ | 952 | */ |
@@ -1049,121 +1020,103 @@ struct GNUNET_FS_ProgressInfo | |||
1049 | /** | 1020 | /** |
1050 | * Additional values for specific events. | 1021 | * Additional values for specific events. |
1051 | */ | 1022 | */ |
1052 | union | 1023 | union { |
1053 | { | ||
1054 | |||
1055 | /** | 1024 | /** |
1056 | * These values are only valid for | 1025 | * These values are only valid for |
1057 | * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. | 1026 | * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. |
1058 | */ | 1027 | */ |
1059 | struct | 1028 | struct { |
1060 | { | ||
1061 | |||
1062 | /** | 1029 | /** |
1063 | * Data block we just obtained, can be NULL (even if | 1030 | * Data block we just obtained, can be NULL (even if |
1064 | * data_len > 0) if we found the entire block 'intact' on | 1031 | * data_len > 0) if we found the entire block 'intact' on |
1065 | * disk. In this case, it is also possible for 'data_len' | 1032 | * disk. In this case, it is also possible for 'data_len' |
1066 | * to be larger than an individual (32k) block. | 1033 | * to be larger than an individual (32k) block. |
1067 | */ | 1034 | */ |
1068 | const void *data; | 1035 | const void *data; |
1069 | 1036 | ||
1070 | /** | 1037 | /** |
1071 | * At what offset in the file is "data"? | 1038 | * At what offset in the file is "data"? |
1072 | */ | 1039 | */ |
1073 | uint64_t offset; | 1040 | uint64_t offset; |
1074 | 1041 | ||
1075 | /** | 1042 | /** |
1076 | * Length of the data block. | 1043 | * Length of the data block. |
1077 | */ | 1044 | */ |
1078 | uint64_t data_len; | 1045 | uint64_t data_len; |
1079 | 1046 | ||
1080 | /** | 1047 | /** |
1081 | * How much time passed between us asking for this block and | 1048 | * How much time passed between us asking for this block and |
1082 | * actually getting it? #GNUNET_TIME_UNIT_FOREVER_REL if unknown. | 1049 | * actually getting it? #GNUNET_TIME_UNIT_FOREVER_REL if unknown. |
1083 | */ | 1050 | */ |
1084 | struct GNUNET_TIME_Relative block_download_duration; | 1051 | struct GNUNET_TIME_Relative block_download_duration; |
1085 | 1052 | ||
1086 | /** | 1053 | /** |
1087 | * Depth of the given block in the tree; | 1054 | * Depth of the given block in the tree; |
1088 | * 0 would be the lowest level (DBLOCKS). | 1055 | * 0 would be the lowest level (DBLOCKS). |
1089 | */ | 1056 | */ |
1090 | unsigned int depth; | 1057 | unsigned int depth; |
1091 | 1058 | ||
1092 | /** | 1059 | /** |
1093 | * How much respect did we offer for downloading this block? (estimate, | 1060 | * How much respect did we offer for downloading this block? (estimate, |
1094 | * because we might have the same request pending for multiple clients, | 1061 | * because we might have the same request pending for multiple clients, |
1095 | * and of course because a transmission may have failed at a lower | 1062 | * and of course because a transmission may have failed at a lower |
1096 | * layer). | 1063 | * layer). |
1097 | */ | 1064 | */ |
1098 | uint32_t respect_offered; | 1065 | uint32_t respect_offered; |
1099 | 1066 | ||
1100 | /** | 1067 | /** |
1101 | * How often did we transmit the request? (estimate, | 1068 | * How often did we transmit the request? (estimate, |
1102 | * because we might have the same request pending for multiple clients, | 1069 | * because we might have the same request pending for multiple clients, |
1103 | * and of course because a transmission may have failed at a lower | 1070 | * and of course because a transmission may have failed at a lower |
1104 | * layer). | 1071 | * layer). |
1105 | */ | 1072 | */ |
1106 | uint32_t num_transmissions; | 1073 | uint32_t num_transmissions; |
1107 | |||
1108 | } progress; | 1074 | } progress; |
1109 | 1075 | ||
1110 | /** | 1076 | /** |
1111 | * These values are only valid for | 1077 | * These values are only valid for |
1112 | * #GNUNET_FS_STATUS_DOWNLOAD_START events. | 1078 | * #GNUNET_FS_STATUS_DOWNLOAD_START events. |
1113 | */ | 1079 | */ |
1114 | struct | 1080 | struct { |
1115 | { | ||
1116 | |||
1117 | /** | 1081 | /** |
1118 | * Known metadata for the download. | 1082 | * Known metadata for the download. |
1119 | */ | 1083 | */ |
1120 | const struct GNUNET_CONTAINER_MetaData *meta; | 1084 | const struct GNUNET_CONTAINER_MetaData *meta; |
1121 | |||
1122 | } start; | 1085 | } start; |
1123 | 1086 | ||
1124 | /** | 1087 | /** |
1125 | * These values are only valid for | 1088 | * These values are only valid for |
1126 | * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events. | 1089 | * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events. |
1127 | */ | 1090 | */ |
1128 | struct | 1091 | struct { |
1129 | { | ||
1130 | |||
1131 | /** | 1092 | /** |
1132 | * Known metadata for the download. | 1093 | * Known metadata for the download. |
1133 | */ | 1094 | */ |
1134 | const struct GNUNET_CONTAINER_MetaData *meta; | 1095 | const struct GNUNET_CONTAINER_MetaData *meta; |
1135 | 1096 | ||
1136 | /** | 1097 | /** |
1137 | * Error message, NULL if we have not encountered any error yet. | 1098 | * Error message, NULL if we have not encountered any error yet. |
1138 | */ | 1099 | */ |
1139 | const char *message; | 1100 | const char *message; |
1140 | |||
1141 | } resume; | 1101 | } resume; |
1142 | 1102 | ||
1143 | /** | 1103 | /** |
1144 | * These values are only valid for | 1104 | * These values are only valid for |
1145 | * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events. | 1105 | * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events. |
1146 | */ | 1106 | */ |
1147 | struct | 1107 | struct { |
1148 | { | ||
1149 | |||
1150 | /** | 1108 | /** |
1151 | * Error message. | 1109 | * Error message. |
1152 | */ | 1110 | */ |
1153 | const char *message; | 1111 | const char *message; |
1154 | |||
1155 | } error; | 1112 | } error; |
1156 | |||
1157 | } specifics; | 1113 | } specifics; |
1158 | |||
1159 | } download; | 1114 | } download; |
1160 | 1115 | ||
1161 | /** | 1116 | /** |
1162 | * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. | 1117 | * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. |
1163 | */ | 1118 | */ |
1164 | struct | 1119 | struct { |
1165 | { | ||
1166 | |||
1167 | /** | 1120 | /** |
1168 | * Context for controlling the search, NULL for | 1121 | * Context for controlling the search, NULL for |
1169 | * searches that were not explicitly triggered | 1122 | * searches that were not explicitly triggered |
@@ -1211,262 +1164,232 @@ struct GNUNET_FS_ProgressInfo | |||
1211 | /** | 1164 | /** |
1212 | * Additional values for specific events. | 1165 | * Additional values for specific events. |
1213 | */ | 1166 | */ |
1214 | union | 1167 | union { |
1215 | { | ||
1216 | |||
1217 | /** | 1168 | /** |
1218 | * These values are only valid for | 1169 | * These values are only valid for |
1219 | * #GNUNET_FS_STATUS_SEARCH_RESULT events. | 1170 | * #GNUNET_FS_STATUS_SEARCH_RESULT events. |
1220 | */ | 1171 | */ |
1221 | struct | 1172 | struct { |
1222 | { | ||
1223 | |||
1224 | /** | 1173 | /** |
1225 | * Metadata for the search result. | 1174 | * Metadata for the search result. |
1226 | */ | 1175 | */ |
1227 | const struct GNUNET_CONTAINER_MetaData *meta; | 1176 | const struct GNUNET_CONTAINER_MetaData *meta; |
1228 | 1177 | ||
1229 | /** | 1178 | /** |
1230 | * URI for the search result. | 1179 | * URI for the search result. |
1231 | */ | 1180 | */ |
1232 | const struct GNUNET_FS_Uri *uri; | 1181 | const struct GNUNET_FS_Uri *uri; |
1233 | 1182 | ||
1234 | /** | 1183 | /** |
1235 | * Handle to the result (for starting downloads). | 1184 | * Handle to the result (for starting downloads). |
1236 | */ | 1185 | */ |
1237 | struct GNUNET_FS_SearchResult *result; | 1186 | struct GNUNET_FS_SearchResult *result; |
1238 | 1187 | ||
1239 | /** | 1188 | /** |
1240 | * Applicability rank (the larger, the better the result | 1189 | * Applicability rank (the larger, the better the result |
1241 | * fits the search criteria). | 1190 | * fits the search criteria). |
1242 | */ | 1191 | */ |
1243 | uint32_t applicability_rank; | 1192 | uint32_t applicability_rank; |
1244 | |||
1245 | } result; | 1193 | } result; |
1246 | 1194 | ||
1247 | /** | 1195 | /** |
1248 | * These values are only valid for | 1196 | * These values are only valid for |
1249 | * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. | 1197 | * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. |
1250 | */ | 1198 | */ |
1251 | struct | 1199 | struct { |
1252 | { | ||
1253 | |||
1254 | /** | 1200 | /** |
1255 | * Metadata for the search result. | 1201 | * Metadata for the search result. |
1256 | */ | 1202 | */ |
1257 | const struct GNUNET_CONTAINER_MetaData *meta; | 1203 | const struct GNUNET_CONTAINER_MetaData *meta; |
1258 | 1204 | ||
1259 | /** | 1205 | /** |
1260 | * URI for the search result. | 1206 | * URI for the search result. |
1261 | */ | 1207 | */ |
1262 | const struct GNUNET_FS_Uri *uri; | 1208 | const struct GNUNET_FS_Uri *uri; |
1263 | 1209 | ||
1264 | /** | 1210 | /** |
1265 | * Handle to the result (for starting downloads). | 1211 | * Handle to the result (for starting downloads). |
1266 | */ | 1212 | */ |
1267 | struct GNUNET_FS_SearchResult *result; | 1213 | struct GNUNET_FS_SearchResult *result; |
1268 | 1214 | ||
1269 | /** | 1215 | /** |
1270 | * Current availability rank (negative: | 1216 | * Current availability rank (negative: |
1271 | * unavailable, positive: available) | 1217 | * unavailable, positive: available) |
1272 | */ | 1218 | */ |
1273 | int32_t availability_rank; | 1219 | int32_t availability_rank; |
1274 | 1220 | ||
1275 | /** | 1221 | /** |
1276 | * On how many total queries is the given | 1222 | * On how many total queries is the given |
1277 | * availability_rank based? | 1223 | * availability_rank based? |
1278 | */ | 1224 | */ |
1279 | uint32_t availability_certainty; | 1225 | uint32_t availability_certainty; |
1280 | 1226 | ||
1281 | /** | 1227 | /** |
1282 | * Updated applicability rank (the larger, | 1228 | * Updated applicability rank (the larger, |
1283 | * the better the result fits the search | 1229 | * the better the result fits the search |
1284 | * criteria). | 1230 | * criteria). |
1285 | */ | 1231 | */ |
1286 | uint32_t applicability_rank; | 1232 | uint32_t applicability_rank; |
1287 | |||
1288 | } resume_result; | 1233 | } resume_result; |
1289 | 1234 | ||
1290 | /** | 1235 | /** |
1291 | * These values are only valid for | 1236 | * These values are only valid for |
1292 | * #GNUNET_FS_STATUS_SEARCH_UPDATE events. | 1237 | * #GNUNET_FS_STATUS_SEARCH_UPDATE events. |
1293 | */ | 1238 | */ |
1294 | struct | 1239 | struct { |
1295 | { | ||
1296 | |||
1297 | /** | 1240 | /** |
1298 | * Private context set for for this result | 1241 | * Private context set for for this result |
1299 | * during the "RESULT" event. | 1242 | * during the "RESULT" event. |
1300 | */ | 1243 | */ |
1301 | void *cctx; | 1244 | void *cctx; |
1302 | 1245 | ||
1303 | /** | 1246 | /** |
1304 | * Metadata for the search result. | 1247 | * Metadata for the search result. |
1305 | */ | 1248 | */ |
1306 | const struct GNUNET_CONTAINER_MetaData *meta; | 1249 | const struct GNUNET_CONTAINER_MetaData *meta; |
1307 | 1250 | ||
1308 | /** | 1251 | /** |
1309 | * URI for the search result. | 1252 | * URI for the search result. |
1310 | */ | 1253 | */ |
1311 | const struct GNUNET_FS_Uri *uri; | 1254 | const struct GNUNET_FS_Uri *uri; |
1312 | 1255 | ||
1313 | /** | 1256 | /** |
1314 | * Current availability rank (negative: | 1257 | * Current availability rank (negative: |
1315 | * unavailable, positive: available) | 1258 | * unavailable, positive: available) |
1316 | */ | 1259 | */ |
1317 | int32_t availability_rank; | 1260 | int32_t availability_rank; |
1318 | 1261 | ||
1319 | /** | 1262 | /** |
1320 | * On how many total queries is the given | 1263 | * On how many total queries is the given |
1321 | * availability_rank based? | 1264 | * availability_rank based? |
1322 | */ | 1265 | */ |
1323 | uint32_t availability_certainty; | 1266 | uint32_t availability_certainty; |
1324 | 1267 | ||
1325 | /** | 1268 | /** |
1326 | * Updated applicability rank (the larger, | 1269 | * Updated applicability rank (the larger, |
1327 | * the better the result fits the search | 1270 | * the better the result fits the search |
1328 | * criteria). | 1271 | * criteria). |
1329 | */ | 1272 | */ |
1330 | uint32_t applicability_rank; | 1273 | uint32_t applicability_rank; |
1331 | 1274 | ||
1332 | /** | 1275 | /** |
1333 | * How long has the current probe been active? | 1276 | * How long has the current probe been active? |
1334 | */ | 1277 | */ |
1335 | struct GNUNET_TIME_Relative current_probe_time; | 1278 | struct GNUNET_TIME_Relative current_probe_time; |
1336 | |||
1337 | } update; | 1279 | } update; |
1338 | 1280 | ||
1339 | /** | 1281 | /** |
1340 | * These values are only valid for | 1282 | * These values are only valid for |
1341 | * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events. | 1283 | * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events. |
1342 | * These events are automatically triggered for | 1284 | * These events are automatically triggered for |
1343 | * each search result before the | 1285 | * each search result before the |
1344 | * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This | 1286 | * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This |
1345 | * happens primarily to give the client a chance | 1287 | * happens primarily to give the client a chance |
1346 | * to clean up the "cctx" (if needed). | 1288 | * to clean up the "cctx" (if needed). |
1347 | */ | 1289 | */ |
1348 | struct | 1290 | struct { |
1349 | { | ||
1350 | |||
1351 | /** | 1291 | /** |
1352 | * Private context set for for this result | 1292 | * Private context set for for this result |
1353 | * during the "RESULT" event. | 1293 | * during the "RESULT" event. |
1354 | */ | 1294 | */ |
1355 | void *cctx; | 1295 | void *cctx; |
1356 | 1296 | ||
1357 | /** | 1297 | /** |
1358 | * Metadata for the search result. | 1298 | * Metadata for the search result. |
1359 | */ | 1299 | */ |
1360 | const struct GNUNET_CONTAINER_MetaData *meta; | 1300 | const struct GNUNET_CONTAINER_MetaData *meta; |
1361 | 1301 | ||
1362 | /** | 1302 | /** |
1363 | * URI for the search result. | 1303 | * URI for the search result. |
1364 | */ | 1304 | */ |
1365 | const struct GNUNET_FS_Uri *uri; | 1305 | const struct GNUNET_FS_Uri *uri; |
1366 | |||
1367 | } result_suspend; | 1306 | } result_suspend; |
1368 | 1307 | ||
1369 | /** | 1308 | /** |
1370 | * These values are only valid for | 1309 | * These values are only valid for |
1371 | * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events. | 1310 | * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events. |
1372 | * These events are automatically triggered for | 1311 | * These events are automatically triggered for |
1373 | * each search result before the | 1312 | * each search result before the |
1374 | * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This | 1313 | * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This |
1375 | * happens primarily to give the client a chance | 1314 | * happens primarily to give the client a chance |
1376 | * to clean up the "cctx" (if needed). | 1315 | * to clean up the "cctx" (if needed). |
1377 | */ | 1316 | */ |
1378 | struct | 1317 | struct { |
1379 | { | ||
1380 | |||
1381 | /** | 1318 | /** |
1382 | * Private context set for for this result | 1319 | * Private context set for for this result |
1383 | * during the "RESULT" event. | 1320 | * during the "RESULT" event. |
1384 | */ | 1321 | */ |
1385 | void *cctx; | 1322 | void *cctx; |
1386 | 1323 | ||
1387 | /** | 1324 | /** |
1388 | * Metadata for the search result. | 1325 | * Metadata for the search result. |
1389 | */ | 1326 | */ |
1390 | const struct GNUNET_CONTAINER_MetaData *meta; | 1327 | const struct GNUNET_CONTAINER_MetaData *meta; |
1391 | 1328 | ||
1392 | /** | 1329 | /** |
1393 | * URI for the search result. | 1330 | * URI for the search result. |
1394 | */ | 1331 | */ |
1395 | const struct GNUNET_FS_Uri *uri; | 1332 | const struct GNUNET_FS_Uri *uri; |
1396 | |||
1397 | } result_stopped; | 1333 | } result_stopped; |
1398 | 1334 | ||
1399 | /** | 1335 | /** |
1400 | * These values are only valid for | 1336 | * These values are only valid for |
1401 | * #GNUNET_FS_STATUS_SEARCH_RESUME events. | 1337 | * #GNUNET_FS_STATUS_SEARCH_RESUME events. |
1402 | */ | 1338 | */ |
1403 | struct | 1339 | struct { |
1404 | { | ||
1405 | |||
1406 | /** | 1340 | /** |
1407 | * Error message, NULL if we have not encountered any error yet. | 1341 | * Error message, NULL if we have not encountered any error yet. |
1408 | */ | 1342 | */ |
1409 | const char *message; | 1343 | const char *message; |
1410 | 1344 | ||
1411 | /** | 1345 | /** |
1412 | * Is this search currently paused? | 1346 | * Is this search currently paused? |
1413 | */ | 1347 | */ |
1414 | int is_paused; | 1348 | int is_paused; |
1415 | |||
1416 | } resume; | 1349 | } resume; |
1417 | 1350 | ||
1418 | /** | 1351 | /** |
1419 | * These values are only valid for | 1352 | * These values are only valid for |
1420 | * #GNUNET_FS_STATUS_SEARCH_ERROR events. | 1353 | * #GNUNET_FS_STATUS_SEARCH_ERROR events. |
1421 | */ | 1354 | */ |
1422 | struct | 1355 | struct { |
1423 | { | ||
1424 | |||
1425 | /** | 1356 | /** |
1426 | * Error message. | 1357 | * Error message. |
1427 | */ | 1358 | */ |
1428 | const char *message; | 1359 | const char *message; |
1429 | |||
1430 | } error; | 1360 | } error; |
1431 | 1361 | ||
1432 | /** | 1362 | /** |
1433 | * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events. | 1363 | * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events. |
1434 | */ | 1364 | */ |
1435 | struct | 1365 | struct { |
1436 | { | ||
1437 | |||
1438 | /** | 1366 | /** |
1439 | * Short, human-readable name of the namespace. | 1367 | * Short, human-readable name of the namespace. |
1440 | */ | 1368 | */ |
1441 | const char *name; | 1369 | const char *name; |
1442 | 1370 | ||
1443 | /** | 1371 | /** |
1444 | * Root identifier for the namespace, can be NULL. | 1372 | * Root identifier for the namespace, can be NULL. |
1445 | */ | 1373 | */ |
1446 | const char *root; | 1374 | const char *root; |
1447 | 1375 | ||
1448 | /** | 1376 | /** |
1449 | * Metadata for the namespace. | 1377 | * Metadata for the namespace. |
1450 | */ | 1378 | */ |
1451 | const struct GNUNET_CONTAINER_MetaData *meta; | 1379 | const struct GNUNET_CONTAINER_MetaData *meta; |
1452 | 1380 | ||
1453 | /** | 1381 | /** |
1454 | * Public key of the namespace. | 1382 | * Public key of the namespace. |
1455 | */ | 1383 | */ |
1456 | struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym; | 1384 | struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym; |
1457 | |||
1458 | } ns; | 1385 | } ns; |
1459 | |||
1460 | } specifics; | 1386 | } specifics; |
1461 | |||
1462 | } search; | 1387 | } search; |
1463 | 1388 | ||
1464 | /** | 1389 | /** |
1465 | * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. | 1390 | * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. |
1466 | */ | 1391 | */ |
1467 | struct | 1392 | struct { |
1468 | { | ||
1469 | |||
1470 | /** | 1393 | /** |
1471 | * Context for controlling the unindexing. | 1394 | * Context for controlling the unindexing. |
1472 | */ | 1395 | */ |
@@ -1510,71 +1433,57 @@ struct GNUNET_FS_ProgressInfo | |||
1510 | /** | 1433 | /** |
1511 | * Additional values for specific events. | 1434 | * Additional values for specific events. |
1512 | */ | 1435 | */ |
1513 | union | 1436 | union { |
1514 | { | ||
1515 | |||
1516 | /** | 1437 | /** |
1517 | * These values are only valid for | 1438 | * These values are only valid for |
1518 | * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events. | 1439 | * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events. |
1519 | */ | 1440 | */ |
1520 | struct | 1441 | struct { |
1521 | { | ||
1522 | |||
1523 | /** | 1442 | /** |
1524 | * Data block we just unindexed. | 1443 | * Data block we just unindexed. |
1525 | */ | 1444 | */ |
1526 | const void *data; | 1445 | const void *data; |
1527 | 1446 | ||
1528 | /** | 1447 | /** |
1529 | * At what offset in the file is "data"? | 1448 | * At what offset in the file is "data"? |
1530 | */ | 1449 | */ |
1531 | uint64_t offset; | 1450 | uint64_t offset; |
1532 | 1451 | ||
1533 | /** | 1452 | /** |
1534 | * Length of the data block. | 1453 | * Length of the data block. |
1535 | */ | 1454 | */ |
1536 | uint64_t data_len; | 1455 | uint64_t data_len; |
1537 | 1456 | ||
1538 | /** | 1457 | /** |
1539 | * Depth of the given block in the tree; | 1458 | * Depth of the given block in the tree; |
1540 | * 0 would be the lowest level (DBLOCKS). | 1459 | * 0 would be the lowest level (DBLOCKS). |
1541 | */ | 1460 | */ |
1542 | unsigned int depth; | 1461 | unsigned int depth; |
1543 | |||
1544 | } progress; | 1462 | } progress; |
1545 | 1463 | ||
1546 | /** | 1464 | /** |
1547 | * These values are only valid for | 1465 | * These values are only valid for |
1548 | * #GNUNET_FS_STATUS_UNINDEX_RESUME events. | 1466 | * #GNUNET_FS_STATUS_UNINDEX_RESUME events. |
1549 | */ | 1467 | */ |
1550 | struct | 1468 | struct { |
1551 | { | ||
1552 | |||
1553 | /** | 1469 | /** |
1554 | * Error message, NULL if we have not encountered any error yet. | 1470 | * Error message, NULL if we have not encountered any error yet. |
1555 | */ | 1471 | */ |
1556 | const char *message; | 1472 | const char *message; |
1557 | |||
1558 | } resume; | 1473 | } resume; |
1559 | 1474 | ||
1560 | /** | 1475 | /** |
1561 | * These values are only valid for | 1476 | * These values are only valid for |
1562 | * #GNUNET_FS_STATUS_UNINDEX_ERROR events. | 1477 | * #GNUNET_FS_STATUS_UNINDEX_ERROR events. |
1563 | */ | 1478 | */ |
1564 | struct | 1479 | struct { |
1565 | { | ||
1566 | |||
1567 | /** | 1480 | /** |
1568 | * Error message. | 1481 | * Error message. |
1569 | */ | 1482 | */ |
1570 | const char *message; | 1483 | const char *message; |
1571 | |||
1572 | } error; | 1484 | } error; |
1573 | |||
1574 | } specifics; | 1485 | } specifics; |
1575 | |||
1576 | } unindex; | 1486 | } unindex; |
1577 | |||
1578 | } value; | 1487 | } value; |
1579 | 1488 | ||
1580 | /** | 1489 | /** |
@@ -1612,8 +1521,7 @@ typedef void * | |||
1612 | /** | 1521 | /** |
1613 | * General (global) option flags for file-sharing. | 1522 | * General (global) option flags for file-sharing. |
1614 | */ | 1523 | */ |
1615 | enum GNUNET_FS_Flags | 1524 | enum GNUNET_FS_Flags { |
1616 | { | ||
1617 | /** | 1525 | /** |
1618 | * No special flags set. | 1526 | * No special flags set. |
1619 | */ | 1527 | */ |
@@ -1637,9 +1545,7 @@ enum GNUNET_FS_Flags | |||
1637 | /** | 1545 | /** |
1638 | * Options specified in the VARARGs portion of GNUNET_FS_start. | 1546 | * Options specified in the VARARGs portion of GNUNET_FS_start. |
1639 | */ | 1547 | */ |
1640 | enum GNUNET_FS_OPTIONS | 1548 | enum GNUNET_FS_OPTIONS { |
1641 | { | ||
1642 | |||
1643 | /** | 1549 | /** |
1644 | * Last option in the VARARG list. | 1550 | * Last option in the VARARG list. |
1645 | */ | 1551 | */ |
@@ -1666,9 +1572,7 @@ enum GNUNET_FS_OPTIONS | |||
1666 | * Settings for publishing a block (which may of course also | 1572 | * Settings for publishing a block (which may of course also |
1667 | * apply to an entire directory or file). | 1573 | * apply to an entire directory or file). |
1668 | */ | 1574 | */ |
1669 | struct GNUNET_FS_BlockOptions | 1575 | struct GNUNET_FS_BlockOptions { |
1670 | { | ||
1671 | |||
1672 | /** | 1576 | /** |
1673 | * At what time should the block expire? Data blocks (DBLOCKS and | 1577 | * At what time should the block expire? Data blocks (DBLOCKS and |
1674 | * IBLOCKS) may still be used even if they are expired (however, | 1578 | * IBLOCKS) may still be used even if they are expired (however, |
@@ -1703,7 +1607,6 @@ struct GNUNET_FS_BlockOptions | |||
1703 | * first place). | 1607 | * first place). |
1704 | */ | 1608 | */ |
1705 | uint32_t replication_level; | 1609 | uint32_t replication_level; |
1706 | |||
1707 | }; | 1610 | }; |
1708 | 1611 | ||
1709 | 1612 | ||
@@ -1725,12 +1628,12 @@ struct GNUNET_FS_Handle; | |||
1725 | * @return NULL on error | 1628 | * @return NULL on error |
1726 | */ | 1629 | */ |
1727 | struct GNUNET_FS_Handle * | 1630 | struct GNUNET_FS_Handle * |
1728 | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1631 | GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
1729 | const char *client_name, | 1632 | const char *client_name, |
1730 | GNUNET_FS_ProgressCallback upcb, | 1633 | GNUNET_FS_ProgressCallback upcb, |
1731 | void *upcb_cls, | 1634 | void *upcb_cls, |
1732 | enum GNUNET_FS_Flags flags, | 1635 | enum GNUNET_FS_Flags flags, |
1733 | ...); | 1636 | ...); |
1734 | 1637 | ||
1735 | 1638 | ||
1736 | /** | 1639 | /** |
@@ -1743,7 +1646,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1743 | * @param h handle that was returned from #GNUNET_FS_start() | 1646 | * @param h handle that was returned from #GNUNET_FS_start() |
1744 | */ | 1647 | */ |
1745 | void | 1648 | void |
1746 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | 1649 | GNUNET_FS_stop(struct GNUNET_FS_Handle *h); |
1747 | 1650 | ||
1748 | 1651 | ||
1749 | /** | 1652 | /** |
@@ -1782,7 +1685,7 @@ typedef int | |||
1782 | * to read this fi-struct from disk. | 1685 | * to read this fi-struct from disk. |
1783 | */ | 1686 | */ |
1784 | const char * | 1687 | const char * |
1785 | GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); | 1688 | GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s); |
1786 | 1689 | ||
1787 | 1690 | ||
1788 | /** | 1691 | /** |
@@ -1792,7 +1695,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); | |||
1792 | * @return "filename" field of the structure (can be NULL) | 1695 | * @return "filename" field of the structure (can be NULL) |
1793 | */ | 1696 | */ |
1794 | const char * | 1697 | const char * |
1795 | GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s); | 1698 | GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s); |
1796 | 1699 | ||
1797 | 1700 | ||
1798 | /** | 1701 | /** |
@@ -1804,8 +1707,8 @@ GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s); | |||
1804 | * @param filename filename to set | 1707 | * @param filename filename to set |
1805 | */ | 1708 | */ |
1806 | void | 1709 | void |
1807 | GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s, | 1710 | GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s, |
1808 | const char *filename); | 1711 | const char *filename); |
1809 | 1712 | ||
1810 | 1713 | ||
1811 | /** | 1714 | /** |
@@ -1823,13 +1726,13 @@ GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s, | |||
1823 | * @return publish structure entry for the file | 1726 | * @return publish structure entry for the file |
1824 | */ | 1727 | */ |
1825 | struct GNUNET_FS_FileInformation * | 1728 | struct GNUNET_FS_FileInformation * |
1826 | GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | 1729 | GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h, |
1827 | void *client_info, | 1730 | void *client_info, |
1828 | const char *filename, | 1731 | const char *filename, |
1829 | const struct GNUNET_FS_Uri *keywords, | 1732 | const struct GNUNET_FS_Uri *keywords, |
1830 | const struct GNUNET_CONTAINER_MetaData *meta, | 1733 | const struct GNUNET_CONTAINER_MetaData *meta, |
1831 | int do_index, | 1734 | int do_index, |
1832 | const struct GNUNET_FS_BlockOptions *bo); | 1735 | const struct GNUNET_FS_BlockOptions *bo); |
1833 | 1736 | ||
1834 | 1737 | ||
1835 | /** | 1738 | /** |
@@ -1849,14 +1752,14 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | |||
1849 | * @return publish structure entry for the file | 1752 | * @return publish structure entry for the file |
1850 | */ | 1753 | */ |
1851 | struct GNUNET_FS_FileInformation * | 1754 | struct GNUNET_FS_FileInformation * |
1852 | GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, | 1755 | GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h, |
1853 | void *client_info, | 1756 | void *client_info, |
1854 | uint64_t length, | 1757 | uint64_t length, |
1855 | void *data, | 1758 | void *data, |
1856 | const struct GNUNET_FS_Uri *keywords, | 1759 | const struct GNUNET_FS_Uri *keywords, |
1857 | const struct GNUNET_CONTAINER_MetaData *meta, | 1760 | const struct GNUNET_CONTAINER_MetaData *meta, |
1858 | int do_index, | 1761 | int do_index, |
1859 | const struct GNUNET_FS_BlockOptions *bo); | 1762 | const struct GNUNET_FS_BlockOptions *bo); |
1860 | 1763 | ||
1861 | 1764 | ||
1862 | /** | 1765 | /** |
@@ -1904,18 +1807,18 @@ typedef size_t | |||
1904 | * @return publish structure entry for the file | 1807 | * @return publish structure entry for the file |
1905 | */ | 1808 | */ |
1906 | struct GNUNET_FS_FileInformation * | 1809 | struct GNUNET_FS_FileInformation * |
1907 | GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | 1810 | GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h, |
1908 | void *client_info, | 1811 | void *client_info, |
1909 | uint64_t length, | 1812 | uint64_t length, |
1910 | GNUNET_FS_DataReader reader, | 1813 | GNUNET_FS_DataReader reader, |
1911 | void *reader_cls, | 1814 | void *reader_cls, |
1912 | const struct GNUNET_FS_Uri | 1815 | const struct GNUNET_FS_Uri |
1913 | *keywords, | 1816 | *keywords, |
1914 | const struct | 1817 | const struct |
1915 | GNUNET_CONTAINER_MetaData *meta, | 1818 | GNUNET_CONTAINER_MetaData *meta, |
1916 | int do_index, | 1819 | int do_index, |
1917 | const struct | 1820 | const struct |
1918 | GNUNET_FS_BlockOptions *bo); | 1821 | GNUNET_FS_BlockOptions *bo); |
1919 | 1822 | ||
1920 | 1823 | ||
1921 | /** | 1824 | /** |
@@ -1931,16 +1834,16 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | |||
1931 | * @return publish structure entry for the directory , NULL on error | 1834 | * @return publish structure entry for the directory , NULL on error |
1932 | */ | 1835 | */ |
1933 | struct GNUNET_FS_FileInformation * | 1836 | struct GNUNET_FS_FileInformation * |
1934 | GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, | 1837 | GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h, |
1935 | void *client_info, | 1838 | void *client_info, |
1936 | const struct GNUNET_FS_Uri | 1839 | const struct GNUNET_FS_Uri |
1937 | *keywords, | 1840 | *keywords, |
1938 | const struct | 1841 | const struct |
1939 | GNUNET_CONTAINER_MetaData | 1842 | GNUNET_CONTAINER_MetaData |
1940 | *meta, | 1843 | *meta, |
1941 | const struct | 1844 | const struct |
1942 | GNUNET_FS_BlockOptions *bo, | 1845 | GNUNET_FS_BlockOptions *bo, |
1943 | const char *filename); | 1846 | const char *filename); |
1944 | 1847 | ||
1945 | 1848 | ||
1946 | /** | 1849 | /** |
@@ -1950,8 +1853,8 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, | |||
1950 | * @return #GNUNET_YES if so, #GNUNET_NO if not | 1853 | * @return #GNUNET_YES if so, #GNUNET_NO if not |
1951 | */ | 1854 | */ |
1952 | int | 1855 | int |
1953 | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | 1856 | GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation |
1954 | *ent); | 1857 | *ent); |
1955 | 1858 | ||
1956 | 1859 | ||
1957 | /** | 1860 | /** |
@@ -1966,8 +1869,8 @@ GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | |||
1966 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 1869 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
1967 | */ | 1870 | */ |
1968 | int | 1871 | int |
1969 | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | 1872 | GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir, |
1970 | struct GNUNET_FS_FileInformation *ent); | 1873 | struct GNUNET_FS_FileInformation *ent); |
1971 | 1874 | ||
1972 | 1875 | ||
1973 | /** | 1876 | /** |
@@ -1985,9 +1888,9 @@ GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | |||
1985 | * @param proc_cls closure for @a proc | 1888 | * @param proc_cls closure for @a proc |
1986 | */ | 1889 | */ |
1987 | void | 1890 | void |
1988 | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | 1891 | GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir, |
1989 | GNUNET_FS_FileInformationProcessor proc, | 1892 | GNUNET_FS_FileInformationProcessor proc, |
1990 | void *proc_cls); | 1893 | void *proc_cls); |
1991 | 1894 | ||
1992 | 1895 | ||
1993 | /** | 1896 | /** |
@@ -2001,17 +1904,16 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
2001 | * @param cleaner_cls closure for @a cleaner | 1904 | * @param cleaner_cls closure for @a cleaner |
2002 | */ | 1905 | */ |
2003 | void | 1906 | void |
2004 | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | 1907 | GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, |
2005 | GNUNET_FS_FileInformationProcessor cleaner, | 1908 | GNUNET_FS_FileInformationProcessor cleaner, |
2006 | void *cleaner_cls); | 1909 | void *cleaner_cls); |
2007 | 1910 | ||
2008 | 1911 | ||
2009 | /** | 1912 | /** |
2010 | * Options for publishing. Compatible options | 1913 | * Options for publishing. Compatible options |
2011 | * can be OR'ed together. | 1914 | * can be OR'ed together. |
2012 | */ | 1915 | */ |
2013 | enum GNUNET_FS_PublishOptions | 1916 | enum GNUNET_FS_PublishOptions { |
2014 | { | ||
2015 | /** | 1917 | /** |
2016 | * No options (use defaults for everything). | 1918 | * No options (use defaults for everything). |
2017 | */ | 1919 | */ |
@@ -2039,12 +1941,12 @@ enum GNUNET_FS_PublishOptions | |||
2039 | * @return context that can be used to control the publish operation | 1941 | * @return context that can be used to control the publish operation |
2040 | */ | 1942 | */ |
2041 | struct GNUNET_FS_PublishContext * | 1943 | struct GNUNET_FS_PublishContext * |
2042 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | 1944 | GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h, |
2043 | struct GNUNET_FS_FileInformation *fi, | 1945 | struct GNUNET_FS_FileInformation *fi, |
2044 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, | 1946 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
2045 | const char *nid, | 1947 | const char *nid, |
2046 | const char *nuid, | 1948 | const char *nuid, |
2047 | enum GNUNET_FS_PublishOptions options); | 1949 | enum GNUNET_FS_PublishOptions options); |
2048 | 1950 | ||
2049 | 1951 | ||
2050 | /** | 1952 | /** |
@@ -2056,7 +1958,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | |||
2056 | * @param pc context for the publication to stop | 1958 | * @param pc context for the publication to stop |
2057 | */ | 1959 | */ |
2058 | void | 1960 | void |
2059 | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); | 1961 | GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc); |
2060 | 1962 | ||
2061 | 1963 | ||
2062 | /** | 1964 | /** |
@@ -2093,13 +1995,13 @@ struct GNUNET_FS_PublishKskContext; | |||
2093 | * @return NULL on error (@a cont will still be called) | 1995 | * @return NULL on error (@a cont will still be called) |
2094 | */ | 1996 | */ |
2095 | struct GNUNET_FS_PublishKskContext * | 1997 | struct GNUNET_FS_PublishKskContext * |
2096 | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | 1998 | GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h, |
2097 | const struct GNUNET_FS_Uri *ksk_uri, | 1999 | const struct GNUNET_FS_Uri *ksk_uri, |
2098 | const struct GNUNET_CONTAINER_MetaData *meta, | 2000 | const struct GNUNET_CONTAINER_MetaData *meta, |
2099 | const struct GNUNET_FS_Uri *uri, | 2001 | const struct GNUNET_FS_Uri *uri, |
2100 | const struct GNUNET_FS_BlockOptions *bo, | 2002 | const struct GNUNET_FS_BlockOptions *bo, |
2101 | enum GNUNET_FS_PublishOptions options, | 2003 | enum GNUNET_FS_PublishOptions options, |
2102 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2004 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2103 | 2005 | ||
2104 | 2006 | ||
2105 | /** | 2007 | /** |
@@ -2108,7 +2010,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2108 | * @param pkc context of the operation to abort. | 2010 | * @param pkc context of the operation to abort. |
2109 | */ | 2011 | */ |
2110 | void | 2012 | void |
2111 | GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc); | 2013 | GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc); |
2112 | 2014 | ||
2113 | 2015 | ||
2114 | /** | 2016 | /** |
@@ -2133,15 +2035,15 @@ struct GNUNET_FS_PublishSksContext; | |||
2133 | * @return NULL on error (@a cont will still be called) | 2035 | * @return NULL on error (@a cont will still be called) |
2134 | */ | 2036 | */ |
2135 | struct GNUNET_FS_PublishSksContext * | 2037 | struct GNUNET_FS_PublishSksContext * |
2136 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 2038 | GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h, |
2137 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, | 2039 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
2138 | const char *identifier, | 2040 | const char *identifier, |
2139 | const char *update, | 2041 | const char *update, |
2140 | const struct GNUNET_CONTAINER_MetaData *meta, | 2042 | const struct GNUNET_CONTAINER_MetaData *meta, |
2141 | const struct GNUNET_FS_Uri *uri, | 2043 | const struct GNUNET_FS_Uri *uri, |
2142 | const struct GNUNET_FS_BlockOptions *bo, | 2044 | const struct GNUNET_FS_BlockOptions *bo, |
2143 | enum GNUNET_FS_PublishOptions options, | 2045 | enum GNUNET_FS_PublishOptions options, |
2144 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2046 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2145 | 2047 | ||
2146 | 2048 | ||
2147 | /** | 2049 | /** |
@@ -2150,7 +2052,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
2150 | * @param psc context of the operation to abort. | 2052 | * @param psc context of the operation to abort. |
2151 | */ | 2053 | */ |
2152 | void | 2054 | void |
2153 | GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc); | 2055 | GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc); |
2154 | 2056 | ||
2155 | 2057 | ||
2156 | /** | 2058 | /** |
@@ -2182,9 +2084,9 @@ struct GNUNET_FS_GetIndexedContext; | |||
2182 | * @return NULL on error (@a iterator is not called) | 2084 | * @return NULL on error (@a iterator is not called) |
2183 | */ | 2085 | */ |
2184 | struct GNUNET_FS_GetIndexedContext * | 2086 | struct GNUNET_FS_GetIndexedContext * |
2185 | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | 2087 | GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h, |
2186 | GNUNET_FS_IndexedFileProcessor iterator, | 2088 | GNUNET_FS_IndexedFileProcessor iterator, |
2187 | void *iterator_cls); | 2089 | void *iterator_cls); |
2188 | 2090 | ||
2189 | 2091 | ||
2190 | /** | 2092 | /** |
@@ -2193,7 +2095,7 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | |||
2193 | * @param gic operation to cancel | 2095 | * @param gic operation to cancel |
2194 | */ | 2096 | */ |
2195 | void | 2097 | void |
2196 | GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic); | 2098 | GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic); |
2197 | 2099 | ||
2198 | 2100 | ||
2199 | /** | 2101 | /** |
@@ -2205,9 +2107,9 @@ GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic); | |||
2205 | * @return NULL on error, otherwise handle | 2107 | * @return NULL on error, otherwise handle |
2206 | */ | 2108 | */ |
2207 | struct GNUNET_FS_UnindexContext * | 2109 | struct GNUNET_FS_UnindexContext * |
2208 | GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, | 2110 | GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, |
2209 | const char *filename, | 2111 | const char *filename, |
2210 | void *cctx); | 2112 | void *cctx); |
2211 | 2113 | ||
2212 | 2114 | ||
2213 | /** | 2115 | /** |
@@ -2216,7 +2118,7 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, | |||
2216 | * @param uc handle | 2118 | * @param uc handle |
2217 | */ | 2119 | */ |
2218 | void | 2120 | void |
2219 | GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | 2121 | GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc); |
2220 | 2122 | ||
2221 | 2123 | ||
2222 | /** | 2124 | /** |
@@ -2229,10 +2131,10 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2229 | * @param next_id identifier that should be used for updates | 2131 | * @param next_id identifier that should be used for updates |
2230 | */ | 2132 | */ |
2231 | typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, | 2133 | typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, |
2232 | const char *last_id, | 2134 | const char *last_id, |
2233 | const struct GNUNET_FS_Uri *last_uri, | 2135 | const struct GNUNET_FS_Uri *last_uri, |
2234 | const struct GNUNET_CONTAINER_MetaData *last_meta, | 2136 | const struct GNUNET_CONTAINER_MetaData *last_meta, |
2235 | const char *next_id); | 2137 | const char *next_id); |
2236 | 2138 | ||
2237 | 2139 | ||
2238 | /** | 2140 | /** |
@@ -2257,27 +2159,26 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, | |||
2257 | * @param ip_cls closure for @a ip | 2159 | * @param ip_cls closure for @a ip |
2258 | */ | 2160 | */ |
2259 | void | 2161 | void |
2260 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, | 2162 | GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h, |
2261 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, | 2163 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
2262 | const char *next_id, | 2164 | const char *next_id, |
2263 | GNUNET_FS_IdentifierProcessor ip, | 2165 | GNUNET_FS_IdentifierProcessor ip, |
2264 | void *ip_cls); | 2166 | void *ip_cls); |
2265 | 2167 | ||
2266 | 2168 | ||
2267 | /** | 2169 | /** |
2268 | * Options for searching. Compatible options | 2170 | * Options for searching. Compatible options |
2269 | * can be OR'ed together. | 2171 | * can be OR'ed together. |
2270 | */ | 2172 | */ |
2271 | enum GNUNET_FS_SearchOptions | 2173 | enum GNUNET_FS_SearchOptions { |
2272 | { | 2174 | /** |
2273 | /** | 2175 | * No options (use defaults for everything). |
2274 | * No options (use defaults for everything). | 2176 | */ |
2275 | */ | ||
2276 | GNUNET_FS_SEARCH_OPTION_NONE = 0, | 2177 | GNUNET_FS_SEARCH_OPTION_NONE = 0, |
2277 | 2178 | ||
2278 | /** | 2179 | /** |
2279 | * Only search the local host, do not search remote systems (no P2P) | 2180 | * Only search the local host, do not search remote systems (no P2P) |
2280 | */ | 2181 | */ |
2281 | GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1 | 2182 | GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1 |
2282 | }; | 2183 | }; |
2283 | 2184 | ||
@@ -2294,9 +2195,9 @@ enum GNUNET_FS_SearchOptions | |||
2294 | * @return context that can be used to control the search | 2195 | * @return context that can be used to control the search |
2295 | */ | 2196 | */ |
2296 | struct GNUNET_FS_SearchContext * | 2197 | struct GNUNET_FS_SearchContext * |
2297 | GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, | 2198 | GNUNET_FS_search_start(struct GNUNET_FS_Handle *h, |
2298 | const struct GNUNET_FS_Uri *uri, uint32_t anonymity, | 2199 | const struct GNUNET_FS_Uri *uri, uint32_t anonymity, |
2299 | enum GNUNET_FS_SearchOptions options, void *cctx); | 2200 | enum GNUNET_FS_SearchOptions options, void *cctx); |
2300 | 2201 | ||
2301 | 2202 | ||
2302 | /** | 2203 | /** |
@@ -2305,7 +2206,7 @@ GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, | |||
2305 | * @param sc context for the search that should be paused | 2206 | * @param sc context for the search that should be paused |
2306 | */ | 2207 | */ |
2307 | void | 2208 | void |
2308 | GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | 2209 | GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc); |
2309 | 2210 | ||
2310 | 2211 | ||
2311 | /** | 2212 | /** |
@@ -2314,7 +2215,7 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | |||
2314 | * @param sc context for the search that should be resumed | 2215 | * @param sc context for the search that should be resumed |
2315 | */ | 2216 | */ |
2316 | void | 2217 | void |
2317 | GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | 2218 | GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc); |
2318 | 2219 | ||
2319 | 2220 | ||
2320 | /** | 2221 | /** |
@@ -2323,7 +2224,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | |||
2323 | * @param sc context for the search that should be stopped | 2224 | * @param sc context for the search that should be stopped |
2324 | */ | 2225 | */ |
2325 | void | 2226 | void |
2326 | GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | 2227 | GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc); |
2327 | 2228 | ||
2328 | 2229 | ||
2329 | /** | 2230 | /** |
@@ -2337,11 +2238,11 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | |||
2337 | * @return the search result handle to access the probe activity | 2238 | * @return the search result handle to access the probe activity |
2338 | */ | 2239 | */ |
2339 | struct GNUNET_FS_SearchResult * | 2240 | struct GNUNET_FS_SearchResult * |
2340 | GNUNET_FS_probe (struct GNUNET_FS_Handle *h, | 2241 | GNUNET_FS_probe(struct GNUNET_FS_Handle *h, |
2341 | const struct GNUNET_FS_Uri *uri, | 2242 | const struct GNUNET_FS_Uri *uri, |
2342 | const struct GNUNET_CONTAINER_MetaData *meta, | 2243 | const struct GNUNET_CONTAINER_MetaData *meta, |
2343 | void *client_info, | 2244 | void *client_info, |
2344 | uint32_t anonymity); | 2245 | uint32_t anonymity); |
2345 | 2246 | ||
2346 | 2247 | ||
2347 | /** | 2248 | /** |
@@ -2352,15 +2253,14 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h, | |||
2352 | * @return the value of the 'client_info' pointer | 2253 | * @return the value of the 'client_info' pointer |
2353 | */ | 2254 | */ |
2354 | void * | 2255 | void * |
2355 | GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr); | 2256 | GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr); |
2356 | 2257 | ||
2357 | 2258 | ||
2358 | /** | 2259 | /** |
2359 | * Options for downloading. Compatible options | 2260 | * Options for downloading. Compatible options |
2360 | * can be OR'ed together. | 2261 | * can be OR'ed together. |
2361 | */ | 2262 | */ |
2362 | enum GNUNET_FS_DownloadOptions | 2263 | enum GNUNET_FS_DownloadOptions { |
2363 | { | ||
2364 | /** | 2264 | /** |
2365 | * No options (use defaults for everything). | 2265 | * No options (use defaults for everything). |
2366 | */ | 2266 | */ |
@@ -2426,13 +2326,13 @@ enum GNUNET_FS_DownloadOptions | |||
2426 | * @return context that can be used to control this download | 2326 | * @return context that can be used to control this download |
2427 | */ | 2327 | */ |
2428 | struct GNUNET_FS_DownloadContext * | 2328 | struct GNUNET_FS_DownloadContext * |
2429 | GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, | 2329 | GNUNET_FS_download_start(struct GNUNET_FS_Handle *h, |
2430 | const struct GNUNET_FS_Uri *uri, | 2330 | const struct GNUNET_FS_Uri *uri, |
2431 | const struct GNUNET_CONTAINER_MetaData *meta, | 2331 | const struct GNUNET_CONTAINER_MetaData *meta, |
2432 | const char *filename, const char *tempname, | 2332 | const char *filename, const char *tempname, |
2433 | uint64_t offset, uint64_t length, uint32_t anonymity, | 2333 | uint64_t offset, uint64_t length, uint32_t anonymity, |
2434 | enum GNUNET_FS_DownloadOptions options, void *cctx, | 2334 | enum GNUNET_FS_DownloadOptions options, void *cctx, |
2435 | struct GNUNET_FS_DownloadContext *parent); | 2335 | struct GNUNET_FS_DownloadContext *parent); |
2436 | 2336 | ||
2437 | 2337 | ||
2438 | /** | 2338 | /** |
@@ -2470,13 +2370,13 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, | |||
2470 | * @return context that can be used to control this download | 2370 | * @return context that can be used to control this download |
2471 | */ | 2371 | */ |
2472 | struct GNUNET_FS_DownloadContext * | 2372 | struct GNUNET_FS_DownloadContext * |
2473 | GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, | 2373 | GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h, |
2474 | struct GNUNET_FS_SearchResult *sr, | 2374 | struct GNUNET_FS_SearchResult *sr, |
2475 | const char *filename, | 2375 | const char *filename, |
2476 | const char *tempname, uint64_t offset, | 2376 | const char *tempname, uint64_t offset, |
2477 | uint64_t length, uint32_t anonymity, | 2377 | uint64_t length, uint32_t anonymity, |
2478 | enum GNUNET_FS_DownloadOptions options, | 2378 | enum GNUNET_FS_DownloadOptions options, |
2479 | void *cctx); | 2379 | void *cctx); |
2480 | 2380 | ||
2481 | 2381 | ||
2482 | /** | 2382 | /** |
@@ -2486,7 +2386,7 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, | |||
2486 | * @param do_delete delete files of incomplete downloads | 2386 | * @param do_delete delete files of incomplete downloads |
2487 | */ | 2387 | */ |
2488 | void | 2388 | void |
2489 | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | 2389 | GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete); |
2490 | 2390 | ||
2491 | 2391 | ||
2492 | /** | 2392 | /** |
@@ -2495,7 +2395,7 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | |||
2495 | * @param dc handle for the download | 2395 | * @param dc handle for the download |
2496 | */ | 2396 | */ |
2497 | void | 2397 | void |
2498 | GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc); | 2398 | GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc); |
2499 | 2399 | ||
2500 | 2400 | ||
2501 | /** | 2401 | /** |
@@ -2504,7 +2404,7 @@ GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc); | |||
2504 | * @param dc handle for the download | 2404 | * @param dc handle for the download |
2505 | */ | 2405 | */ |
2506 | void | 2406 | void |
2507 | GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc); | 2407 | GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc); |
2508 | 2408 | ||
2509 | 2409 | ||
2510 | 2410 | ||
@@ -2523,8 +2423,8 @@ GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc); | |||
2523 | * we have no mime-type information (treat as #GNUNET_NO) | 2423 | * we have no mime-type information (treat as #GNUNET_NO) |
2524 | */ | 2424 | */ |
2525 | int | 2425 | int |
2526 | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData | 2426 | GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData |
2527 | *md); | 2427 | *md); |
2528 | 2428 | ||
2529 | 2429 | ||
2530 | /** | 2430 | /** |
@@ -2534,7 +2434,7 @@ GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData | |||
2534 | * @param md metadata to add mimetype to | 2434 | * @param md metadata to add mimetype to |
2535 | */ | 2435 | */ |
2536 | void | 2436 | void |
2537 | GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | 2437 | GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md); |
2538 | 2438 | ||
2539 | 2439 | ||
2540 | /** | 2440 | /** |
@@ -2544,7 +2444,7 @@ GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | |||
2544 | * @return NULL if meta data is useless for suggesting a filename | 2444 | * @return NULL if meta data is useless for suggesting a filename |
2545 | */ | 2445 | */ |
2546 | char * | 2446 | char * |
2547 | GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData *md); | 2447 | GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md); |
2548 | 2448 | ||
2549 | 2449 | ||
2550 | /** | 2450 | /** |
@@ -2592,10 +2492,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, | |||
2592 | * #GNUNET_SYSERR if 'data' does not represent a directory | 2492 | * #GNUNET_SYSERR if 'data' does not represent a directory |
2593 | */ | 2493 | */ |
2594 | int | 2494 | int |
2595 | GNUNET_FS_directory_list_contents (size_t size, const void *data, | 2495 | GNUNET_FS_directory_list_contents(size_t size, const void *data, |
2596 | uint64_t offset, | 2496 | uint64_t offset, |
2597 | GNUNET_FS_DirectoryEntryProcessor dep, | 2497 | GNUNET_FS_DirectoryEntryProcessor dep, |
2598 | void *dep_cls); | 2498 | void *dep_cls); |
2599 | 2499 | ||
2600 | 2500 | ||
2601 | /** | 2501 | /** |
@@ -2610,8 +2510,8 @@ struct GNUNET_FS_DirectoryBuilder; | |||
2610 | * @param mdir metadata for the directory | 2510 | * @param mdir metadata for the directory |
2611 | */ | 2511 | */ |
2612 | struct GNUNET_FS_DirectoryBuilder * | 2512 | struct GNUNET_FS_DirectoryBuilder * |
2613 | GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData | 2513 | GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData |
2614 | *mdir); | 2514 | *mdir); |
2615 | 2515 | ||
2616 | 2516 | ||
2617 | /** | 2517 | /** |
@@ -2625,10 +2525,10 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData | |||
2625 | * by the uri | 2525 | * by the uri |
2626 | */ | 2526 | */ |
2627 | void | 2527 | void |
2628 | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | 2528 | GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld, |
2629 | const struct GNUNET_FS_Uri *uri, | 2529 | const struct GNUNET_FS_Uri *uri, |
2630 | const struct GNUNET_CONTAINER_MetaData *md, | 2530 | const struct GNUNET_CONTAINER_MetaData *md, |
2631 | const void *data); | 2531 | const void *data); |
2632 | 2532 | ||
2633 | 2533 | ||
2634 | /** | 2534 | /** |
@@ -2642,8 +2542,8 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2642 | * @return #GNUNET_OK on success | 2542 | * @return #GNUNET_OK on success |
2643 | */ | 2543 | */ |
2644 | int | 2544 | int |
2645 | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | 2545 | GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, |
2646 | size_t * rsize, void **rdata); | 2546 | size_t * rsize, void **rdata); |
2647 | 2547 | ||
2648 | 2548 | ||
2649 | /* ******************** DirScanner API *********************** */ | 2549 | /* ******************** DirScanner API *********************** */ |
@@ -2651,9 +2551,7 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2651 | /** | 2551 | /** |
2652 | * Progress reasons of the directory scanner. | 2552 | * Progress reasons of the directory scanner. |
2653 | */ | 2553 | */ |
2654 | enum GNUNET_FS_DirScannerProgressUpdateReason | 2554 | enum GNUNET_FS_DirScannerProgressUpdateReason { |
2655 | { | ||
2656 | |||
2657 | /** | 2555 | /** |
2658 | * We've started processing a file or directory. | 2556 | * We've started processing a file or directory. |
2659 | */ | 2557 | */ |
@@ -2685,7 +2583,6 @@ enum GNUNET_FS_DirScannerProgressUpdateReason | |||
2685 | * There was an internal error. Application should abort the scan. | 2583 | * There was an internal error. Application should abort the scan. |
2686 | */ | 2584 | */ |
2687 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR | 2585 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR |
2688 | |||
2689 | }; | 2586 | }; |
2690 | 2587 | ||
2691 | 2588 | ||
@@ -2701,16 +2598,15 @@ enum GNUNET_FS_DirScannerProgressUpdateReason | |||
2701 | * @param reason kind of progress we are making | 2598 | * @param reason kind of progress we are making |
2702 | */ | 2599 | */ |
2703 | typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, | 2600 | typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, |
2704 | const char *filename, | 2601 | const char *filename, |
2705 | int is_directory, | 2602 | int is_directory, |
2706 | enum GNUNET_FS_DirScannerProgressUpdateReason reason); | 2603 | enum GNUNET_FS_DirScannerProgressUpdateReason reason); |
2707 | 2604 | ||
2708 | 2605 | ||
2709 | /** | 2606 | /** |
2710 | * A node of a directory tree (produced by dirscanner) | 2607 | * A node of a directory tree (produced by dirscanner) |
2711 | */ | 2608 | */ |
2712 | struct GNUNET_FS_ShareTreeItem | 2609 | struct GNUNET_FS_ShareTreeItem { |
2713 | { | ||
2714 | /** | 2610 | /** |
2715 | * This is a doubly-linked list | 2611 | * This is a doubly-linked list |
2716 | */ | 2612 | */ |
@@ -2763,7 +2659,6 @@ struct GNUNET_FS_ShareTreeItem | |||
2763 | * #GNUNET_YES if this is a directory | 2659 | * #GNUNET_YES if this is a directory |
2764 | */ | 2660 | */ |
2765 | int is_directory; | 2661 | int is_directory; |
2766 | |||
2767 | }; | 2662 | }; |
2768 | 2663 | ||
2769 | 2664 | ||
@@ -2785,11 +2680,11 @@ struct GNUNET_FS_DirScanner; | |||
2785 | * @return directory scanner object to be used for controlling the scanner | 2680 | * @return directory scanner object to be used for controlling the scanner |
2786 | */ | 2681 | */ |
2787 | struct GNUNET_FS_DirScanner * | 2682 | struct GNUNET_FS_DirScanner * |
2788 | GNUNET_FS_directory_scan_start (const char *filename, | 2683 | GNUNET_FS_directory_scan_start(const char *filename, |
2789 | int disable_extractor, | 2684 | int disable_extractor, |
2790 | const char *ex, | 2685 | const char *ex, |
2791 | GNUNET_FS_DirScannerProgressCallback cb, | 2686 | GNUNET_FS_DirScannerProgressCallback cb, |
2792 | void *cb_cls); | 2687 | void *cb_cls); |
2793 | 2688 | ||
2794 | 2689 | ||
2795 | /** | 2690 | /** |
@@ -2799,7 +2694,7 @@ GNUNET_FS_directory_scan_start (const char *filename, | |||
2799 | * @param ds directory scanner structure | 2694 | * @param ds directory scanner structure |
2800 | */ | 2695 | */ |
2801 | void | 2696 | void |
2802 | GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds); | 2697 | GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds); |
2803 | 2698 | ||
2804 | 2699 | ||
2805 | /** | 2700 | /** |
@@ -2811,7 +2706,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds); | |||
2811 | * @return the results of the scan (a directory tree) | 2706 | * @return the results of the scan (a directory tree) |
2812 | */ | 2707 | */ |
2813 | struct GNUNET_FS_ShareTreeItem * | 2708 | struct GNUNET_FS_ShareTreeItem * |
2814 | GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds); | 2709 | GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds); |
2815 | 2710 | ||
2816 | 2711 | ||
2817 | /** | 2712 | /** |
@@ -2821,7 +2716,7 @@ GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds); | |||
2821 | * @param toplevel toplevel directory in the tree, returned by the scanner | 2716 | * @param toplevel toplevel directory in the tree, returned by the scanner |
2822 | */ | 2717 | */ |
2823 | void | 2718 | void |
2824 | GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel); | 2719 | GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel); |
2825 | 2720 | ||
2826 | 2721 | ||
2827 | /** | 2722 | /** |
@@ -2830,7 +2725,7 @@ GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel); | |||
2830 | * @param toplevel toplevel of the tree to be freed | 2725 | * @param toplevel toplevel of the tree to be freed |
2831 | */ | 2726 | */ |
2832 | void | 2727 | void |
2833 | GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel); | 2728 | GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel); |
2834 | 2729 | ||
2835 | 2730 | ||
2836 | #if 0 /* keep Emacsens' auto-indent happy */ | 2731 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 1e99c63d0..ef744fbc9 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -44,9 +44,7 @@ extern "C" { | |||
44 | /** | 44 | /** |
45 | * @brief General context for command line processors. | 45 | * @brief General context for command line processors. |
46 | */ | 46 | */ |
47 | struct GNUNET_GETOPT_CommandLineProcessorContext | 47 | struct GNUNET_GETOPT_CommandLineProcessorContext { |
48 | { | ||
49 | |||
50 | /** | 48 | /** |
51 | * Name of the application | 49 | * Name of the application |
52 | */ | 50 | */ |
@@ -98,9 +96,7 @@ typedef int (*GNUNET_GETOPT_CommandLineOptionProcessor) ( | |||
98 | /** | 96 | /** |
99 | * @brief Definition of a command line option. | 97 | * @brief Definition of a command line option. |
100 | */ | 98 | */ |
101 | struct GNUNET_GETOPT_CommandLineOption | 99 | struct GNUNET_GETOPT_CommandLineOption { |
102 | { | ||
103 | |||
104 | /** | 100 | /** |
105 | * Short name of the option. | 101 | * Short name of the option. |
106 | */ | 102 | */ |
@@ -162,7 +158,7 @@ struct GNUNET_GETOPT_CommandLineOption | |||
162 | * @param about string with brief description of the application | 158 | * @param about string with brief description of the application |
163 | */ | 159 | */ |
164 | struct GNUNET_GETOPT_CommandLineOption | 160 | struct GNUNET_GETOPT_CommandLineOption |
165 | GNUNET_GETOPT_option_help (const char *about); | 161 | GNUNET_GETOPT_option_help(const char *about); |
166 | 162 | ||
167 | 163 | ||
168 | /** | 164 | /** |
@@ -172,7 +168,7 @@ GNUNET_GETOPT_option_help (const char *about); | |||
172 | * @param version string with the version number | 168 | * @param version string with the version number |
173 | */ | 169 | */ |
174 | struct GNUNET_GETOPT_CommandLineOption | 170 | struct GNUNET_GETOPT_CommandLineOption |
175 | GNUNET_GETOPT_option_version (const char *version); | 171 | GNUNET_GETOPT_option_version(const char *version); |
176 | 172 | ||
177 | 173 | ||
178 | /** | 174 | /** |
@@ -181,7 +177,7 @@ GNUNET_GETOPT_option_version (const char *version); | |||
181 | * @param[out] logfn set to the name of the logfile | 177 | * @param[out] logfn set to the name of the logfile |
182 | */ | 178 | */ |
183 | struct GNUNET_GETOPT_CommandLineOption | 179 | struct GNUNET_GETOPT_CommandLineOption |
184 | GNUNET_GETOPT_option_logfile (char **logfn); | 180 | GNUNET_GETOPT_option_logfile(char **logfn); |
185 | 181 | ||
186 | 182 | ||
187 | /** | 183 | /** |
@@ -194,11 +190,11 @@ GNUNET_GETOPT_option_logfile (char **logfn); | |||
194 | * @param[out] str set to the string | 190 | * @param[out] str set to the string |
195 | */ | 191 | */ |
196 | struct GNUNET_GETOPT_CommandLineOption | 192 | struct GNUNET_GETOPT_CommandLineOption |
197 | GNUNET_GETOPT_option_string (char shortName, | 193 | GNUNET_GETOPT_option_string(char shortName, |
198 | const char *name, | 194 | const char *name, |
199 | const char *argumentHelp, | 195 | const char *argumentHelp, |
200 | const char *description, | 196 | const char *description, |
201 | char **str); | 197 | char **str); |
202 | 198 | ||
203 | /** | 199 | /** |
204 | * Allow user to specify a filename (automatically path expanded). | 200 | * Allow user to specify a filename (automatically path expanded). |
@@ -210,11 +206,11 @@ GNUNET_GETOPT_option_string (char shortName, | |||
210 | * @param[out] str set to the string | 206 | * @param[out] str set to the string |
211 | */ | 207 | */ |
212 | struct GNUNET_GETOPT_CommandLineOption | 208 | struct GNUNET_GETOPT_CommandLineOption |
213 | GNUNET_GETOPT_option_filename (char shortName, | 209 | GNUNET_GETOPT_option_filename(char shortName, |
214 | const char *name, | 210 | const char *name, |
215 | const char *argumentHelp, | 211 | const char *argumentHelp, |
216 | const char *description, | 212 | const char *description, |
217 | char **str); | 213 | char **str); |
218 | 214 | ||
219 | 215 | ||
220 | /** | 216 | /** |
@@ -229,12 +225,12 @@ GNUNET_GETOPT_option_filename (char shortName, | |||
229 | * @param val_size size of @a val in bytes | 225 | * @param val_size size of @a val in bytes |
230 | */ | 226 | */ |
231 | struct GNUNET_GETOPT_CommandLineOption | 227 | struct GNUNET_GETOPT_CommandLineOption |
232 | GNUNET_GETOPT_option_base32_fixed_size (char shortName, | 228 | GNUNET_GETOPT_option_base32_fixed_size(char shortName, |
233 | const char *name, | 229 | const char *name, |
234 | const char *argumentHelp, | 230 | const char *argumentHelp, |
235 | const char *description, | 231 | const char *description, |
236 | void *val, | 232 | void *val, |
237 | size_t val_size); | 233 | size_t val_size); |
238 | 234 | ||
239 | 235 | ||
240 | /** | 236 | /** |
@@ -254,12 +250,12 @@ GNUNET_GETOPT_option_base32_fixed_size (char shortName, | |||
254 | argumentHelp, \ | 250 | argumentHelp, \ |
255 | description, \ | 251 | description, \ |
256 | val) \ | 252 | val) \ |
257 | GNUNET_GETOPT_option_base32_fixed_size (shortName, \ | 253 | GNUNET_GETOPT_option_base32_fixed_size(shortName, \ |
258 | name, \ | 254 | name, \ |
259 | argumentHelp, \ | 255 | argumentHelp, \ |
260 | description, \ | 256 | description, \ |
261 | val, \ | 257 | val, \ |
262 | sizeof (*val)) | 258 | sizeof(*val)) |
263 | 259 | ||
264 | 260 | ||
265 | /** | 261 | /** |
@@ -272,10 +268,10 @@ GNUNET_GETOPT_option_base32_fixed_size (char shortName, | |||
272 | * @param[out] val set to 1 if the option is present | 268 | * @param[out] val set to 1 if the option is present |
273 | */ | 269 | */ |
274 | struct GNUNET_GETOPT_CommandLineOption | 270 | struct GNUNET_GETOPT_CommandLineOption |
275 | GNUNET_GETOPT_option_flag (char shortName, | 271 | GNUNET_GETOPT_option_flag(char shortName, |
276 | const char *name, | 272 | const char *name, |
277 | const char *description, | 273 | const char *description, |
278 | int *val); | 274 | int *val); |
279 | 275 | ||
280 | 276 | ||
281 | /** | 277 | /** |
@@ -288,11 +284,11 @@ GNUNET_GETOPT_option_flag (char shortName, | |||
288 | * @param[out] val set to the value specified at the command line | 284 | * @param[out] val set to the value specified at the command line |
289 | */ | 285 | */ |
290 | struct GNUNET_GETOPT_CommandLineOption | 286 | struct GNUNET_GETOPT_CommandLineOption |
291 | GNUNET_GETOPT_option_uint (char shortName, | 287 | GNUNET_GETOPT_option_uint(char shortName, |
292 | const char *name, | 288 | const char *name, |
293 | const char *argumentHelp, | 289 | const char *argumentHelp, |
294 | const char *description, | 290 | const char *description, |
295 | unsigned int *val); | 291 | unsigned int *val); |
296 | 292 | ||
297 | 293 | ||
298 | /** | 294 | /** |
@@ -305,11 +301,11 @@ GNUNET_GETOPT_option_uint (char shortName, | |||
305 | * @param[out] val set to the value specified at the command line | 301 | * @param[out] val set to the value specified at the command line |
306 | */ | 302 | */ |
307 | struct GNUNET_GETOPT_CommandLineOption | 303 | struct GNUNET_GETOPT_CommandLineOption |
308 | GNUNET_GETOPT_option_uint16 (char shortName, | 304 | GNUNET_GETOPT_option_uint16(char shortName, |
309 | const char *name, | 305 | const char *name, |
310 | const char *argumentHelp, | 306 | const char *argumentHelp, |
311 | const char *description, | 307 | const char *description, |
312 | uint16_t *val); | 308 | uint16_t *val); |
313 | 309 | ||
314 | 310 | ||
315 | /** | 311 | /** |
@@ -322,11 +318,11 @@ GNUNET_GETOPT_option_uint16 (char shortName, | |||
322 | * @param[out] val set to the value specified at the command line | 318 | * @param[out] val set to the value specified at the command line |
323 | */ | 319 | */ |
324 | struct GNUNET_GETOPT_CommandLineOption | 320 | struct GNUNET_GETOPT_CommandLineOption |
325 | GNUNET_GETOPT_option_ulong (char shortName, | 321 | GNUNET_GETOPT_option_ulong(char shortName, |
326 | const char *name, | 322 | const char *name, |
327 | const char *argumentHelp, | 323 | const char *argumentHelp, |
328 | const char *description, | 324 | const char *description, |
329 | unsigned long long *val); | 325 | unsigned long long *val); |
330 | 326 | ||
331 | 327 | ||
332 | /** | 328 | /** |
@@ -340,11 +336,11 @@ GNUNET_GETOPT_option_ulong (char shortName, | |||
340 | * @param[out] val set to the time specified at the command line | 336 | * @param[out] val set to the time specified at the command line |
341 | */ | 337 | */ |
342 | struct GNUNET_GETOPT_CommandLineOption | 338 | struct GNUNET_GETOPT_CommandLineOption |
343 | GNUNET_GETOPT_option_relative_time (char shortName, | 339 | GNUNET_GETOPT_option_relative_time(char shortName, |
344 | const char *name, | 340 | const char *name, |
345 | const char *argumentHelp, | 341 | const char *argumentHelp, |
346 | const char *description, | 342 | const char *description, |
347 | struct GNUNET_TIME_Relative *val); | 343 | struct GNUNET_TIME_Relative *val); |
348 | 344 | ||
349 | 345 | ||
350 | /** | 346 | /** |
@@ -358,11 +354,11 @@ GNUNET_GETOPT_option_relative_time (char shortName, | |||
358 | * @param[out] val set to the time specified at the command line | 354 | * @param[out] val set to the time specified at the command line |
359 | */ | 355 | */ |
360 | struct GNUNET_GETOPT_CommandLineOption | 356 | struct GNUNET_GETOPT_CommandLineOption |
361 | GNUNET_GETOPT_option_absolute_time (char shortName, | 357 | GNUNET_GETOPT_option_absolute_time(char shortName, |
362 | const char *name, | 358 | const char *name, |
363 | const char *argumentHelp, | 359 | const char *argumentHelp, |
364 | const char *description, | 360 | const char *description, |
365 | struct GNUNET_TIME_Absolute *val); | 361 | struct GNUNET_TIME_Absolute *val); |
366 | 362 | ||
367 | 363 | ||
368 | /** | 364 | /** |
@@ -375,10 +371,10 @@ GNUNET_GETOPT_option_absolute_time (char shortName, | |||
375 | * @param[out] val set to 1 if the option is present | 371 | * @param[out] val set to 1 if the option is present |
376 | */ | 372 | */ |
377 | struct GNUNET_GETOPT_CommandLineOption | 373 | struct GNUNET_GETOPT_CommandLineOption |
378 | GNUNET_GETOPT_option_increment_uint (char shortName, | 374 | GNUNET_GETOPT_option_increment_uint(char shortName, |
379 | const char *name, | 375 | const char *name, |
380 | const char *description, | 376 | const char *description, |
381 | unsigned int *val); | 377 | unsigned int *val); |
382 | 378 | ||
383 | 379 | ||
384 | /** | 380 | /** |
@@ -388,7 +384,7 @@ GNUNET_GETOPT_option_increment_uint (char shortName, | |||
388 | * @param[out] level set to the log level | 384 | * @param[out] level set to the log level |
389 | */ | 385 | */ |
390 | struct GNUNET_GETOPT_CommandLineOption | 386 | struct GNUNET_GETOPT_CommandLineOption |
391 | GNUNET_GETOPT_option_loglevel (char **level); | 387 | GNUNET_GETOPT_option_loglevel(char **level); |
392 | 388 | ||
393 | 389 | ||
394 | /** | 390 | /** |
@@ -398,7 +394,7 @@ GNUNET_GETOPT_option_loglevel (char **level); | |||
398 | * @param[out] level set to the verbosity level | 394 | * @param[out] level set to the verbosity level |
399 | */ | 395 | */ |
400 | struct GNUNET_GETOPT_CommandLineOption | 396 | struct GNUNET_GETOPT_CommandLineOption |
401 | GNUNET_GETOPT_option_verbose (unsigned int *level); | 397 | GNUNET_GETOPT_option_verbose(unsigned int *level); |
402 | 398 | ||
403 | 399 | ||
404 | /** | 400 | /** |
@@ -407,7 +403,7 @@ GNUNET_GETOPT_option_verbose (unsigned int *level); | |||
407 | * @param[out] logfn set to the name of the logfile | 403 | * @param[out] logfn set to the name of the logfile |
408 | */ | 404 | */ |
409 | struct GNUNET_GETOPT_CommandLineOption | 405 | struct GNUNET_GETOPT_CommandLineOption |
410 | GNUNET_GETOPT_option_logfile (char **logfn); | 406 | GNUNET_GETOPT_option_logfile(char **logfn); |
411 | 407 | ||
412 | 408 | ||
413 | /** | 409 | /** |
@@ -416,7 +412,7 @@ GNUNET_GETOPT_option_logfile (char **logfn); | |||
416 | * @param[out] fn set to the name of the configuration file | 412 | * @param[out] fn set to the name of the configuration file |
417 | */ | 413 | */ |
418 | struct GNUNET_GETOPT_CommandLineOption | 414 | struct GNUNET_GETOPT_CommandLineOption |
419 | GNUNET_GETOPT_option_cfgfile (char **fn); | 415 | GNUNET_GETOPT_option_cfgfile(char **fn); |
420 | 416 | ||
421 | 417 | ||
422 | /** | 418 | /** |
@@ -426,7 +422,7 @@ GNUNET_GETOPT_option_cfgfile (char **fn); | |||
426 | * @return @a opt with the mandatory flag set. | 422 | * @return @a opt with the mandatory flag set. |
427 | */ | 423 | */ |
428 | struct GNUNET_GETOPT_CommandLineOption | 424 | struct GNUNET_GETOPT_CommandLineOption |
429 | GNUNET_GETOPT_option_mandatory (struct GNUNET_GETOPT_CommandLineOption opt); | 425 | GNUNET_GETOPT_option_mandatory(struct GNUNET_GETOPT_CommandLineOption opt); |
430 | 426 | ||
431 | 427 | ||
432 | /** | 428 | /** |
@@ -436,7 +432,7 @@ GNUNET_GETOPT_option_mandatory (struct GNUNET_GETOPT_CommandLineOption opt); | |||
436 | * @return @a opt with the exclusive flag set. | 432 | * @return @a opt with the exclusive flag set. |
437 | */ | 433 | */ |
438 | struct GNUNET_GETOPT_CommandLineOption | 434 | struct GNUNET_GETOPT_CommandLineOption |
439 | GNUNET_GETOPT_option_exclusive (struct GNUNET_GETOPT_CommandLineOption opt); | 435 | GNUNET_GETOPT_option_exclusive(struct GNUNET_GETOPT_CommandLineOption opt); |
440 | 436 | ||
441 | 437 | ||
442 | /** | 438 | /** |
@@ -459,10 +455,10 @@ GNUNET_GETOPT_option_exclusive (struct GNUNET_GETOPT_CommandLineOption opt); | |||
459 | * argument, or #GNUNET_SYSERR on error | 455 | * argument, or #GNUNET_SYSERR on error |
460 | */ | 456 | */ |
461 | int | 457 | int |
462 | GNUNET_GETOPT_run (const char *binaryOptions, | 458 | GNUNET_GETOPT_run(const char *binaryOptions, |
463 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, | 459 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, |
464 | unsigned int argc, | 460 | unsigned int argc, |
465 | char *const *argv); | 461 | char *const *argv); |
466 | 462 | ||
467 | 463 | ||
468 | #if 0 /* keep Emacsens' auto-indent happy */ | 464 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index ca92e8221..f66bec61e 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -76,7 +76,7 @@ struct GNUNET_GNS_LookupWithTldRequest; | |||
76 | * @return handle to the GNS service, or NULL on error | 76 | * @return handle to the GNS service, or NULL on error |
77 | */ | 77 | */ |
78 | struct GNUNET_GNS_Handle * | 78 | struct GNUNET_GNS_Handle * |
79 | GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 79 | GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
80 | 80 | ||
81 | 81 | ||
82 | /** | 82 | /** |
@@ -85,7 +85,7 @@ GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
85 | * @param handle connection to shut down | 85 | * @param handle connection to shut down |
86 | */ | 86 | */ |
87 | void | 87 | void |
88 | GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle); | 88 | GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
@@ -104,8 +104,7 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) ( | |||
104 | /** | 104 | /** |
105 | * Options for the GNS lookup. | 105 | * Options for the GNS lookup. |
106 | */ | 106 | */ |
107 | enum GNUNET_GNS_LocalOptions | 107 | enum GNUNET_GNS_LocalOptions { |
108 | { | ||
109 | /** | 108 | /** |
110 | * Defaults, look in cache, then in DHT. | 109 | * Defaults, look in cache, then in DHT. |
111 | */ | 110 | */ |
@@ -121,7 +120,6 @@ enum GNUNET_GNS_LocalOptions | |||
121 | * is our local namestore), for the others, the DHT is OK. | 120 | * is our local namestore), for the others, the DHT is OK. |
122 | */ | 121 | */ |
123 | GNUNET_GNS_LO_LOCAL_MASTER = 2 | 122 | GNUNET_GNS_LO_LOCAL_MASTER = 2 |
124 | |||
125 | }; | 123 | }; |
126 | 124 | ||
127 | 125 | ||
@@ -138,13 +136,13 @@ enum GNUNET_GNS_LocalOptions | |||
138 | * @return handle to the queued request | 136 | * @return handle to the queued request |
139 | */ | 137 | */ |
140 | struct GNUNET_GNS_LookupRequest * | 138 | struct GNUNET_GNS_LookupRequest * |
141 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 139 | GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, |
142 | const char *name, | 140 | const char *name, |
143 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, | 141 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, |
144 | uint32_t type, | 142 | uint32_t type, |
145 | enum GNUNET_GNS_LocalOptions options, | 143 | enum GNUNET_GNS_LocalOptions options, |
146 | GNUNET_GNS_LookupResultProcessor proc, | 144 | GNUNET_GNS_LookupResultProcessor proc, |
147 | void *proc_cls); | 145 | void *proc_cls); |
148 | 146 | ||
149 | 147 | ||
150 | /** | 148 | /** |
@@ -154,7 +152,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | |||
154 | * @return closure from the lookup result processor | 152 | * @return closure from the lookup result processor |
155 | */ | 153 | */ |
156 | void * | 154 | void * |
157 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr); | 155 | GNUNET_GNS_lookup_cancel(struct GNUNET_GNS_LookupRequest *lr); |
158 | 156 | ||
159 | 157 | ||
160 | /** | 158 | /** |
@@ -188,12 +186,12 @@ typedef void (*GNUNET_GNS_LookupResultProcessor2) ( | |||
188 | * @return handle to the get request | 186 | * @return handle to the get request |
189 | */ | 187 | */ |
190 | struct GNUNET_GNS_LookupWithTldRequest * | 188 | struct GNUNET_GNS_LookupWithTldRequest * |
191 | GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, | 189 | GNUNET_GNS_lookup_with_tld(struct GNUNET_GNS_Handle *handle, |
192 | const char *name, | 190 | const char *name, |
193 | uint32_t type, | 191 | uint32_t type, |
194 | enum GNUNET_GNS_LocalOptions options, | 192 | enum GNUNET_GNS_LocalOptions options, |
195 | GNUNET_GNS_LookupResultProcessor2 proc, | 193 | GNUNET_GNS_LookupResultProcessor2 proc, |
196 | void *proc_cls); | 194 | void *proc_cls); |
197 | 195 | ||
198 | 196 | ||
199 | /** | 197 | /** |
@@ -203,7 +201,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, | |||
203 | * @return closure from the lookup result processor | 201 | * @return closure from the lookup result processor |
204 | */ | 202 | */ |
205 | void * | 203 | void * |
206 | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr); | 204 | GNUNET_GNS_lookup_with_tld_cancel(struct GNUNET_GNS_LookupWithTldRequest *ltr); |
207 | 205 | ||
208 | 206 | ||
209 | #if 0 /* keep Emacsens' auto-indent happy */ | 207 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index a92cdc2e7..5effa855f 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -145,7 +145,6 @@ extern "C" { | |||
145 | * Flags that can be set for a record. | 145 | * Flags that can be set for a record. |
146 | */ | 146 | */ |
147 | enum GNUNET_GNSRECORD_Flags { | 147 | enum GNUNET_GNSRECORD_Flags { |
148 | |||
149 | /** | 148 | /** |
150 | * No special options. | 149 | * No special options. |
151 | */ | 150 | */ |
@@ -194,7 +193,6 @@ enum GNUNET_GNSRECORD_Flags { | |||
194 | * A GNS record. | 193 | * A GNS record. |
195 | */ | 194 | */ |
196 | struct GNUNET_GNSRECORD_Data { | 195 | struct GNUNET_GNSRECORD_Data { |
197 | |||
198 | /** | 196 | /** |
199 | * Binary value stored in the DNS record. Note: "data" must never | 197 | * Binary value stored in the DNS record. Note: "data" must never |
200 | * be individually 'malloc'ed, but instead always points into some | 198 | * be individually 'malloc'ed, but instead always points into some |
@@ -255,7 +253,6 @@ struct GNUNET_GNSRECORD_PlaceData { | |||
255 | * Information we have in an encrypted block with record data (i.e. in the DHT). | 253 | * Information we have in an encrypted block with record data (i.e. in the DHT). |
256 | */ | 254 | */ |
257 | struct GNUNET_GNSRECORD_Block { | 255 | struct GNUNET_GNSRECORD_Block { |
258 | |||
259 | /** | 256 | /** |
260 | * Signature of the block. | 257 | * Signature of the block. |
261 | */ | 258 | */ |
@@ -292,7 +289,6 @@ struct GNUNET_GNSRECORD_Block { | |||
292 | * records inseparable from the "main" A/AAAA/VPN/etc. records. | 289 | * records inseparable from the "main" A/AAAA/VPN/etc. records. |
293 | */ | 290 | */ |
294 | struct GNUNET_GNSRECORD_BoxRecord { | 291 | struct GNUNET_GNSRECORD_BoxRecord { |
295 | |||
296 | /** | 292 | /** |
297 | * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.). | 293 | * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.). |
298 | * Yes, in IP protocols are usually limited to 8 bits. In NBO. | 294 | * Yes, in IP protocols are usually limited to 8 bits. In NBO. |
@@ -344,7 +340,7 @@ GNUNET_NETWORK_STRUCT_END | |||
344 | * @param rd array of records with data to store | 340 | * @param rd array of records with data to store |
345 | */ | 341 | */ |
346 | typedef void (*GNUNET_GNSRECORD_RecordCallback) ( | 342 | typedef void (*GNUNET_GNSRECORD_RecordCallback) ( |
347 | void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); | 343 | void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); |
348 | 344 | ||
349 | 345 | ||
350 | /* ***************** API related to GNSRECORD plugins ************** */ | 346 | /* ***************** API related to GNSRECORD plugins ************** */ |
@@ -359,8 +355,8 @@ typedef void (*GNUNET_GNSRECORD_RecordCallback) ( | |||
359 | * @return NULL on error, otherwise human-readable representation of the value | 355 | * @return NULL on error, otherwise human-readable representation of the value |
360 | */ | 356 | */ |
361 | char * | 357 | char * |
362 | GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data, | 358 | GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data, |
363 | size_t data_size); | 359 | size_t data_size); |
364 | 360 | ||
365 | 361 | ||
366 | /** | 362 | /** |
@@ -374,8 +370,8 @@ GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data, | |||
374 | * @return #GNUNET_OK on success | 370 | * @return #GNUNET_OK on success |
375 | */ | 371 | */ |
376 | int | 372 | int |
377 | GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data, | 373 | GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, |
378 | size_t *data_size); | 374 | size_t *data_size); |
379 | 375 | ||
380 | 376 | ||
381 | /** | 377 | /** |
@@ -385,7 +381,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data, | |||
385 | * @return corresponding number, UINT32_MAX on error | 381 | * @return corresponding number, UINT32_MAX on error |
386 | */ | 382 | */ |
387 | uint32_t | 383 | uint32_t |
388 | GNUNET_GNSRECORD_typename_to_number (const char *dns_typename); | 384 | GNUNET_GNSRECORD_typename_to_number(const char *dns_typename); |
389 | 385 | ||
390 | 386 | ||
391 | /** | 387 | /** |
@@ -395,7 +391,7 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename); | |||
395 | * @return corresponding typestring, NULL on error | 391 | * @return corresponding typestring, NULL on error |
396 | */ | 392 | */ |
397 | const char * | 393 | const char * |
398 | GNUNET_GNSRECORD_number_to_typename (uint32_t type); | 394 | GNUNET_GNSRECORD_number_to_typename(uint32_t type); |
399 | 395 | ||
400 | 396 | ||
401 | /* convenience APIs for serializing / deserializing GNS records */ | 397 | /* convenience APIs for serializing / deserializing GNS records */ |
@@ -409,8 +405,8 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type); | |||
409 | * @return the required size to serialize, -1 on error | 405 | * @return the required size to serialize, -1 on error |
410 | */ | 406 | */ |
411 | ssize_t | 407 | ssize_t |
412 | GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | 408 | GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, |
413 | const struct GNUNET_GNSRECORD_Data *rd); | 409 | const struct GNUNET_GNSRECORD_Data *rd); |
414 | 410 | ||
415 | 411 | ||
416 | /** | 412 | /** |
@@ -423,9 +419,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | |||
423 | * @return the size of serialized records, -1 if records do not fit | 419 | * @return the size of serialized records, -1 if records do not fit |
424 | */ | 420 | */ |
425 | ssize_t | 421 | ssize_t |
426 | GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | 422 | GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, |
427 | const struct GNUNET_GNSRECORD_Data *rd, | 423 | const struct GNUNET_GNSRECORD_Data *rd, |
428 | size_t dest_size, char *dest); | 424 | size_t dest_size, char *dest); |
429 | 425 | ||
430 | 426 | ||
431 | /** | 427 | /** |
@@ -438,9 +434,9 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | |||
438 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 434 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
439 | */ | 435 | */ |
440 | int | 436 | int |
441 | GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src, | 437 | GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, |
442 | unsigned int rd_count, | 438 | unsigned int rd_count, |
443 | struct GNUNET_GNSRECORD_Data *dest); | 439 | struct GNUNET_GNSRECORD_Data *dest); |
444 | 440 | ||
445 | 441 | ||
446 | /* ******* general APIs relating to blocks, records and labels ******** */ | 442 | /* ******* general APIs relating to blocks, records and labels ******** */ |
@@ -454,7 +450,7 @@ GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src, | |||
454 | * #GNUNET_NO if not | 450 | * #GNUNET_NO if not |
455 | */ | 451 | */ |
456 | int | 452 | int |
457 | GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd); | 453 | GNUNET_GNSRECORD_is_expired(const struct GNUNET_GNSRECORD_Data *rd); |
458 | 454 | ||
459 | 455 | ||
460 | /** | 456 | /** |
@@ -463,7 +459,7 @@ GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd); | |||
463 | * @return converted result | 459 | * @return converted result |
464 | */ | 460 | */ |
465 | char * | 461 | char * |
466 | GNUNET_GNSRECORD_string_to_lowercase (const char *src); | 462 | GNUNET_GNSRECORD_string_to_lowercase(const char *src); |
467 | 463 | ||
468 | 464 | ||
469 | /** | 465 | /** |
@@ -476,7 +472,7 @@ GNUNET_GNSRECORD_string_to_lowercase (const char *src); | |||
476 | * #GNUNET_GNSRECORD_z2s. | 472 | * #GNUNET_GNSRECORD_z2s. |
477 | */ | 473 | */ |
478 | const char * | 474 | const char * |
479 | GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | 475 | GNUNET_GNSRECORD_z2s(const struct GNUNET_CRYPTO_EcdsaPublicKey *z); |
480 | 476 | ||
481 | 477 | ||
482 | /** | 478 | /** |
@@ -490,7 +486,7 @@ GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | |||
490 | * key in an encoding suitable for DNS labels. | 486 | * key in an encoding suitable for DNS labels. |
491 | */ | 487 | */ |
492 | const char * | 488 | const char * |
493 | GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 489 | GNUNET_GNSRECORD_pkey_to_zkey(const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); |
494 | 490 | ||
495 | 491 | ||
496 | /** | 492 | /** |
@@ -503,8 +499,8 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | |||
503 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax | 499 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax |
504 | */ | 500 | */ |
505 | int | 501 | int |
506 | GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | 502 | GNUNET_GNSRECORD_zkey_to_pkey(const char *zkey, |
507 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 503 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); |
508 | 504 | ||
509 | 505 | ||
510 | /** | 506 | /** |
@@ -515,9 +511,9 @@ GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | |||
515 | * @param query hash to use for the query | 511 | * @param query hash to use for the query |
516 | */ | 512 | */ |
517 | void | 513 | void |
518 | GNUNET_GNSRECORD_query_from_private_key ( | 514 | GNUNET_GNSRECORD_query_from_private_key( |
519 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, | 515 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, |
520 | struct GNUNET_HashCode *query); | 516 | struct GNUNET_HashCode *query); |
521 | 517 | ||
522 | 518 | ||
523 | /** | 519 | /** |
@@ -528,9 +524,9 @@ GNUNET_GNSRECORD_query_from_private_key ( | |||
528 | * @param query hash to use for the query | 524 | * @param query hash to use for the query |
529 | */ | 525 | */ |
530 | void | 526 | void |
531 | GNUNET_GNSRECORD_query_from_public_key ( | 527 | GNUNET_GNSRECORD_query_from_public_key( |
532 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, | 528 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, |
533 | struct GNUNET_HashCode *query); | 529 | struct GNUNET_HashCode *query); |
534 | 530 | ||
535 | 531 | ||
536 | /** | 532 | /** |
@@ -543,11 +539,11 @@ GNUNET_GNSRECORD_query_from_public_key ( | |||
543 | * @param rd_count number of records in @a rd | 539 | * @param rd_count number of records in @a rd |
544 | */ | 540 | */ |
545 | struct GNUNET_GNSRECORD_Block * | 541 | struct GNUNET_GNSRECORD_Block * |
546 | GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 542 | GNUNET_GNSRECORD_block_create(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
547 | struct GNUNET_TIME_Absolute expire, | 543 | struct GNUNET_TIME_Absolute expire, |
548 | const char *label, | 544 | const char *label, |
549 | const struct GNUNET_GNSRECORD_Data *rd, | 545 | const struct GNUNET_GNSRECORD_Data *rd, |
550 | unsigned int rd_count); | 546 | unsigned int rd_count); |
551 | 547 | ||
552 | 548 | ||
553 | /** | 549 | /** |
@@ -562,11 +558,11 @@ GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
562 | * @param rd_count number of records in @a rd | 558 | * @param rd_count number of records in @a rd |
563 | */ | 559 | */ |
564 | struct GNUNET_GNSRECORD_Block * | 560 | struct GNUNET_GNSRECORD_Block * |
565 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 561 | GNUNET_GNSRECORD_block_create2(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
566 | struct GNUNET_TIME_Absolute expire, | 562 | struct GNUNET_TIME_Absolute expire, |
567 | const char *label, | 563 | const char *label, |
568 | const struct GNUNET_GNSRECORD_Data *rd, | 564 | const struct GNUNET_GNSRECORD_Data *rd, |
569 | unsigned int rd_count); | 565 | unsigned int rd_count); |
570 | 566 | ||
571 | 567 | ||
572 | /** | 568 | /** |
@@ -577,7 +573,7 @@ GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
577 | * @return #GNUNET_OK if the signature is valid | 573 | * @return #GNUNET_OK if the signature is valid |
578 | */ | 574 | */ |
579 | int | 575 | int |
580 | GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); | 576 | GNUNET_GNSRECORD_block_verify(const struct GNUNET_GNSRECORD_Block *block); |
581 | 577 | ||
582 | 578 | ||
583 | /** | 579 | /** |
@@ -592,10 +588,10 @@ GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); | |||
592 | * not well-formed | 588 | * not well-formed |
593 | */ | 589 | */ |
594 | int | 590 | int |
595 | GNUNET_GNSRECORD_block_decrypt ( | 591 | GNUNET_GNSRECORD_block_decrypt( |
596 | const struct GNUNET_GNSRECORD_Block *block, | 592 | const struct GNUNET_GNSRECORD_Block *block, |
597 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, | 593 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, |
598 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); | 594 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); |
599 | 595 | ||
600 | 596 | ||
601 | /** | 597 | /** |
@@ -606,8 +602,8 @@ GNUNET_GNSRECORD_block_decrypt ( | |||
606 | * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. | 602 | * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. |
607 | */ | 603 | */ |
608 | int | 604 | int |
609 | GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, | 605 | GNUNET_GNSRECORD_records_cmp(const struct GNUNET_GNSRECORD_Data *a, |
610 | const struct GNUNET_GNSRECORD_Data *b); | 606 | const struct GNUNET_GNSRECORD_Data *b); |
611 | 607 | ||
612 | 608 | ||
613 | /** | 609 | /** |
@@ -620,8 +616,8 @@ GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, | |||
620 | * @return absolute expiration time | 616 | * @return absolute expiration time |
621 | */ | 617 | */ |
622 | struct GNUNET_TIME_Absolute | 618 | struct GNUNET_TIME_Absolute |
623 | GNUNET_GNSRECORD_record_get_expiration_time ( | 619 | GNUNET_GNSRECORD_record_get_expiration_time( |
624 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); | 620 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); |
625 | 621 | ||
626 | 622 | ||
627 | #if 0 /* keep Emacsens' auto-indent happy */ | 623 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_gnsrecord_plugin.h b/src/include/gnunet_gnsrecord_plugin.h index cc10e3e7f..7ce1b22e6 100644 --- a/src/include/gnunet_gnsrecord_plugin.h +++ b/src/include/gnunet_gnsrecord_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -55,9 +55,9 @@ extern "C" | |||
55 | */ | 55 | */ |
56 | typedef char * | 56 | typedef char * |
57 | (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, | 57 | (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, |
58 | uint32_t type, | 58 | uint32_t type, |
59 | const void *data, | 59 | const void *data, |
60 | size_t data_size); | 60 | size_t data_size); |
61 | 61 | ||
62 | 62 | ||
63 | /** | 63 | /** |
@@ -74,10 +74,10 @@ typedef char * | |||
74 | */ | 74 | */ |
75 | typedef int | 75 | typedef int |
76 | (*GNUNET_GNSRECORD_StringToValueFunction) (void *cls, | 76 | (*GNUNET_GNSRECORD_StringToValueFunction) (void *cls, |
77 | uint32_t type, | 77 | uint32_t type, |
78 | const char *s, | 78 | const char *s, |
79 | void **data, | 79 | void **data, |
80 | size_t *data_size); | 80 | size_t *data_size); |
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
@@ -90,7 +90,7 @@ typedef int | |||
90 | */ | 90 | */ |
91 | typedef uint32_t | 91 | typedef uint32_t |
92 | (*GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, | 92 | (*GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, |
93 | const char *dns_typename); | 93 | const char *dns_typename); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -103,16 +103,14 @@ typedef uint32_t | |||
103 | */ | 103 | */ |
104 | typedef const char * | 104 | typedef const char * |
105 | (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, | 105 | (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, |
106 | uint32_t type); | 106 | uint32_t type); |
107 | 107 | ||
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Each plugin is required to return a pointer to a struct of this | 110 | * Each plugin is required to return a pointer to a struct of this |
111 | * type as the return value from its entry point. | 111 | * type as the return value from its entry point. |
112 | */ | 112 | */ |
113 | struct GNUNET_GNSRECORD_PluginFunctions | 113 | struct GNUNET_GNSRECORD_PluginFunctions { |
114 | { | ||
115 | |||
116 | /** | 114 | /** |
117 | * Closure for all of the callbacks. | 115 | * Closure for all of the callbacks. |
118 | */ | 116 | */ |
@@ -137,7 +135,6 @@ struct GNUNET_GNSRECORD_PluginFunctions | |||
137 | * Number to typename. | 135 | * Number to typename. |
138 | */ | 136 | */ |
139 | GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename; | 137 | GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename; |
140 | |||
141 | }; | 138 | }; |
142 | 139 | ||
143 | /** @} */ /* end of group */ | 140 | /** @} */ /* end of group */ |
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 3b494f0a2..9fe158852 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -65,8 +65,7 @@ extern "C" { | |||
65 | * These information are only valid for the local peer and are not serialized | 65 | * These information are only valid for the local peer and are not serialized |
66 | * when a #GNUNET_HELLO_Message is created | 66 | * when a #GNUNET_HELLO_Message is created |
67 | */ | 67 | */ |
68 | enum GNUNET_HELLO_AddressInfo | 68 | enum GNUNET_HELLO_AddressInfo { |
69 | { | ||
70 | /** | 69 | /** |
71 | * No additional information | 70 | * No additional information |
72 | */ | 71 | */ |
@@ -86,9 +85,7 @@ enum GNUNET_HELLO_AddressInfo | |||
86 | * separated. This is NOT the format that would be used | 85 | * separated. This is NOT the format that would be used |
87 | * on the wire. | 86 | * on the wire. |
88 | */ | 87 | */ |
89 | struct GNUNET_HELLO_Address | 88 | struct GNUNET_HELLO_Address { |
90 | { | ||
91 | |||
92 | /** | 89 | /** |
93 | * For which peer is this an address? | 90 | * For which peer is this an address? |
94 | */ | 91 | */ |
@@ -135,11 +132,11 @@ struct GNUNET_HELLO_Address | |||
135 | * @return the address struct | 132 | * @return the address struct |
136 | */ | 133 | */ |
137 | struct GNUNET_HELLO_Address * | 134 | struct GNUNET_HELLO_Address * |
138 | GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer, | 135 | GNUNET_HELLO_address_allocate(const struct GNUNET_PeerIdentity *peer, |
139 | const char *transport_name, | 136 | const char *transport_name, |
140 | const void *address, | 137 | const void *address, |
141 | size_t address_length, | 138 | size_t address_length, |
142 | enum GNUNET_HELLO_AddressInfo local_info); | 139 | enum GNUNET_HELLO_AddressInfo local_info); |
143 | 140 | ||
144 | 141 | ||
145 | /** | 142 | /** |
@@ -149,7 +146,7 @@ GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer, | |||
149 | * @return a copy of the address struct | 146 | * @return a copy of the address struct |
150 | */ | 147 | */ |
151 | struct GNUNET_HELLO_Address * | 148 | struct GNUNET_HELLO_Address * |
152 | GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address); | 149 | GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address); |
153 | 150 | ||
154 | 151 | ||
155 | /** | 152 | /** |
@@ -161,8 +158,8 @@ GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address); | |||
161 | * @return 0 if the addresses are equal, -1 if @a a1< @a a2, 1 if @a a1> @a a2. | 158 | * @return 0 if the addresses are equal, -1 if @a a1< @a a2, 1 if @a a1> @a a2. |
162 | */ | 159 | */ |
163 | int | 160 | int |
164 | GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1, | 161 | GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1, |
165 | const struct GNUNET_HELLO_Address *a2); | 162 | const struct GNUNET_HELLO_Address *a2); |
166 | 163 | ||
167 | 164 | ||
168 | /** | 165 | /** |
@@ -172,7 +169,7 @@ GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1, | |||
172 | * @return the size | 169 | * @return the size |
173 | */ | 170 | */ |
174 | size_t | 171 | size_t |
175 | GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address); | 172 | GNUNET_HELLO_address_get_size(const struct GNUNET_HELLO_Address *address); |
176 | 173 | ||
177 | 174 | ||
178 | /** | 175 | /** |
@@ -183,8 +180,8 @@ GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address); | |||
183 | * @return #GNUNET_YES or #GNUNET_NO | 180 | * @return #GNUNET_YES or #GNUNET_NO |
184 | */ | 181 | */ |
185 | int | 182 | int |
186 | GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address *address, | 183 | GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address, |
187 | enum GNUNET_HELLO_AddressInfo option); | 184 | enum GNUNET_HELLO_AddressInfo option); |
188 | 185 | ||
189 | 186 | ||
190 | /** | 187 | /** |
@@ -192,7 +189,7 @@ GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address *address, | |||
192 | * | 189 | * |
193 | * @param addr address to free | 190 | * @param addr address to free |
194 | */ | 191 | */ |
195 | #define GNUNET_HELLO_address_free(addr) GNUNET_free (addr) | 192 | #define GNUNET_HELLO_address_free(addr) GNUNET_free(addr) |
196 | 193 | ||
197 | 194 | ||
198 | GNUNET_NETWORK_STRUCT_BEGIN | 195 | GNUNET_NETWORK_STRUCT_BEGIN |
@@ -210,8 +207,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
210 | * unaligned!) | 207 | * unaligned!) |
211 | * 4) address (address-length bytes; possibly unaligned!) | 208 | * 4) address (address-length bytes; possibly unaligned!) |
212 | */ | 209 | */ |
213 | struct GNUNET_HELLO_Message | 210 | struct GNUNET_HELLO_Message { |
214 | { | ||
215 | /** | 211 | /** |
216 | * Type will be #GNUNET_MESSAGE_TYPE_HELLO. | 212 | * Type will be #GNUNET_MESSAGE_TYPE_HELLO. |
217 | */ | 213 | */ |
@@ -237,7 +233,7 @@ GNUNET_NETWORK_STRUCT_END | |||
237 | * @return #GNUNET_YES for friend-only or #GNUNET_NO otherwise | 233 | * @return #GNUNET_YES for friend-only or #GNUNET_NO otherwise |
238 | */ | 234 | */ |
239 | int | 235 | int |
240 | GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h); | 236 | GNUNET_HELLO_is_friend_only(const struct GNUNET_HELLO_Message *h); |
241 | 237 | ||
242 | 238 | ||
243 | /** | 239 | /** |
@@ -252,10 +248,10 @@ GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h); | |||
252 | * the target buffer was not big enough. | 248 | * the target buffer was not big enough. |
253 | */ | 249 | */ |
254 | size_t | 250 | size_t |
255 | GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address, | 251 | GNUNET_HELLO_add_address(const struct GNUNET_HELLO_Address *address, |
256 | struct GNUNET_TIME_Absolute expiration, | 252 | struct GNUNET_TIME_Absolute expiration, |
257 | char *target, | 253 | char *target, |
258 | size_t max); | 254 | size_t max); |
259 | 255 | ||
260 | 256 | ||
261 | /** | 257 | /** |
@@ -289,10 +285,10 @@ typedef ssize_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | |||
289 | * @return the hello message | 285 | * @return the hello message |
290 | */ | 286 | */ |
291 | struct GNUNET_HELLO_Message * | 287 | struct GNUNET_HELLO_Message * |
292 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, | 288 | GNUNET_HELLO_create(const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, |
293 | GNUNET_HELLO_GenerateAddressListCallback addrgen, | 289 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
294 | void *addrgen_cls, | 290 | void *addrgen_cls, |
295 | int friend_only); | 291 | int friend_only); |
296 | 292 | ||
297 | 293 | ||
298 | /** | 294 | /** |
@@ -302,7 +298,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, | |||
302 | * @return the size, 0 if HELLO is invalid | 298 | * @return the size, 0 if HELLO is invalid |
303 | */ | 299 | */ |
304 | uint16_t | 300 | uint16_t |
305 | GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | 301 | GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello); |
306 | 302 | ||
307 | 303 | ||
308 | /** | 304 | /** |
@@ -315,8 +311,8 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | |||
315 | * @return the combined hello message | 311 | * @return the combined hello message |
316 | */ | 312 | */ |
317 | struct GNUNET_HELLO_Message * | 313 | struct GNUNET_HELLO_Message * |
318 | GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, | 314 | GNUNET_HELLO_merge(const struct GNUNET_HELLO_Message *h1, |
319 | const struct GNUNET_HELLO_Message *h2); | 315 | const struct GNUNET_HELLO_Message *h2); |
320 | 316 | ||
321 | 317 | ||
322 | /** | 318 | /** |
@@ -336,9 +332,9 @@ GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, | |||
336 | * do not match at all | 332 | * do not match at all |
337 | */ | 333 | */ |
338 | struct GNUNET_TIME_Absolute | 334 | struct GNUNET_TIME_Absolute |
339 | GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | 335 | GNUNET_HELLO_equals(const struct GNUNET_HELLO_Message *h1, |
340 | const struct GNUNET_HELLO_Message *h2, | 336 | const struct GNUNET_HELLO_Message *h2, |
341 | struct GNUNET_TIME_Absolute now); | 337 | struct GNUNET_TIME_Absolute now); |
342 | 338 | ||
343 | 339 | ||
344 | /** | 340 | /** |
@@ -364,7 +360,7 @@ typedef int (*GNUNET_HELLO_AddressIterator) ( | |||
364 | * @return time the last address expires, 0 if there are no addresses in the HELLO | 360 | * @return time the last address expires, 0 if there are no addresses in the HELLO |
365 | */ | 361 | */ |
366 | struct GNUNET_TIME_Absolute | 362 | struct GNUNET_TIME_Absolute |
367 | GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg); | 363 | GNUNET_HELLO_get_last_expiration(const struct GNUNET_HELLO_Message *msg); |
368 | 364 | ||
369 | 365 | ||
370 | /** | 366 | /** |
@@ -380,10 +376,10 @@ GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg); | |||
380 | * @return the modified HELLO or NULL | 376 | * @return the modified HELLO or NULL |
381 | */ | 377 | */ |
382 | struct GNUNET_HELLO_Message * | 378 | struct GNUNET_HELLO_Message * |
383 | GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, | 379 | GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg, |
384 | int return_modified, | 380 | int return_modified, |
385 | GNUNET_HELLO_AddressIterator it, | 381 | GNUNET_HELLO_AddressIterator it, |
386 | void *it_cls); | 382 | void *it_cls); |
387 | 383 | ||
388 | 384 | ||
389 | /** | 385 | /** |
@@ -400,7 +396,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, | |||
400 | * @param it_cls closure for @a it | 396 | * @param it_cls closure for @a it |
401 | */ | 397 | */ |
402 | void | 398 | void |
403 | GNUNET_HELLO_iterate_new_addresses ( | 399 | GNUNET_HELLO_iterate_new_addresses( |
404 | const struct GNUNET_HELLO_Message *new_hello, | 400 | const struct GNUNET_HELLO_Message *new_hello, |
405 | const struct GNUNET_HELLO_Message *old_hello, | 401 | const struct GNUNET_HELLO_Message *old_hello, |
406 | struct GNUNET_TIME_Absolute expiration_limit, | 402 | struct GNUNET_TIME_Absolute expiration_limit, |
@@ -416,8 +412,8 @@ GNUNET_HELLO_iterate_new_addresses ( | |||
416 | * @return #GNUNET_SYSERR if the HELLO was malformed | 412 | * @return #GNUNET_SYSERR if the HELLO was malformed |
417 | */ | 413 | */ |
418 | int | 414 | int |
419 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 415 | GNUNET_HELLO_get_id(const struct GNUNET_HELLO_Message *hello, |
420 | struct GNUNET_PeerIdentity *peer); | 416 | struct GNUNET_PeerIdentity *peer); |
421 | 417 | ||
422 | 418 | ||
423 | /** | 419 | /** |
@@ -429,7 +425,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | |||
429 | * @return header or NULL if the HELLO was malformed | 425 | * @return header or NULL if the HELLO was malformed |
430 | */ | 426 | */ |
431 | struct GNUNET_MessageHeader * | 427 | struct GNUNET_MessageHeader * |
432 | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); | 428 | GNUNET_HELLO_get_header(struct GNUNET_HELLO_Message *hello); |
433 | 429 | ||
434 | 430 | ||
435 | /** | 431 | /** |
@@ -440,7 +436,7 @@ GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); | |||
440 | * @return NULL if a plugin with name @a name is not known/loadable | 436 | * @return NULL if a plugin with name @a name is not known/loadable |
441 | */ | 437 | */ |
442 | typedef struct GNUNET_TRANSPORT_PluginFunctions *( | 438 | typedef struct GNUNET_TRANSPORT_PluginFunctions *( |
443 | *GNUNET_HELLO_TransportPluginsFind) (const char *name); | 439 | *GNUNET_HELLO_TransportPluginsFind) (const char *name); |
444 | 440 | ||
445 | 441 | ||
446 | /** | 442 | /** |
@@ -451,8 +447,8 @@ typedef struct GNUNET_TRANSPORT_PluginFunctions *( | |||
451 | * @return Hello URI string | 447 | * @return Hello URI string |
452 | */ | 448 | */ |
453 | char * | 449 | char * |
454 | GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | 450 | GNUNET_HELLO_compose_uri(const struct GNUNET_HELLO_Message *hello, |
455 | GNUNET_HELLO_TransportPluginsFind plugins_find); | 451 | GNUNET_HELLO_TransportPluginsFind plugins_find); |
456 | 452 | ||
457 | 453 | ||
458 | /** | 454 | /** |
@@ -465,10 +461,10 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | |||
465 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors | 461 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors |
466 | */ | 462 | */ |
467 | int | 463 | int |
468 | GNUNET_HELLO_parse_uri (const char *uri, | 464 | GNUNET_HELLO_parse_uri(const char *uri, |
469 | struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, | 465 | struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, |
470 | struct GNUNET_HELLO_Message **hello, | 466 | struct GNUNET_HELLO_Message **hello, |
471 | GNUNET_HELLO_TransportPluginsFind plugins_find); | 467 | GNUNET_HELLO_TransportPluginsFind plugins_find); |
472 | 468 | ||
473 | 469 | ||
474 | /* NG API */ | 470 | /* NG API */ |
@@ -486,7 +482,7 @@ GNUNET_HELLO_parse_uri (const char *uri, | |||
486 | * @param result_size[out] set to size of @a result | 482 | * @param result_size[out] set to size of @a result |
487 | */ | 483 | */ |
488 | void | 484 | void |
489 | GNUNET_HELLO_sign_address ( | 485 | GNUNET_HELLO_sign_address( |
490 | const char *address, | 486 | const char *address, |
491 | enum GNUNET_NetworkType nt, | 487 | enum GNUNET_NetworkType nt, |
492 | struct GNUNET_TIME_Absolute mono_time, | 488 | struct GNUNET_TIME_Absolute mono_time, |
@@ -506,11 +502,11 @@ GNUNET_HELLO_sign_address ( | |||
506 | * @return NULL on error, otherwise the address | 502 | * @return NULL on error, otherwise the address |
507 | */ | 503 | */ |
508 | char * | 504 | char * |
509 | GNUNET_HELLO_extract_address (const void *raw, | 505 | GNUNET_HELLO_extract_address(const void *raw, |
510 | size_t raw_size, | 506 | size_t raw_size, |
511 | const struct GNUNET_PeerIdentity *pid, | 507 | const struct GNUNET_PeerIdentity *pid, |
512 | enum GNUNET_NetworkType *nt, | 508 | enum GNUNET_NetworkType *nt, |
513 | struct GNUNET_TIME_Absolute *mono_time); | 509 | struct GNUNET_TIME_Absolute *mono_time); |
514 | 510 | ||
515 | 511 | ||
516 | /** | 512 | /** |
@@ -521,7 +517,7 @@ GNUNET_HELLO_extract_address (const void *raw, | |||
521 | * @return NULL if the address is mal-formed, otherwise the prefix | 517 | * @return NULL if the address is mal-formed, otherwise the prefix |
522 | */ | 518 | */ |
523 | char * | 519 | char * |
524 | GNUNET_HELLO_address_to_prefix (const char *address); | 520 | GNUNET_HELLO_address_to_prefix(const char *address); |
525 | 521 | ||
526 | 522 | ||
527 | #if 0 /* keep Emacsens' auto-indent happy */ | 523 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_helper_lib.h b/src/include/gnunet_helper_lib.h index 5a34daf78..e6b3ae535 100644 --- a/src/include/gnunet_helper_lib.h +++ b/src/include/gnunet_helper_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Philipp Toelke | 22 | * @author Philipp Toelke |
@@ -74,12 +74,12 @@ typedef void | |||
74 | * @return the new Handle, NULL on error | 74 | * @return the new Handle, NULL on error |
75 | */ | 75 | */ |
76 | struct GNUNET_HELPER_Handle * | 76 | struct GNUNET_HELPER_Handle * |
77 | GNUNET_HELPER_start (int with_control_pipe, | 77 | GNUNET_HELPER_start(int with_control_pipe, |
78 | const char *binary_name, | 78 | const char *binary_name, |
79 | char *const binary_argv[], | 79 | char *const binary_argv[], |
80 | GNUNET_MessageTokenizerCallback cb, | 80 | GNUNET_MessageTokenizerCallback cb, |
81 | GNUNET_HELPER_ExceptionCallback exp_cb, | 81 | GNUNET_HELPER_ExceptionCallback exp_cb, |
82 | void *cb_cls); | 82 | void *cb_cls); |
83 | 83 | ||
84 | 84 | ||
85 | /** | 85 | /** |
@@ -92,7 +92,7 @@ GNUNET_HELPER_start (int with_control_pipe, | |||
92 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error | 92 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error |
93 | */ | 93 | */ |
94 | int | 94 | int |
95 | GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill); | 95 | GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill); |
96 | 96 | ||
97 | 97 | ||
98 | /** | 98 | /** |
@@ -104,7 +104,7 @@ GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill); | |||
104 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error | 104 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error |
105 | */ | 105 | */ |
106 | int | 106 | int |
107 | GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h); | 107 | GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h); |
108 | 108 | ||
109 | 109 | ||
110 | /** | 110 | /** |
@@ -113,7 +113,7 @@ GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h); | |||
113 | * @param h the helper handle to free | 113 | * @param h the helper handle to free |
114 | */ | 114 | */ |
115 | void | 115 | void |
116 | GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h); | 116 | GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h); |
117 | 117 | ||
118 | 118 | ||
119 | /** | 119 | /** |
@@ -125,7 +125,7 @@ GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h); | |||
125 | * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper | 125 | * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper |
126 | */ | 126 | */ |
127 | void | 127 | void |
128 | GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill); | 128 | GNUNET_HELPER_stop(struct GNUNET_HELPER_Handle *h, int soft_kill); |
129 | 129 | ||
130 | 130 | ||
131 | /** | 131 | /** |
@@ -137,7 +137,7 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill); | |||
137 | * #GNUNET_SYSERR during GNUNET_HELPER_destroy | 137 | * #GNUNET_SYSERR during GNUNET_HELPER_destroy |
138 | */ | 138 | */ |
139 | typedef void (*GNUNET_HELPER_Continuation)(void *cls, | 139 | typedef void (*GNUNET_HELPER_Continuation)(void *cls, |
140 | int result); | 140 | int result); |
141 | 141 | ||
142 | 142 | ||
143 | /** | 143 | /** |
@@ -160,11 +160,11 @@ struct GNUNET_HELPER_SendHandle; | |||
160 | * not be abortable) | 160 | * not be abortable) |
161 | */ | 161 | */ |
162 | struct GNUNET_HELPER_SendHandle * | 162 | struct GNUNET_HELPER_SendHandle * |
163 | GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, | 163 | GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, |
164 | const struct GNUNET_MessageHeader *msg, | 164 | const struct GNUNET_MessageHeader *msg, |
165 | int can_drop, | 165 | int can_drop, |
166 | GNUNET_HELPER_Continuation cont, | 166 | GNUNET_HELPER_Continuation cont, |
167 | void *cont_cls); | 167 | void *cont_cls); |
168 | 168 | ||
169 | 169 | ||
170 | /** | 170 | /** |
@@ -174,7 +174,7 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, | |||
174 | * @param sh operation to cancel | 174 | * @param sh operation to cancel |
175 | */ | 175 | */ |
176 | void | 176 | void |
177 | GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh); | 177 | GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh); |
178 | 178 | ||
179 | 179 | ||
180 | #endif | 180 | #endif |
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 52ed1e908..8a77e76e0 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -80,7 +80,7 @@ struct GNUNET_IDENTITY_Operation; | |||
80 | * @return associated ECC key, valid as long as the ego is valid | 80 | * @return associated ECC key, valid as long as the ego is valid |
81 | */ | 81 | */ |
82 | const struct GNUNET_CRYPTO_EcdsaPrivateKey * | 82 | const struct GNUNET_CRYPTO_EcdsaPrivateKey * |
83 | GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego); | 83 | GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego); |
84 | 84 | ||
85 | 85 | ||
86 | /** | 86 | /** |
@@ -89,7 +89,7 @@ GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego); | |||
89 | * @return handle for the anonymous user, must not be freed | 89 | * @return handle for the anonymous user, must not be freed |
90 | */ | 90 | */ |
91 | const struct GNUNET_IDENTITY_Ego * | 91 | const struct GNUNET_IDENTITY_Ego * |
92 | GNUNET_IDENTITY_ego_get_anonymous (void); | 92 | GNUNET_IDENTITY_ego_get_anonymous(void); |
93 | 93 | ||
94 | 94 | ||
95 | /** | 95 | /** |
@@ -99,8 +99,8 @@ GNUNET_IDENTITY_ego_get_anonymous (void); | |||
99 | * @param pk set to ego's public key | 99 | * @param pk set to ego's public key |
100 | */ | 100 | */ |
101 | void | 101 | void |
102 | GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, | 102 | GNUNET_IDENTITY_ego_get_public_key(const struct GNUNET_IDENTITY_Ego *ego, |
103 | struct GNUNET_CRYPTO_EcdsaPublicKey *pk); | 103 | struct GNUNET_CRYPTO_EcdsaPublicKey *pk); |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
@@ -152,9 +152,9 @@ typedef void (*GNUNET_IDENTITY_Callback) (void *cls, | |||
152 | * @return handle to communicate with identity service | 152 | * @return handle to communicate with identity service |
153 | */ | 153 | */ |
154 | struct GNUNET_IDENTITY_Handle * | 154 | struct GNUNET_IDENTITY_Handle * |
155 | GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 155 | GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
156 | GNUNET_IDENTITY_Callback cb, | 156 | GNUNET_IDENTITY_Callback cb, |
157 | void *cb_cls); | 157 | void *cb_cls); |
158 | 158 | ||
159 | 159 | ||
160 | /** | 160 | /** |
@@ -167,10 +167,10 @@ GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
167 | * @return handle to abort the operation | 167 | * @return handle to abort the operation |
168 | */ | 168 | */ |
169 | struct GNUNET_IDENTITY_Operation * | 169 | struct GNUNET_IDENTITY_Operation * |
170 | GNUNET_IDENTITY_get (struct GNUNET_IDENTITY_Handle *id, | 170 | GNUNET_IDENTITY_get(struct GNUNET_IDENTITY_Handle *id, |
171 | const char *service_name, | 171 | const char *service_name, |
172 | GNUNET_IDENTITY_Callback cb, | 172 | GNUNET_IDENTITY_Callback cb, |
173 | void *cb_cls); | 173 | void *cb_cls); |
174 | 174 | ||
175 | 175 | ||
176 | /** | 176 | /** |
@@ -194,11 +194,11 @@ typedef void (*GNUNET_IDENTITY_Continuation) (void *cls, const char *emsg); | |||
194 | * @return handle to abort the operation | 194 | * @return handle to abort the operation |
195 | */ | 195 | */ |
196 | struct GNUNET_IDENTITY_Operation * | 196 | struct GNUNET_IDENTITY_Operation * |
197 | GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id, | 197 | GNUNET_IDENTITY_set(struct GNUNET_IDENTITY_Handle *id, |
198 | const char *service_name, | 198 | const char *service_name, |
199 | struct GNUNET_IDENTITY_Ego *ego, | 199 | struct GNUNET_IDENTITY_Ego *ego, |
200 | GNUNET_IDENTITY_Continuation cont, | 200 | GNUNET_IDENTITY_Continuation cont, |
201 | void *cont_cls); | 201 | void *cont_cls); |
202 | 202 | ||
203 | 203 | ||
204 | /** | 204 | /** |
@@ -207,7 +207,7 @@ GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id, | |||
207 | * @param h identity service to disconnect | 207 | * @param h identity service to disconnect |
208 | */ | 208 | */ |
209 | void | 209 | void |
210 | GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h); | 210 | GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h); |
211 | 211 | ||
212 | 212 | ||
213 | /** | 213 | /** |
@@ -234,10 +234,10 @@ typedef void (*GNUNET_IDENTITY_CreateContinuation) ( | |||
234 | * @return handle to abort the operation | 234 | * @return handle to abort the operation |
235 | */ | 235 | */ |
236 | struct GNUNET_IDENTITY_Operation * | 236 | struct GNUNET_IDENTITY_Operation * |
237 | GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | 237 | GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *id, |
238 | const char *name, | 238 | const char *name, |
239 | GNUNET_IDENTITY_CreateContinuation cont, | 239 | GNUNET_IDENTITY_CreateContinuation cont, |
240 | void *cont_cls); | 240 | void *cont_cls); |
241 | 241 | ||
242 | 242 | ||
243 | /** | 243 | /** |
@@ -251,11 +251,11 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | |||
251 | * @return handle to abort the operation | 251 | * @return handle to abort the operation |
252 | */ | 252 | */ |
253 | struct GNUNET_IDENTITY_Operation * | 253 | struct GNUNET_IDENTITY_Operation * |
254 | GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id, | 254 | GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *id, |
255 | const char *old_name, | 255 | const char *old_name, |
256 | const char *new_name, | 256 | const char *new_name, |
257 | GNUNET_IDENTITY_Continuation cb, | 257 | GNUNET_IDENTITY_Continuation cb, |
258 | void *cb_cls); | 258 | void *cb_cls); |
259 | 259 | ||
260 | 260 | ||
261 | /** | 261 | /** |
@@ -268,10 +268,10 @@ GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id, | |||
268 | * @return handle to abort the operation | 268 | * @return handle to abort the operation |
269 | */ | 269 | */ |
270 | struct GNUNET_IDENTITY_Operation * | 270 | struct GNUNET_IDENTITY_Operation * |
271 | GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, | 271 | GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *id, |
272 | const char *name, | 272 | const char *name, |
273 | GNUNET_IDENTITY_Continuation cb, | 273 | GNUNET_IDENTITY_Continuation cb, |
274 | void *cb_cls); | 274 | void *cb_cls); |
275 | 275 | ||
276 | 276 | ||
277 | /** | 277 | /** |
@@ -283,7 +283,7 @@ GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, | |||
283 | * @param op operation to cancel | 283 | * @param op operation to cancel |
284 | */ | 284 | */ |
285 | void | 285 | void |
286 | GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op); | 286 | GNUNET_IDENTITY_cancel(struct GNUNET_IDENTITY_Operation *op); |
287 | 287 | ||
288 | 288 | ||
289 | /* ************* convenience API to lookup an ego ***************** */ | 289 | /* ************* convenience API to lookup an ego ***************** */ |
@@ -314,10 +314,10 @@ struct GNUNET_IDENTITY_EgoLookup; | |||
314 | * @return NULL on error | 314 | * @return NULL on error |
315 | */ | 315 | */ |
316 | struct GNUNET_IDENTITY_EgoLookup * | 316 | struct GNUNET_IDENTITY_EgoLookup * |
317 | GNUNET_IDENTITY_ego_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, | 317 | GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, |
318 | const char *name, | 318 | const char *name, |
319 | GNUNET_IDENTITY_EgoCallback cb, | 319 | GNUNET_IDENTITY_EgoCallback cb, |
320 | void *cb_cls); | 320 | void *cb_cls); |
321 | 321 | ||
322 | 322 | ||
323 | /** | 323 | /** |
@@ -326,7 +326,7 @@ GNUNET_IDENTITY_ego_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
326 | * @param el handle for lookup to abort | 326 | * @param el handle for lookup to abort |
327 | */ | 327 | */ |
328 | void | 328 | void |
329 | GNUNET_IDENTITY_ego_lookup_cancel (struct GNUNET_IDENTITY_EgoLookup *el); | 329 | GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el); |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * Function called with the result. | 332 | * Function called with the result. |
@@ -360,10 +360,10 @@ struct GNUNET_IDENTITY_EgoSuffixLookup; | |||
360 | * @return handle to abort the operation | 360 | * @return handle to abort the operation |
361 | */ | 361 | */ |
362 | struct GNUNET_IDENTITY_EgoSuffixLookup * | 362 | struct GNUNET_IDENTITY_EgoSuffixLookup * |
363 | GNUNET_IDENTITY_ego_lookup_by_suffix (const struct GNUNET_CONFIGURATION_Handle *cfg, | 363 | GNUNET_IDENTITY_ego_lookup_by_suffix(const struct GNUNET_CONFIGURATION_Handle *cfg, |
364 | const char *suffix, | 364 | const char *suffix, |
365 | GNUNET_IDENTITY_EgoSuffixCallback cb, | 365 | GNUNET_IDENTITY_EgoSuffixCallback cb, |
366 | void *cb_cls); | 366 | void *cb_cls); |
367 | 367 | ||
368 | 368 | ||
369 | /** | 369 | /** |
@@ -372,7 +372,7 @@ GNUNET_IDENTITY_ego_lookup_by_suffix (const struct GNUNET_CONFIGURATION_Handle * | |||
372 | * @param el handle for lookup to abort | 372 | * @param el handle for lookup to abort |
373 | */ | 373 | */ |
374 | void | 374 | void |
375 | GNUNET_IDENTITY_ego_lookup_by_suffix_cancel (struct GNUNET_IDENTITY_EgoSuffixLookup *el); | 375 | GNUNET_IDENTITY_ego_lookup_by_suffix_cancel(struct GNUNET_IDENTITY_EgoSuffixLookup *el); |
376 | 376 | ||
377 | #if 0 /* keep Emacsens' auto-indent happy */ | 377 | #if 0 /* keep Emacsens' auto-indent happy */ |
378 | { | 378 | { |
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index bba994d03..3ca4bf729 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. | 3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file gnunet_json_lib.h | 21 | * @file gnunet_json_lib.h |
22 | * @brief functions to parse JSON objects into GNUnet objects | 22 | * @brief functions to parse JSON objects into GNUnet objects |
@@ -67,8 +67,7 @@ typedef void (*GNUNET_JSON_Cleaner) (void *cls, | |||
67 | /** | 67 | /** |
68 | * @brief Entry in parser specification for #GNUNET_JSON_parse(). | 68 | * @brief Entry in parser specification for #GNUNET_JSON_parse(). |
69 | */ | 69 | */ |
70 | struct GNUNET_JSON_Specification | 70 | struct GNUNET_JSON_Specification { |
71 | { | ||
72 | /** | 71 | /** |
73 | * Function for how to parse this type of entry. | 72 | * Function for how to parse this type of entry. |
74 | */ | 73 | */ |
@@ -126,10 +125,10 @@ struct GNUNET_JSON_Specification | |||
126 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 125 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
127 | */ | 126 | */ |
128 | int | 127 | int |
129 | GNUNET_JSON_parse (const json_t *root, | 128 | GNUNET_JSON_parse(const json_t *root, |
130 | struct GNUNET_JSON_Specification *spec, | 129 | struct GNUNET_JSON_Specification *spec, |
131 | const char **error_json_name, | 130 | const char **error_json_name, |
132 | unsigned int *error_line); | 131 | unsigned int *error_line); |
133 | 132 | ||
134 | 133 | ||
135 | /** | 134 | /** |
@@ -139,7 +138,7 @@ GNUNET_JSON_parse (const json_t *root, | |||
139 | * @param spec specification of the parse operation | 138 | * @param spec specification of the parse operation |
140 | */ | 139 | */ |
141 | void | 140 | void |
142 | GNUNET_JSON_parse_free (struct GNUNET_JSON_Specification *spec); | 141 | GNUNET_JSON_parse_free(struct GNUNET_JSON_Specification *spec); |
143 | 142 | ||
144 | 143 | ||
145 | /* ****************** Canonical parser specifications ******************* */ | 144 | /* ****************** Canonical parser specifications ******************* */ |
@@ -149,7 +148,7 @@ GNUNET_JSON_parse_free (struct GNUNET_JSON_Specification *spec); | |||
149 | * End of a parser specification. | 148 | * End of a parser specification. |
150 | */ | 149 | */ |
151 | struct GNUNET_JSON_Specification | 150 | struct GNUNET_JSON_Specification |
152 | GNUNET_JSON_spec_end (void); | 151 | GNUNET_JSON_spec_end(void); |
153 | 152 | ||
154 | 153 | ||
155 | /** | 154 | /** |
@@ -159,7 +158,7 @@ GNUNET_JSON_spec_end (void); | |||
159 | * @return spec copy of @a spec with optional bit set | 158 | * @return spec copy of @a spec with optional bit set |
160 | */ | 159 | */ |
161 | struct GNUNET_JSON_Specification | 160 | struct GNUNET_JSON_Specification |
162 | GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec); | 161 | GNUNET_JSON_spec_mark_optional(struct GNUNET_JSON_Specification spec); |
163 | 162 | ||
164 | 163 | ||
165 | /** | 164 | /** |
@@ -171,7 +170,7 @@ GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec); | |||
171 | * @param size number of bytes expected in @a obj | 170 | * @param size number of bytes expected in @a obj |
172 | */ | 171 | */ |
173 | struct GNUNET_JSON_Specification | 172 | struct GNUNET_JSON_Specification |
174 | GNUNET_JSON_spec_fixed (const char *name, void *obj, size_t size); | 173 | GNUNET_JSON_spec_fixed(const char *name, void *obj, size_t size); |
175 | 174 | ||
176 | 175 | ||
177 | /** | 176 | /** |
@@ -182,7 +181,7 @@ GNUNET_JSON_spec_fixed (const char *name, void *obj, size_t size); | |||
182 | * @param obj pointer where to write the data (type of `*obj` will determine size) | 181 | * @param obj pointer where to write the data (type of `*obj` will determine size) |
183 | */ | 182 | */ |
184 | #define GNUNET_JSON_spec_fixed_auto(name, obj) \ | 183 | #define GNUNET_JSON_spec_fixed_auto(name, obj) \ |
185 | GNUNET_JSON_spec_fixed (name, obj, sizeof (*obj)) | 184 | GNUNET_JSON_spec_fixed(name, obj, sizeof(*obj)) |
186 | 185 | ||
187 | 186 | ||
188 | /** | 187 | /** |
@@ -194,7 +193,7 @@ GNUNET_JSON_spec_fixed (const char *name, void *obj, size_t size); | |||
194 | * @param[out] size where to store the number of bytes allocated for @a obj | 193 | * @param[out] size where to store the number of bytes allocated for @a obj |
195 | */ | 194 | */ |
196 | struct GNUNET_JSON_Specification | 195 | struct GNUNET_JSON_Specification |
197 | GNUNET_JSON_spec_varsize (const char *name, void **obj, size_t *size); | 196 | GNUNET_JSON_spec_varsize(const char *name, void **obj, size_t *size); |
198 | 197 | ||
199 | 198 | ||
200 | /** | 199 | /** |
@@ -204,7 +203,7 @@ GNUNET_JSON_spec_varsize (const char *name, void **obj, size_t *size); | |||
204 | * @param strptr where to store a pointer to the field | 203 | * @param strptr where to store a pointer to the field |
205 | */ | 204 | */ |
206 | struct GNUNET_JSON_Specification | 205 | struct GNUNET_JSON_Specification |
207 | GNUNET_JSON_spec_string (const char *name, const char **strptr); | 206 | GNUNET_JSON_spec_string(const char *name, const char **strptr); |
208 | 207 | ||
209 | /** | 208 | /** |
210 | * JSON object. | 209 | * JSON object. |
@@ -213,7 +212,7 @@ GNUNET_JSON_spec_string (const char *name, const char **strptr); | |||
213 | * @param[out] jsonp where to store the JSON found under @a name | 212 | * @param[out] jsonp where to store the JSON found under @a name |
214 | */ | 213 | */ |
215 | struct GNUNET_JSON_Specification | 214 | struct GNUNET_JSON_Specification |
216 | GNUNET_JSON_spec_json (const char *name, json_t **jsonp); | 215 | GNUNET_JSON_spec_json(const char *name, json_t **jsonp); |
217 | 216 | ||
218 | 217 | ||
219 | /** | 218 | /** |
@@ -223,7 +222,7 @@ GNUNET_JSON_spec_json (const char *name, json_t **jsonp); | |||
223 | * @param[out] u8 where to store the integer found under @a name | 222 | * @param[out] u8 where to store the integer found under @a name |
224 | */ | 223 | */ |
225 | struct GNUNET_JSON_Specification | 224 | struct GNUNET_JSON_Specification |
226 | GNUNET_JSON_spec_uint8 (const char *name, uint8_t *u8); | 225 | GNUNET_JSON_spec_uint8(const char *name, uint8_t *u8); |
227 | 226 | ||
228 | 227 | ||
229 | /** | 228 | /** |
@@ -233,7 +232,7 @@ GNUNET_JSON_spec_uint8 (const char *name, uint8_t *u8); | |||
233 | * @param[out] u16 where to store the integer found under @a name | 232 | * @param[out] u16 where to store the integer found under @a name |
234 | */ | 233 | */ |
235 | struct GNUNET_JSON_Specification | 234 | struct GNUNET_JSON_Specification |
236 | GNUNET_JSON_spec_uint16 (const char *name, uint16_t *u16); | 235 | GNUNET_JSON_spec_uint16(const char *name, uint16_t *u16); |
237 | 236 | ||
238 | 237 | ||
239 | /** | 238 | /** |
@@ -243,7 +242,7 @@ GNUNET_JSON_spec_uint16 (const char *name, uint16_t *u16); | |||
243 | * @param[out] u32 where to store the integer found under @a name | 242 | * @param[out] u32 where to store the integer found under @a name |
244 | */ | 243 | */ |
245 | struct GNUNET_JSON_Specification | 244 | struct GNUNET_JSON_Specification |
246 | GNUNET_JSON_spec_uint32 (const char *name, uint32_t *u32); | 245 | GNUNET_JSON_spec_uint32(const char *name, uint32_t *u32); |
247 | 246 | ||
248 | 247 | ||
249 | /** | 248 | /** |
@@ -253,7 +252,7 @@ GNUNET_JSON_spec_uint32 (const char *name, uint32_t *u32); | |||
253 | * @param[out] u64 where to store the integer found under @a name | 252 | * @param[out] u64 where to store the integer found under @a name |
254 | */ | 253 | */ |
255 | struct GNUNET_JSON_Specification | 254 | struct GNUNET_JSON_Specification |
256 | GNUNET_JSON_spec_uint64 (const char *name, uint64_t *u64); | 255 | GNUNET_JSON_spec_uint64(const char *name, uint64_t *u64); |
257 | 256 | ||
258 | 257 | ||
259 | /** | 258 | /** |
@@ -263,7 +262,7 @@ GNUNET_JSON_spec_uint64 (const char *name, uint64_t *u64); | |||
263 | * @param[out] boolean where to store the boolean found under @a name | 262 | * @param[out] boolean where to store the boolean found under @a name |
264 | */ | 263 | */ |
265 | struct GNUNET_JSON_Specification | 264 | struct GNUNET_JSON_Specification |
266 | GNUNET_JSON_spec_boolean (const char *name, int *boolean); | 265 | GNUNET_JSON_spec_boolean(const char *name, int *boolean); |
267 | 266 | ||
268 | 267 | ||
269 | /* ************ GNUnet-specific parser specifications ******************* */ | 268 | /* ************ GNUnet-specific parser specifications ******************* */ |
@@ -275,8 +274,8 @@ GNUNET_JSON_spec_boolean (const char *name, int *boolean); | |||
275 | * @param[out] at where to store the absolute time found under @a name | 274 | * @param[out] at where to store the absolute time found under @a name |
276 | */ | 275 | */ |
277 | struct GNUNET_JSON_Specification | 276 | struct GNUNET_JSON_Specification |
278 | GNUNET_JSON_spec_absolute_time (const char *name, | 277 | GNUNET_JSON_spec_absolute_time(const char *name, |
279 | struct GNUNET_TIME_Absolute *at); | 278 | struct GNUNET_TIME_Absolute *at); |
280 | 279 | ||
281 | 280 | ||
282 | /** | 281 | /** |
@@ -286,8 +285,8 @@ GNUNET_JSON_spec_absolute_time (const char *name, | |||
286 | * @param[out] at where to store the absolute time found under @a name | 285 | * @param[out] at where to store the absolute time found under @a name |
287 | */ | 286 | */ |
288 | struct GNUNET_JSON_Specification | 287 | struct GNUNET_JSON_Specification |
289 | GNUNET_JSON_spec_absolute_time_nbo (const char *name, | 288 | GNUNET_JSON_spec_absolute_time_nbo(const char *name, |
290 | struct GNUNET_TIME_AbsoluteNBO *at); | 289 | struct GNUNET_TIME_AbsoluteNBO *at); |
291 | 290 | ||
292 | 291 | ||
293 | /** | 292 | /** |
@@ -297,8 +296,8 @@ GNUNET_JSON_spec_absolute_time_nbo (const char *name, | |||
297 | * @param[out] rt where to store the relative time found under @a name | 296 | * @param[out] rt where to store the relative time found under @a name |
298 | */ | 297 | */ |
299 | struct GNUNET_JSON_Specification | 298 | struct GNUNET_JSON_Specification |
300 | GNUNET_JSON_spec_relative_time (const char *name, | 299 | GNUNET_JSON_spec_relative_time(const char *name, |
301 | struct GNUNET_TIME_Relative *rt); | 300 | struct GNUNET_TIME_Relative *rt); |
302 | 301 | ||
303 | 302 | ||
304 | /** | 303 | /** |
@@ -308,8 +307,8 @@ GNUNET_JSON_spec_relative_time (const char *name, | |||
308 | * @param pk where to store the RSA key found under @a name | 307 | * @param pk where to store the RSA key found under @a name |
309 | */ | 308 | */ |
310 | struct GNUNET_JSON_Specification | 309 | struct GNUNET_JSON_Specification |
311 | GNUNET_JSON_spec_rsa_public_key (const char *name, | 310 | GNUNET_JSON_spec_rsa_public_key(const char *name, |
312 | struct GNUNET_CRYPTO_RsaPublicKey **pk); | 311 | struct GNUNET_CRYPTO_RsaPublicKey **pk); |
313 | 312 | ||
314 | 313 | ||
315 | /** | 314 | /** |
@@ -319,8 +318,8 @@ GNUNET_JSON_spec_rsa_public_key (const char *name, | |||
319 | * @param sig where to store the RSA signature found under @a name | 318 | * @param sig where to store the RSA signature found under @a name |
320 | */ | 319 | */ |
321 | struct GNUNET_JSON_Specification | 320 | struct GNUNET_JSON_Specification |
322 | GNUNET_JSON_spec_rsa_signature (const char *name, | 321 | GNUNET_JSON_spec_rsa_signature(const char *name, |
323 | struct GNUNET_CRYPTO_RsaSignature **sig); | 322 | struct GNUNET_CRYPTO_RsaSignature **sig); |
324 | 323 | ||
325 | 324 | ||
326 | /** | 325 | /** |
@@ -330,9 +329,9 @@ GNUNET_JSON_spec_rsa_signature (const char *name, | |||
330 | * @return JSON Specification | 329 | * @return JSON Specification |
331 | */ | 330 | */ |
332 | struct GNUNET_JSON_Specification | 331 | struct GNUNET_JSON_Specification |
333 | GNUNET_JSON_spec_gnsrecord (struct GNUNET_GNSRECORD_Data **rd, | 332 | GNUNET_JSON_spec_gnsrecord(struct GNUNET_GNSRECORD_Data **rd, |
334 | unsigned int *rd_count, | 333 | unsigned int *rd_count, |
335 | char **name); | 334 | char **name); |
336 | 335 | ||
337 | 336 | ||
338 | /* ****************** Generic generator interface ******************* */ | 337 | /* ****************** Generic generator interface ******************* */ |
@@ -347,7 +346,7 @@ GNUNET_JSON_spec_gnsrecord (struct GNUNET_GNSRECORD_Data **rd, | |||
347 | * @return json string that encodes @a data | 346 | * @return json string that encodes @a data |
348 | */ | 347 | */ |
349 | json_t * | 348 | json_t * |
350 | GNUNET_JSON_from_data (const void *data, size_t size); | 349 | GNUNET_JSON_from_data(const void *data, size_t size); |
351 | 350 | ||
352 | 351 | ||
353 | /** | 352 | /** |
@@ -358,7 +357,7 @@ GNUNET_JSON_from_data (const void *data, size_t size); | |||
358 | * @return json string that encodes @a data | 357 | * @return json string that encodes @a data |
359 | */ | 358 | */ |
360 | #define GNUNET_JSON_from_data_auto(ptr) \ | 359 | #define GNUNET_JSON_from_data_auto(ptr) \ |
361 | GNUNET_JSON_from_data (ptr, sizeof (*ptr)) | 360 | GNUNET_JSON_from_data(ptr, sizeof(*ptr)) |
362 | 361 | ||
363 | 362 | ||
364 | /** | 363 | /** |
@@ -368,7 +367,7 @@ GNUNET_JSON_from_data (const void *data, size_t size); | |||
368 | * @return a json string with the timestamp in @a stamp | 367 | * @return a json string with the timestamp in @a stamp |
369 | */ | 368 | */ |
370 | json_t * | 369 | json_t * |
371 | GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute stamp); | 370 | GNUNET_JSON_from_time_abs(struct GNUNET_TIME_Absolute stamp); |
372 | 371 | ||
373 | 372 | ||
374 | /** | 373 | /** |
@@ -378,7 +377,7 @@ GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute stamp); | |||
378 | * @return a json string with the timestamp in @a stamp | 377 | * @return a json string with the timestamp in @a stamp |
379 | */ | 378 | */ |
380 | json_t * | 379 | json_t * |
381 | GNUNET_JSON_from_time_abs_nbo (struct GNUNET_TIME_AbsoluteNBO stamp); | 380 | GNUNET_JSON_from_time_abs_nbo(struct GNUNET_TIME_AbsoluteNBO stamp); |
382 | 381 | ||
383 | 382 | ||
384 | /** | 383 | /** |
@@ -388,7 +387,7 @@ GNUNET_JSON_from_time_abs_nbo (struct GNUNET_TIME_AbsoluteNBO stamp); | |||
388 | * @return a json string with the timestamp in @a stamp | 387 | * @return a json string with the timestamp in @a stamp |
389 | */ | 388 | */ |
390 | json_t * | 389 | json_t * |
391 | GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp); | 390 | GNUNET_JSON_from_time_rel(struct GNUNET_TIME_Relative stamp); |
392 | 391 | ||
393 | 392 | ||
394 | /** | 393 | /** |
@@ -398,7 +397,7 @@ GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp); | |||
398 | * @return corresponding JSON encoding | 397 | * @return corresponding JSON encoding |
399 | */ | 398 | */ |
400 | json_t * | 399 | json_t * |
401 | GNUNET_JSON_from_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *pk); | 400 | GNUNET_JSON_from_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *pk); |
402 | 401 | ||
403 | 402 | ||
404 | /** | 403 | /** |
@@ -408,7 +407,7 @@ GNUNET_JSON_from_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *pk); | |||
408 | * @return corresponding JSON encoding | 407 | * @return corresponding JSON encoding |
409 | */ | 408 | */ |
410 | json_t * | 409 | json_t * |
411 | GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig); | 410 | GNUNET_JSON_from_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *sig); |
412 | 411 | ||
413 | /** | 412 | /** |
414 | * Convert Gns record to JSON. | 413 | * Convert Gns record to JSON. |
@@ -418,17 +417,16 @@ GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig); | |||
418 | * @return corresponding JSON encoding | 417 | * @return corresponding JSON encoding |
419 | */ | 418 | */ |
420 | json_t * | 419 | json_t * |
421 | GNUNET_JSON_from_gnsrecord (const char *rname, | 420 | GNUNET_JSON_from_gnsrecord(const char *rname, |
422 | const struct GNUNET_GNSRECORD_Data *rd, | 421 | const struct GNUNET_GNSRECORD_Data *rd, |
423 | unsigned int rd_count); | 422 | unsigned int rd_count); |
424 | 423 | ||
425 | /* ******************* Helpers for MHD upload handling ******************* */ | 424 | /* ******************* Helpers for MHD upload handling ******************* */ |
426 | 425 | ||
427 | /** | 426 | /** |
428 | * Return codes from #GNUNET_JSON_post_parser(). | 427 | * Return codes from #GNUNET_JSON_post_parser(). |
429 | */ | 428 | */ |
430 | enum GNUNET_JSON_PostResult | 429 | enum GNUNET_JSON_PostResult { |
431 | { | ||
432 | /** | 430 | /** |
433 | * Parsing successful, JSON result is in `*json`. | 431 | * Parsing successful, JSON result is in `*json`. |
434 | */ | 432 | */ |
@@ -472,12 +470,12 @@ enum GNUNET_JSON_PostResult | |||
472 | * @return result code indicating the status of the operation | 470 | * @return result code indicating the status of the operation |
473 | */ | 471 | */ |
474 | enum GNUNET_JSON_PostResult | 472 | enum GNUNET_JSON_PostResult |
475 | GNUNET_JSON_post_parser (size_t buffer_max, | 473 | GNUNET_JSON_post_parser(size_t buffer_max, |
476 | struct MHD_Connection *connection, | 474 | struct MHD_Connection *connection, |
477 | void **con_cls, | 475 | void **con_cls, |
478 | const char *upload_data, | 476 | const char *upload_data, |
479 | size_t *upload_data_size, | 477 | size_t *upload_data_size, |
480 | json_t **json); | 478 | json_t **json); |
481 | 479 | ||
482 | 480 | ||
483 | /** | 481 | /** |
@@ -488,7 +486,7 @@ GNUNET_JSON_post_parser (size_t buffer_max, | |||
488 | * #GNUNET_JSON_post_parser(), to be cleaned up | 486 | * #GNUNET_JSON_post_parser(), to be cleaned up |
489 | */ | 487 | */ |
490 | void | 488 | void |
491 | GNUNET_JSON_post_parser_cleanup (void *con_cls); | 489 | GNUNET_JSON_post_parser_cleanup(void *con_cls); |
492 | 490 | ||
493 | 491 | ||
494 | /* ****************** GETOPT JSON helper ******************* */ | 492 | /* ****************** GETOPT JSON helper ******************* */ |
@@ -504,11 +502,11 @@ GNUNET_JSON_post_parser_cleanup (void *con_cls); | |||
504 | * @param[out] val set to the JSON specified at the command line | 502 | * @param[out] val set to the JSON specified at the command line |
505 | */ | 503 | */ |
506 | struct GNUNET_GETOPT_CommandLineOption | 504 | struct GNUNET_GETOPT_CommandLineOption |
507 | GNUNET_JSON_getopt (char shortName, | 505 | GNUNET_JSON_getopt(char shortName, |
508 | const char *name, | 506 | const char *name, |
509 | const char *argumentHelp, | 507 | const char *argumentHelp, |
510 | const char *description, | 508 | const char *description, |
511 | json_t **json); | 509 | json_t **json); |
512 | 510 | ||
513 | #endif | 511 | #endif |
514 | 512 | ||
diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index f38b66b88..1e786181f 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -57,7 +57,7 @@ struct GNUNET_LOAD_Value; | |||
57 | * @return the new load value | 57 | * @return the new load value |
58 | */ | 58 | */ |
59 | struct GNUNET_LOAD_Value * | 59 | struct GNUNET_LOAD_Value * |
60 | GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); | 60 | GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline); |
61 | 61 | ||
62 | 62 | ||
63 | /** | 63 | /** |
@@ -67,8 +67,8 @@ GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); | |||
67 | * @param autodecline frequency of load decline | 67 | * @param autodecline frequency of load decline |
68 | */ | 68 | */ |
69 | void | 69 | void |
70 | GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | 70 | GNUNET_LOAD_value_set_decline(struct GNUNET_LOAD_Value *load, |
71 | struct GNUNET_TIME_Relative autodecline); | 71 | struct GNUNET_TIME_Relative autodecline); |
72 | 72 | ||
73 | 73 | ||
74 | /** | 74 | /** |
@@ -76,7 +76,7 @@ GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | |||
76 | * | 76 | * |
77 | * @param lv value to free | 77 | * @param lv value to free |
78 | */ | 78 | */ |
79 | #define GNUNET_LOAD_value_free(lv) GNUNET_free (lv) | 79 | #define GNUNET_LOAD_value_free(lv) GNUNET_free(lv) |
80 | 80 | ||
81 | 81 | ||
82 | /** | 82 | /** |
@@ -89,7 +89,7 @@ GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | |||
89 | * that we could not do proper calculations | 89 | * that we could not do proper calculations |
90 | */ | 90 | */ |
91 | double | 91 | double |
92 | GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | 92 | GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load); |
93 | 93 | ||
94 | 94 | ||
95 | /** | 95 | /** |
@@ -99,7 +99,7 @@ GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | |||
99 | * @return zero if update was never called | 99 | * @return zero if update was never called |
100 | */ | 100 | */ |
101 | double | 101 | double |
102 | GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | 102 | GNUNET_LOAD_get_average(struct GNUNET_LOAD_Value *load); |
103 | 103 | ||
104 | 104 | ||
105 | /** | 105 | /** |
@@ -109,7 +109,7 @@ GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | |||
109 | * @param data latest measurement value (for example, delay) | 109 | * @param data latest measurement value (for example, delay) |
110 | */ | 110 | */ |
111 | void | 111 | void |
112 | GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); | 112 | GNUNET_LOAD_update(struct GNUNET_LOAD_Value *load, uint64_t data); |
113 | 113 | ||
114 | 114 | ||
115 | #if 0 /* keep Emacsens' auto-indent happy */ | 115 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_microphone_lib.h b/src/include/gnunet_microphone_lib.h index 46e5bfa25..f5cf4abc6 100644 --- a/src/include/gnunet_microphone_lib.h +++ b/src/include/gnunet_microphone_lib.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -36,7 +36,7 @@ | |||
36 | #ifdef __cplusplus | 36 | #ifdef __cplusplus |
37 | extern "C" | 37 | extern "C" |
38 | { | 38 | { |
39 | #if 0 /* keep Emacsens' auto-indent happy */ | 39 | #if 0 /* keep Emacsens' auto-indent happy */ |
40 | } | 40 | } |
41 | #endif | 41 | #endif |
42 | #endif | 42 | #endif |
@@ -51,8 +51,8 @@ extern "C" | |||
51 | * @param data audio data to play | 51 | * @param data audio data to play |
52 | */ | 52 | */ |
53 | typedef void (*GNUNET_MICROPHONE_RecordedDataCallback)(void *cls, | 53 | typedef void (*GNUNET_MICROPHONE_RecordedDataCallback)(void *cls, |
54 | size_t data_size, | 54 | size_t data_size, |
55 | const void *data); | 55 | const void *data); |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Enable a microphone. | 58 | * Enable a microphone. |
@@ -63,8 +63,8 @@ typedef void (*GNUNET_MICROPHONE_RecordedDataCallback)(void *cls, | |||
63 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 63 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
64 | */ | 64 | */ |
65 | typedef int (*GNUNET_MICROPHONE_EnableCallback)(void *cls, | 65 | typedef int (*GNUNET_MICROPHONE_EnableCallback)(void *cls, |
66 | GNUNET_MICROPHONE_RecordedDataCallback rdc, | 66 | GNUNET_MICROPHONE_RecordedDataCallback rdc, |
67 | void *rdc_cls); | 67 | void *rdc_cls); |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Function that disables a microphone. | 70 | * Function that disables a microphone. |
@@ -84,9 +84,7 @@ typedef void (*GNUNET_MICROPHONE_DestroyCallback)(void *cls); | |||
84 | /** | 84 | /** |
85 | * A microphone is a device that can capture or otherwise produce audio data. | 85 | * A microphone is a device that can capture or otherwise produce audio data. |
86 | */ | 86 | */ |
87 | struct GNUNET_MICROPHONE_Handle | 87 | struct GNUNET_MICROPHONE_Handle { |
88 | { | ||
89 | |||
90 | /** | 88 | /** |
91 | * Turn on the microphone. | 89 | * Turn on the microphone. |
92 | */ | 90 | */ |
@@ -106,7 +104,6 @@ struct GNUNET_MICROPHONE_Handle | |||
106 | * Closure for the callbacks. | 104 | * Closure for the callbacks. |
107 | */ | 105 | */ |
108 | void *cls; | 106 | void *cls; |
109 | |||
110 | }; | 107 | }; |
111 | 108 | ||
112 | 109 | ||
@@ -118,7 +115,7 @@ struct GNUNET_MICROPHONE_Handle | |||
118 | * @return NULL on error | 115 | * @return NULL on error |
119 | */ | 116 | */ |
120 | struct GNUNET_MICROPHONE_Handle * | 117 | struct GNUNET_MICROPHONE_Handle * |
121 | GNUNET_MICROPHONE_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle *cfg); | 118 | GNUNET_MICROPHONE_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cfg); |
122 | 119 | ||
123 | 120 | ||
124 | /** | 121 | /** |
@@ -127,10 +124,10 @@ GNUNET_MICROPHONE_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle | |||
127 | * @param microphone microphone to destroy | 124 | * @param microphone microphone to destroy |
128 | */ | 125 | */ |
129 | void | 126 | void |
130 | GNUNET_MICROPHONE_destroy (struct GNUNET_MICROPHONE_Handle *microphone); | 127 | GNUNET_MICROPHONE_destroy(struct GNUNET_MICROPHONE_Handle *microphone); |
131 | 128 | ||
132 | 129 | ||
133 | #if 0 /* keep Emacsens' auto-indent happy */ | 130 | #if 0 /* keep Emacsens' auto-indent happy */ |
134 | { | 131 | { |
135 | #endif | 132 | #endif |
136 | #ifdef __cplusplus | 133 | #ifdef __cplusplus |
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index f3073d54b..1839a68bd 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Florian Dold | 22 | * @author Florian Dold |
@@ -50,9 +50,9 @@ | |||
50 | * @return the MQ message | 50 | * @return the MQ message |
51 | */ | 51 | */ |
52 | #define GNUNET_MQ_msg_extra(mvar, esize, type) \ | 52 | #define GNUNET_MQ_msg_extra(mvar, esize, type) \ |
53 | GNUNET_MQ_msg_ (((struct GNUNET_MessageHeader **) &(mvar)), \ | 53 | GNUNET_MQ_msg_(((struct GNUNET_MessageHeader **)&(mvar)), \ |
54 | (esize) + sizeof *(mvar), \ | 54 | (esize) + sizeof *(mvar), \ |
55 | (type)) | 55 | (type)) |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Allocate a GNUNET_MQ_Envelope. | 58 | * Allocate a GNUNET_MQ_Envelope. |
@@ -64,7 +64,7 @@ | |||
64 | * @param type type of the message | 64 | * @param type type of the message |
65 | * @return the allocated envelope | 65 | * @return the allocated envelope |
66 | */ | 66 | */ |
67 | #define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra (mvar, 0, type) | 67 | #define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra(mvar, 0, type) |
68 | 68 | ||
69 | 69 | ||
70 | /** | 70 | /** |
@@ -74,7 +74,7 @@ | |||
74 | * @param type type of the message | 74 | * @param type type of the message |
75 | */ | 75 | */ |
76 | #define GNUNET_MQ_msg_header(type) \ | 76 | #define GNUNET_MQ_msg_header(type) \ |
77 | GNUNET_MQ_msg_ (NULL, sizeof (struct GNUNET_MessageHeader), type) | 77 | GNUNET_MQ_msg_(NULL, sizeof(struct GNUNET_MessageHeader), type) |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
@@ -86,7 +86,7 @@ | |||
86 | * @param type type of the message | 86 | * @param type type of the message |
87 | */ | 87 | */ |
88 | #define GNUNET_MQ_msg_header_extra(mh, esize, type) \ | 88 | #define GNUNET_MQ_msg_header_extra(mh, esize, type) \ |
89 | GNUNET_MQ_msg_ (&mh, (esize) + sizeof (struct GNUNET_MessageHeader), type) | 89 | GNUNET_MQ_msg_(&mh, (esize) + sizeof(struct GNUNET_MessageHeader), type) |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
@@ -102,11 +102,11 @@ | |||
102 | #define GNUNET_MQ_msg_nested_mh(mvar, type, mh) \ | 102 | #define GNUNET_MQ_msg_nested_mh(mvar, type, mh) \ |
103 | ({ \ | 103 | ({ \ |
104 | struct GNUNET_MQ_Envelope *_ev; \ | 104 | struct GNUNET_MQ_Envelope *_ev; \ |
105 | _ev = GNUNET_MQ_msg_nested_mh_ ((struct GNUNET_MessageHeader **) &(mvar), \ | 105 | _ev = GNUNET_MQ_msg_nested_mh_((struct GNUNET_MessageHeader **)&(mvar), \ |
106 | sizeof (*(mvar)), \ | 106 | sizeof(*(mvar)), \ |
107 | (type), \ | 107 | (type), \ |
108 | (mh)); \ | 108 | (mh)); \ |
109 | (void) (mvar)->header; /* type check */ \ | 109 | (void)(mvar)->header; /* type check */ \ |
110 | _ev; \ | 110 | _ev; \ |
111 | }) | 111 | }) |
112 | 112 | ||
@@ -120,8 +120,8 @@ | |||
120 | * or NULL if the given message in @a var does not have any space after the message struct | 120 | * or NULL if the given message in @a var does not have any space after the message struct |
121 | */ | 121 | */ |
122 | #define GNUNET_MQ_extract_nested_mh(var) \ | 122 | #define GNUNET_MQ_extract_nested_mh(var) \ |
123 | GNUNET_MQ_extract_nested_mh_ ((struct GNUNET_MessageHeader *) (var), \ | 123 | GNUNET_MQ_extract_nested_mh_((struct GNUNET_MessageHeader *)(var), \ |
124 | sizeof (*(var))) | 124 | sizeof(*(var))) |
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
@@ -133,8 +133,8 @@ | |||
133 | * OR NULL in case of a malformed message. | 133 | * OR NULL in case of a malformed message. |
134 | */ | 134 | */ |
135 | const struct GNUNET_MessageHeader * | 135 | const struct GNUNET_MessageHeader * |
136 | GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh, | 136 | GNUNET_MQ_extract_nested_mh_(const struct GNUNET_MessageHeader *mh, |
137 | uint16_t base_size); | 137 | uint16_t base_size); |
138 | 138 | ||
139 | 139 | ||
140 | /** | 140 | /** |
@@ -150,7 +150,7 @@ struct GNUNET_MQ_Envelope; | |||
150 | * @return message contained in the envelope | 150 | * @return message contained in the envelope |
151 | */ | 151 | */ |
152 | const struct GNUNET_MessageHeader * | 152 | const struct GNUNET_MessageHeader * |
153 | GNUNET_MQ_env_get_msg (const struct GNUNET_MQ_Envelope *env); | 153 | GNUNET_MQ_env_get_msg(const struct GNUNET_MQ_Envelope *env); |
154 | 154 | ||
155 | 155 | ||
156 | /** | 156 | /** |
@@ -160,7 +160,7 @@ GNUNET_MQ_env_get_msg (const struct GNUNET_MQ_Envelope *env); | |||
160 | * @return next one, or NULL | 160 | * @return next one, or NULL |
161 | */ | 161 | */ |
162 | const struct GNUNET_MQ_Envelope * | 162 | const struct GNUNET_MQ_Envelope * |
163 | GNUNET_MQ_env_next (const struct GNUNET_MQ_Envelope *env); | 163 | GNUNET_MQ_env_next(const struct GNUNET_MQ_Envelope *env); |
164 | 164 | ||
165 | 165 | ||
166 | /** | 166 | /** |
@@ -173,10 +173,10 @@ GNUNET_MQ_env_next (const struct GNUNET_MQ_Envelope *env); | |||
173 | * @param nested_mh the message to append to the message after base_size | 173 | * @param nested_mh the message to append to the message after base_size |
174 | */ | 174 | */ |
175 | struct GNUNET_MQ_Envelope * | 175 | struct GNUNET_MQ_Envelope * |
176 | GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, | 176 | GNUNET_MQ_msg_nested_mh_(struct GNUNET_MessageHeader **mhp, |
177 | uint16_t base_size, | 177 | uint16_t base_size, |
178 | uint16_t type, | 178 | uint16_t type, |
179 | const struct GNUNET_MessageHeader *nested_mh); | 179 | const struct GNUNET_MessageHeader *nested_mh); |
180 | 180 | ||
181 | 181 | ||
182 | /** | 182 | /** |
@@ -188,8 +188,7 @@ struct GNUNET_MQ_Handle; | |||
188 | /** | 188 | /** |
189 | * Error codes for the queue. | 189 | * Error codes for the queue. |
190 | */ | 190 | */ |
191 | enum GNUNET_MQ_Error | 191 | enum GNUNET_MQ_Error { |
192 | { | ||
193 | /** | 192 | /** |
194 | * Failed to read message from the network. | 193 | * Failed to read message from the network. |
195 | * FIXME: Likely not properly distinguished | 194 | * FIXME: Likely not properly distinguished |
@@ -224,9 +223,7 @@ enum GNUNET_MQ_Error | |||
224 | /** | 223 | /** |
225 | * Per envelope preferences and priorities. | 224 | * Per envelope preferences and priorities. |
226 | */ | 225 | */ |
227 | enum GNUNET_MQ_PriorityPreferences | 226 | enum GNUNET_MQ_PriorityPreferences { |
228 | { | ||
229 | |||
230 | /** | 227 | /** |
231 | * Lowest priority, i.e. background traffic (i.e. NSE, FS). | 228 | * Lowest priority, i.e. background traffic (i.e. NSE, FS). |
232 | * This is the default! | 229 | * This is the default! |
@@ -297,7 +294,6 @@ enum GNUNET_MQ_PriorityPreferences | |||
297 | * Flag to indicate that out-of-order delivery is OK. | 294 | * Flag to indicate that out-of-order delivery is OK. |
298 | */ | 295 | */ |
299 | GNUNET_MQ_PREF_OUT_OF_ORDER = 256, | 296 | GNUNET_MQ_PREF_OUT_OF_ORDER = 256, |
300 | |||
301 | }; | 297 | }; |
302 | 298 | ||
303 | 299 | ||
@@ -386,9 +382,9 @@ typedef void (*GNUNET_MQ_ErrorHandler) (void *cls, enum GNUNET_MQ_Error error); | |||
386 | * @param[in|out] env element to insert at the tail | 382 | * @param[in|out] env element to insert at the tail |
387 | */ | 383 | */ |
388 | void | 384 | void |
389 | GNUNET_MQ_dll_insert_head (struct GNUNET_MQ_Envelope **env_head, | 385 | GNUNET_MQ_dll_insert_head(struct GNUNET_MQ_Envelope **env_head, |
390 | struct GNUNET_MQ_Envelope **env_tail, | 386 | struct GNUNET_MQ_Envelope **env_tail, |
391 | struct GNUNET_MQ_Envelope *env); | 387 | struct GNUNET_MQ_Envelope *env); |
392 | 388 | ||
393 | 389 | ||
394 | /** | 390 | /** |
@@ -404,9 +400,9 @@ GNUNET_MQ_dll_insert_head (struct GNUNET_MQ_Envelope **env_head, | |||
404 | * @param[in|out] env element to insert at the tail | 400 | * @param[in|out] env element to insert at the tail |
405 | */ | 401 | */ |
406 | void | 402 | void |
407 | GNUNET_MQ_dll_insert_tail (struct GNUNET_MQ_Envelope **env_head, | 403 | GNUNET_MQ_dll_insert_tail(struct GNUNET_MQ_Envelope **env_head, |
408 | struct GNUNET_MQ_Envelope **env_tail, | 404 | struct GNUNET_MQ_Envelope **env_tail, |
409 | struct GNUNET_MQ_Envelope *env); | 405 | struct GNUNET_MQ_Envelope *env); |
410 | 406 | ||
411 | 407 | ||
412 | /** | 408 | /** |
@@ -422,9 +418,9 @@ GNUNET_MQ_dll_insert_tail (struct GNUNET_MQ_Envelope **env_head, | |||
422 | * @param[in|out] env element to remove from the DLL | 418 | * @param[in|out] env element to remove from the DLL |
423 | */ | 419 | */ |
424 | void | 420 | void |
425 | GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head, | 421 | GNUNET_MQ_dll_remove(struct GNUNET_MQ_Envelope **env_head, |
426 | struct GNUNET_MQ_Envelope **env_tail, | 422 | struct GNUNET_MQ_Envelope **env_tail, |
427 | struct GNUNET_MQ_Envelope *env); | 423 | struct GNUNET_MQ_Envelope *env); |
428 | 424 | ||
429 | 425 | ||
430 | /** | 426 | /** |
@@ -438,7 +434,7 @@ GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head, | |||
438 | * Needs to be freed with #GNUNET_free. | 434 | * Needs to be freed with #GNUNET_free. |
439 | */ | 435 | */ |
440 | struct GNUNET_MQ_MessageHandler * | 436 | struct GNUNET_MQ_MessageHandler * |
441 | GNUNET_MQ_copy_handlers (const struct GNUNET_MQ_MessageHandler *handlers); | 437 | GNUNET_MQ_copy_handlers(const struct GNUNET_MQ_MessageHandler *handlers); |
442 | 438 | ||
443 | 439 | ||
444 | /** | 440 | /** |
@@ -454,9 +450,9 @@ GNUNET_MQ_copy_handlers (const struct GNUNET_MQ_MessageHandler *handlers); | |||
454 | * Needs to be freed with #GNUNET_free. | 450 | * Needs to be freed with #GNUNET_free. |
455 | */ | 451 | */ |
456 | struct GNUNET_MQ_MessageHandler * | 452 | struct GNUNET_MQ_MessageHandler * |
457 | GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers, | 453 | GNUNET_MQ_copy_handlers2(const struct GNUNET_MQ_MessageHandler *handlers, |
458 | GNUNET_MQ_MessageCallback agpl_handler, | 454 | GNUNET_MQ_MessageCallback agpl_handler, |
459 | void *agpl_cls); | 455 | void *agpl_cls); |
460 | 456 | ||
461 | 457 | ||
462 | /** | 458 | /** |
@@ -466,14 +462,13 @@ GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers, | |||
466 | * @return The number of handlers in the array. | 462 | * @return The number of handlers in the array. |
467 | */ | 463 | */ |
468 | unsigned int | 464 | unsigned int |
469 | GNUNET_MQ_count_handlers (const struct GNUNET_MQ_MessageHandler *handlers); | 465 | GNUNET_MQ_count_handlers(const struct GNUNET_MQ_MessageHandler *handlers); |
470 | 466 | ||
471 | 467 | ||
472 | /** | 468 | /** |
473 | * Message handler for a specific message type. | 469 | * Message handler for a specific message type. |
474 | */ | 470 | */ |
475 | struct GNUNET_MQ_MessageHandler | 471 | struct GNUNET_MQ_MessageHandler { |
476 | { | ||
477 | /** | 472 | /** |
478 | * Callback to validate a message of the specified @e type. | 473 | * Callback to validate a message of the specified @e type. |
479 | * The closure given to @e mv will be this struct (not @e ctx). | 474 | * The closure given to @e mv will be this struct (not @e ctx). |
@@ -549,12 +544,12 @@ struct GNUNET_MQ_MessageHandler | |||
549 | */ | 544 | */ |
550 | #define GNUNET_MQ_hd_fixed_size(name, code, str, ctx) \ | 545 | #define GNUNET_MQ_hd_fixed_size(name, code, str, ctx) \ |
551 | ({ \ | 546 | ({ \ |
552 | void (*_cb) (void *cls, const str *msg) = &handle_##name; \ | 547 | void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ |
553 | ((struct GNUNET_MQ_MessageHandler){NULL, \ | 548 | ((struct GNUNET_MQ_MessageHandler){ NULL, \ |
554 | (GNUNET_MQ_MessageCallback) _cb, \ | 549 | (GNUNET_MQ_MessageCallback)_cb, \ |
555 | (ctx), \ | 550 | (ctx), \ |
556 | (code), \ | 551 | (code), \ |
557 | sizeof (str)}); \ | 552 | sizeof(str) }); \ |
558 | }) | 553 | }) |
559 | 554 | ||
560 | 555 | ||
@@ -600,14 +595,14 @@ struct GNUNET_MQ_MessageHandler | |||
600 | */ | 595 | */ |
601 | #define GNUNET_MQ_hd_var_size(name, code, str, ctx) \ | 596 | #define GNUNET_MQ_hd_var_size(name, code, str, ctx) \ |
602 | __extension__({ \ | 597 | __extension__({ \ |
603 | int (*_mv) (void *cls, const str *msg) = &check_##name; \ | 598 | int (*_mv)(void *cls, const str *msg) = &check_ ## name; \ |
604 | void (*_cb) (void *cls, const str *msg) = &handle_##name; \ | 599 | void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ |
605 | ((struct GNUNET_MQ_MessageHandler){(GNUNET_MQ_MessageValidationCallback) \ | 600 | ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \ |
606 | _mv, \ | 601 | _mv, \ |
607 | (GNUNET_MQ_MessageCallback) _cb, \ | 602 | (GNUNET_MQ_MessageCallback)_cb, \ |
608 | (ctx), \ | 603 | (ctx), \ |
609 | (code), \ | 604 | (code), \ |
610 | sizeof (str)}); \ | 605 | sizeof(str) }); \ |
611 | }) | 606 | }) |
612 | 607 | ||
613 | 608 | ||
@@ -623,15 +618,15 @@ struct GNUNET_MQ_MessageHandler | |||
623 | */ | 618 | */ |
624 | #define GNUNET_MQ_check_zero_termination(m) \ | 619 | #define GNUNET_MQ_check_zero_termination(m) \ |
625 | { \ | 620 | { \ |
626 | const char *str = (const char *) &m[1]; \ | 621 | const char *str = (const char *)&m[1]; \ |
627 | const struct GNUNET_MessageHeader *hdr = \ | 622 | const struct GNUNET_MessageHeader *hdr = \ |
628 | (const struct GNUNET_MessageHeader *) m; \ | 623 | (const struct GNUNET_MessageHeader *)m; \ |
629 | uint16_t slen = ntohs (hdr->size) - sizeof (*m); \ | 624 | uint16_t slen = ntohs(hdr->size) - sizeof(*m); \ |
630 | if ((0 == slen) || (memchr (str, 0, slen) != &str[slen - 1])) \ | 625 | if ((0 == slen) || (memchr(str, 0, slen) != &str[slen - 1])) \ |
631 | { \ | 626 | { \ |
632 | GNUNET_break (0); \ | 627 | GNUNET_break(0); \ |
633 | return GNUNET_NO; \ | 628 | return GNUNET_NO; \ |
634 | } \ | 629 | } \ |
635 | } | 630 | } |
636 | 631 | ||
637 | 632 | ||
@@ -650,16 +645,16 @@ struct GNUNET_MQ_MessageHandler | |||
650 | #define GNUNET_MQ_check_boxed_message(m) \ | 645 | #define GNUNET_MQ_check_boxed_message(m) \ |
651 | { \ | 646 | { \ |
652 | const struct GNUNET_MessageHeader *inbox = \ | 647 | const struct GNUNET_MessageHeader *inbox = \ |
653 | (const struct GNUNET_MessageHeader *) &m[1]; \ | 648 | (const struct GNUNET_MessageHeader *)&m[1]; \ |
654 | const struct GNUNET_MessageHeader *hdr = \ | 649 | const struct GNUNET_MessageHeader *hdr = \ |
655 | (const struct GNUNET_MessageHeader *) m; \ | 650 | (const struct GNUNET_MessageHeader *)m; \ |
656 | uint16_t slen = ntohs (hdr->size) - sizeof (*m); \ | 651 | uint16_t slen = ntohs(hdr->size) - sizeof(*m); \ |
657 | if ((slen < sizeof (struct GNUNET_MessageHeader)) || \ | 652 | if ((slen < sizeof(struct GNUNET_MessageHeader)) || \ |
658 | (slen != ntohs (inbox->size))) \ | 653 | (slen != ntohs(inbox->size))) \ |
659 | { \ | 654 | { \ |
660 | GNUNET_break (0); \ | 655 | GNUNET_break(0); \ |
661 | return GNUNET_NO; \ | 656 | return GNUNET_NO; \ |
662 | } \ | 657 | } \ |
663 | } | 658 | } |
664 | 659 | ||
665 | 660 | ||
@@ -676,8 +671,8 @@ struct GNUNET_MQ_MessageHandler | |||
676 | * #GNUNET_SYSERR if message was rejected by check function | 671 | * #GNUNET_SYSERR if message was rejected by check function |
677 | */ | 672 | */ |
678 | int | 673 | int |
679 | GNUNET_MQ_handle_message (const struct GNUNET_MQ_MessageHandler *handlers, | 674 | GNUNET_MQ_handle_message(const struct GNUNET_MQ_MessageHandler *handlers, |
680 | const struct GNUNET_MessageHeader *mh); | 675 | const struct GNUNET_MessageHeader *mh); |
681 | 676 | ||
682 | 677 | ||
683 | /** | 678 | /** |
@@ -689,9 +684,9 @@ GNUNET_MQ_handle_message (const struct GNUNET_MQ_MessageHandler *handlers, | |||
689 | * @return the allocated MQ message | 684 | * @return the allocated MQ message |
690 | */ | 685 | */ |
691 | struct GNUNET_MQ_Envelope * | 686 | struct GNUNET_MQ_Envelope * |
692 | GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, | 687 | GNUNET_MQ_msg_(struct GNUNET_MessageHeader **mhp, |
693 | uint16_t size, | 688 | uint16_t size, |
694 | uint16_t type); | 689 | uint16_t type); |
695 | 690 | ||
696 | 691 | ||
697 | /** | 692 | /** |
@@ -701,7 +696,7 @@ GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, | |||
701 | * @return envelope containing @a hdr | 696 | * @return envelope containing @a hdr |
702 | */ | 697 | */ |
703 | struct GNUNET_MQ_Envelope * | 698 | struct GNUNET_MQ_Envelope * |
704 | GNUNET_MQ_msg_copy (const struct GNUNET_MessageHeader *hdr); | 699 | GNUNET_MQ_msg_copy(const struct GNUNET_MessageHeader *hdr); |
705 | 700 | ||
706 | 701 | ||
707 | /** | 702 | /** |
@@ -712,7 +707,7 @@ GNUNET_MQ_msg_copy (const struct GNUNET_MessageHeader *hdr); | |||
712 | * @param mqm the message to discard | 707 | * @param mqm the message to discard |
713 | */ | 708 | */ |
714 | void | 709 | void |
715 | GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm); | 710 | GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm); |
716 | 711 | ||
717 | 712 | ||
718 | /** | 713 | /** |
@@ -723,7 +718,7 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm); | |||
723 | * @return the current envelope | 718 | * @return the current envelope |
724 | */ | 719 | */ |
725 | struct GNUNET_MQ_Envelope * | 720 | struct GNUNET_MQ_Envelope * |
726 | GNUNET_MQ_get_current_envelope (struct GNUNET_MQ_Handle *mq); | 721 | GNUNET_MQ_get_current_envelope(struct GNUNET_MQ_Handle *mq); |
727 | 722 | ||
728 | 723 | ||
729 | /** | 724 | /** |
@@ -734,7 +729,7 @@ GNUNET_MQ_get_current_envelope (struct GNUNET_MQ_Handle *mq); | |||
734 | * @return copy of @a env | 729 | * @return copy of @a env |
735 | */ | 730 | */ |
736 | struct GNUNET_MQ_Envelope * | 731 | struct GNUNET_MQ_Envelope * |
737 | GNUNET_MQ_env_copy (struct GNUNET_MQ_Envelope *env); | 732 | GNUNET_MQ_env_copy(struct GNUNET_MQ_Envelope *env); |
738 | 733 | ||
739 | 734 | ||
740 | /** | 735 | /** |
@@ -744,7 +739,7 @@ GNUNET_MQ_env_copy (struct GNUNET_MQ_Envelope *env); | |||
744 | * @return the last envelope in the queue | 739 | * @return the last envelope in the queue |
745 | */ | 740 | */ |
746 | struct GNUNET_MQ_Envelope * | 741 | struct GNUNET_MQ_Envelope * |
747 | GNUNET_MQ_get_last_envelope (struct GNUNET_MQ_Handle *mq); | 742 | GNUNET_MQ_get_last_envelope(struct GNUNET_MQ_Handle *mq); |
748 | 743 | ||
749 | 744 | ||
750 | /** | 745 | /** |
@@ -756,8 +751,8 @@ GNUNET_MQ_get_last_envelope (struct GNUNET_MQ_Handle *mq); | |||
756 | * @param pp priority and preferences to set for @a env | 751 | * @param pp priority and preferences to set for @a env |
757 | */ | 752 | */ |
758 | void | 753 | void |
759 | GNUNET_MQ_env_set_options (struct GNUNET_MQ_Envelope *env, | 754 | GNUNET_MQ_env_set_options(struct GNUNET_MQ_Envelope *env, |
760 | enum GNUNET_MQ_PriorityPreferences pp); | 755 | enum GNUNET_MQ_PriorityPreferences pp); |
761 | 756 | ||
762 | 757 | ||
763 | /** | 758 | /** |
@@ -767,7 +762,7 @@ GNUNET_MQ_env_set_options (struct GNUNET_MQ_Envelope *env, | |||
767 | * @return priority and preferences to use | 762 | * @return priority and preferences to use |
768 | */ | 763 | */ |
769 | enum GNUNET_MQ_PriorityPreferences | 764 | enum GNUNET_MQ_PriorityPreferences |
770 | GNUNET_MQ_env_get_options (struct GNUNET_MQ_Envelope *env); | 765 | GNUNET_MQ_env_get_options(struct GNUNET_MQ_Envelope *env); |
771 | 766 | ||
772 | 767 | ||
773 | /** | 768 | /** |
@@ -779,8 +774,8 @@ GNUNET_MQ_env_get_options (struct GNUNET_MQ_Envelope *env); | |||
779 | * @return combined priority and preferences to use | 774 | * @return combined priority and preferences to use |
780 | */ | 775 | */ |
781 | enum GNUNET_MQ_PriorityPreferences | 776 | enum GNUNET_MQ_PriorityPreferences |
782 | GNUNET_MQ_env_combine_options (enum GNUNET_MQ_PriorityPreferences p1, | 777 | GNUNET_MQ_env_combine_options(enum GNUNET_MQ_PriorityPreferences p1, |
783 | enum GNUNET_MQ_PriorityPreferences p2); | 778 | enum GNUNET_MQ_PriorityPreferences p2); |
784 | 779 | ||
785 | 780 | ||
786 | /** | 781 | /** |
@@ -791,7 +786,7 @@ GNUNET_MQ_env_combine_options (enum GNUNET_MQ_PriorityPreferences p1, | |||
791 | * @return NULL if queue is empty (or has no envelope that is not under transmission) | 786 | * @return NULL if queue is empty (or has no envelope that is not under transmission) |
792 | */ | 787 | */ |
793 | struct GNUNET_MQ_Envelope * | 788 | struct GNUNET_MQ_Envelope * |
794 | GNUNET_MQ_unsent_head (struct GNUNET_MQ_Handle *mq); | 789 | GNUNET_MQ_unsent_head(struct GNUNET_MQ_Handle *mq); |
795 | 790 | ||
796 | 791 | ||
797 | /** | 792 | /** |
@@ -801,8 +796,8 @@ GNUNET_MQ_unsent_head (struct GNUNET_MQ_Handle *mq); | |||
801 | * @param pp priority and preferences to use by default | 796 | * @param pp priority and preferences to use by default |
802 | */ | 797 | */ |
803 | void | 798 | void |
804 | GNUNET_MQ_set_options (struct GNUNET_MQ_Handle *mq, | 799 | GNUNET_MQ_set_options(struct GNUNET_MQ_Handle *mq, |
805 | enum GNUNET_MQ_PriorityPreferences pp); | 800 | enum GNUNET_MQ_PriorityPreferences pp); |
806 | 801 | ||
807 | 802 | ||
808 | /** | 803 | /** |
@@ -812,7 +807,7 @@ GNUNET_MQ_set_options (struct GNUNET_MQ_Handle *mq, | |||
812 | * @return number of queued, non-transmitted messages | 807 | * @return number of queued, non-transmitted messages |
813 | */ | 808 | */ |
814 | unsigned int | 809 | unsigned int |
815 | GNUNET_MQ_get_length (struct GNUNET_MQ_Handle *mq); | 810 | GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq); |
816 | 811 | ||
817 | 812 | ||
818 | /** | 813 | /** |
@@ -823,7 +818,7 @@ GNUNET_MQ_get_length (struct GNUNET_MQ_Handle *mq); | |||
823 | * @param ev the envelope with the message to send. | 818 | * @param ev the envelope with the message to send. |
824 | */ | 819 | */ |
825 | void | 820 | void |
826 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); | 821 | GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); |
827 | 822 | ||
828 | 823 | ||
829 | /** | 824 | /** |
@@ -834,8 +829,8 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); | |||
834 | * @param ev the envelope with the message to send. | 829 | * @param ev the envelope with the message to send. |
835 | */ | 830 | */ |
836 | void | 831 | void |
837 | GNUNET_MQ_send_copy (struct GNUNET_MQ_Handle *mq, | 832 | GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, |
838 | const struct GNUNET_MQ_Envelope *ev); | 833 | const struct GNUNET_MQ_Envelope *ev); |
839 | 834 | ||
840 | 835 | ||
841 | /** | 836 | /** |
@@ -846,7 +841,7 @@ GNUNET_MQ_send_copy (struct GNUNET_MQ_Handle *mq, | |||
846 | * @param ev queued envelope to cancel | 841 | * @param ev queued envelope to cancel |
847 | */ | 842 | */ |
848 | void | 843 | void |
849 | GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev); | 844 | GNUNET_MQ_send_cancel(struct GNUNET_MQ_Envelope *ev); |
850 | 845 | ||
851 | 846 | ||
852 | /** | 847 | /** |
@@ -856,7 +851,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev); | |||
856 | * @param assoc_data to associate | 851 | * @param assoc_data to associate |
857 | */ | 852 | */ |
858 | uint32_t | 853 | uint32_t |
859 | GNUNET_MQ_assoc_add (struct GNUNET_MQ_Handle *mq, void *assoc_data); | 854 | GNUNET_MQ_assoc_add(struct GNUNET_MQ_Handle *mq, void *assoc_data); |
860 | 855 | ||
861 | 856 | ||
862 | /** | 857 | /** |
@@ -867,7 +862,7 @@ GNUNET_MQ_assoc_add (struct GNUNET_MQ_Handle *mq, void *assoc_data); | |||
867 | * @return the associated data | 862 | * @return the associated data |
868 | */ | 863 | */ |
869 | void * | 864 | void * |
870 | GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq, uint32_t request_id); | 865 | GNUNET_MQ_assoc_get(struct GNUNET_MQ_Handle *mq, uint32_t request_id); |
871 | 866 | ||
872 | 867 | ||
873 | /** | 868 | /** |
@@ -878,7 +873,7 @@ GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq, uint32_t request_id); | |||
878 | * @return the associated data | 873 | * @return the associated data |
879 | */ | 874 | */ |
880 | void * | 875 | void * |
881 | GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, uint32_t request_id); | 876 | GNUNET_MQ_assoc_remove(struct GNUNET_MQ_Handle *mq, uint32_t request_id); |
882 | 877 | ||
883 | 878 | ||
884 | /** | 879 | /** |
@@ -894,13 +889,13 @@ GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, uint32_t request_id); | |||
894 | * @return a new message queue | 889 | * @return a new message queue |
895 | */ | 890 | */ |
896 | struct GNUNET_MQ_Handle * | 891 | struct GNUNET_MQ_Handle * |
897 | GNUNET_MQ_queue_for_callbacks (GNUNET_MQ_SendImpl send, | 892 | GNUNET_MQ_queue_for_callbacks(GNUNET_MQ_SendImpl send, |
898 | GNUNET_MQ_DestroyImpl destroy, | 893 | GNUNET_MQ_DestroyImpl destroy, |
899 | GNUNET_MQ_CancelImpl cancel, | 894 | GNUNET_MQ_CancelImpl cancel, |
900 | void *impl_state, | 895 | void *impl_state, |
901 | const struct GNUNET_MQ_MessageHandler *handlers, | 896 | const struct GNUNET_MQ_MessageHandler *handlers, |
902 | GNUNET_MQ_ErrorHandler error_handler, | 897 | GNUNET_MQ_ErrorHandler error_handler, |
903 | void *cls); | 898 | void *cls); |
904 | 899 | ||
905 | 900 | ||
906 | /** | 901 | /** |
@@ -911,8 +906,8 @@ GNUNET_MQ_queue_for_callbacks (GNUNET_MQ_SendImpl send, | |||
911 | * @param handlers_cls new closure to use | 906 | * @param handlers_cls new closure to use |
912 | */ | 907 | */ |
913 | void | 908 | void |
914 | GNUNET_MQ_set_handlers_closure (struct GNUNET_MQ_Handle *mq, | 909 | GNUNET_MQ_set_handlers_closure(struct GNUNET_MQ_Handle *mq, |
915 | void *handlers_cls); | 910 | void *handlers_cls); |
916 | 911 | ||
917 | 912 | ||
918 | /** | 913 | /** |
@@ -925,9 +920,9 @@ GNUNET_MQ_set_handlers_closure (struct GNUNET_MQ_Handle *mq, | |||
925 | * @param cb_cls closure for the callback | 920 | * @param cb_cls closure for the callback |
926 | */ | 921 | */ |
927 | void | 922 | void |
928 | GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev, | 923 | GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, |
929 | GNUNET_SCHEDULER_TaskCallback cb, | 924 | GNUNET_SCHEDULER_TaskCallback cb, |
930 | void *cb_cls); | 925 | void *cb_cls); |
931 | 926 | ||
932 | 927 | ||
933 | /** | 928 | /** |
@@ -936,7 +931,7 @@ GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev, | |||
936 | * @param mq message queue to destroy | 931 | * @param mq message queue to destroy |
937 | */ | 932 | */ |
938 | void | 933 | void |
939 | GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq); | 934 | GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq); |
940 | 935 | ||
941 | 936 | ||
942 | /** | 937 | /** |
@@ -956,9 +951,9 @@ struct GNUNET_MQ_DestroyNotificationHandle; | |||
956 | * @return handle for #GNUNET_MQ_destroy_notify_cancel(). | 951 | * @return handle for #GNUNET_MQ_destroy_notify_cancel(). |
957 | */ | 952 | */ |
958 | struct GNUNET_MQ_DestroyNotificationHandle * | 953 | struct GNUNET_MQ_DestroyNotificationHandle * |
959 | GNUNET_MQ_destroy_notify (struct GNUNET_MQ_Handle *mq, | 954 | GNUNET_MQ_destroy_notify(struct GNUNET_MQ_Handle *mq, |
960 | GNUNET_SCHEDULER_TaskCallback cb, | 955 | GNUNET_SCHEDULER_TaskCallback cb, |
961 | void *cb_cls); | 956 | void *cb_cls); |
962 | 957 | ||
963 | /** | 958 | /** |
964 | * Cancel registration from #GNUNET_MQ_destroy_notify(). | 959 | * Cancel registration from #GNUNET_MQ_destroy_notify(). |
@@ -966,7 +961,7 @@ GNUNET_MQ_destroy_notify (struct GNUNET_MQ_Handle *mq, | |||
966 | * @param dnh handle for registration to cancel | 961 | * @param dnh handle for registration to cancel |
967 | */ | 962 | */ |
968 | void | 963 | void |
969 | GNUNET_MQ_destroy_notify_cancel ( | 964 | GNUNET_MQ_destroy_notify_cancel( |
970 | struct GNUNET_MQ_DestroyNotificationHandle *dnh); | 965 | struct GNUNET_MQ_DestroyNotificationHandle *dnh); |
971 | 966 | ||
972 | 967 | ||
@@ -981,8 +976,8 @@ GNUNET_MQ_destroy_notify_cancel ( | |||
981 | * @param mh message to dispatch | 976 | * @param mh message to dispatch |
982 | */ | 977 | */ |
983 | void | 978 | void |
984 | GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, | 979 | GNUNET_MQ_inject_message(struct GNUNET_MQ_Handle *mq, |
985 | const struct GNUNET_MessageHeader *mh); | 980 | const struct GNUNET_MessageHeader *mh); |
986 | 981 | ||
987 | 982 | ||
988 | /** | 983 | /** |
@@ -996,8 +991,8 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, | |||
996 | * @param error the error type | 991 | * @param error the error type |
997 | */ | 992 | */ |
998 | void | 993 | void |
999 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, | 994 | GNUNET_MQ_inject_error(struct GNUNET_MQ_Handle *mq, |
1000 | enum GNUNET_MQ_Error error); | 995 | enum GNUNET_MQ_Error error); |
1001 | 996 | ||
1002 | 997 | ||
1003 | /** | 998 | /** |
@@ -1011,7 +1006,7 @@ GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, | |||
1011 | * @param mq message queue to send the next message with | 1006 | * @param mq message queue to send the next message with |
1012 | */ | 1007 | */ |
1013 | void | 1008 | void |
1014 | GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq); | 1009 | GNUNET_MQ_impl_send_continue(struct GNUNET_MQ_Handle *mq); |
1015 | 1010 | ||
1016 | 1011 | ||
1017 | /** | 1012 | /** |
@@ -1025,7 +1020,7 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq); | |||
1025 | * @param mq message queue to send the next message with | 1020 | * @param mq message queue to send the next message with |
1026 | */ | 1021 | */ |
1027 | void | 1022 | void |
1028 | GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq); | 1023 | GNUNET_MQ_impl_send_in_flight(struct GNUNET_MQ_Handle *mq); |
1029 | 1024 | ||
1030 | 1025 | ||
1031 | /** | 1026 | /** |
@@ -1043,7 +1038,7 @@ GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq); | |||
1043 | * @return message to send, never NULL | 1038 | * @return message to send, never NULL |
1044 | */ | 1039 | */ |
1045 | void * | 1040 | void * |
1046 | GNUNET_MQ_impl_state (struct GNUNET_MQ_Handle *mq); | 1041 | GNUNET_MQ_impl_state(struct GNUNET_MQ_Handle *mq); |
1047 | 1042 | ||
1048 | 1043 | ||
1049 | /** | 1044 | /** |
@@ -1056,7 +1051,7 @@ GNUNET_MQ_impl_state (struct GNUNET_MQ_Handle *mq); | |||
1056 | * @return message to send, never NULL | 1051 | * @return message to send, never NULL |
1057 | */ | 1052 | */ |
1058 | const struct GNUNET_MessageHeader * | 1053 | const struct GNUNET_MessageHeader * |
1059 | GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq); | 1054 | GNUNET_MQ_impl_current(struct GNUNET_MQ_Handle *mq); |
1060 | 1055 | ||
1061 | 1056 | ||
1062 | /** | 1057 | /** |
@@ -1064,9 +1059,7 @@ GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq); | |||
1064 | * | 1059 | * |
1065 | * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` | 1060 | * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` |
1066 | */ | 1061 | */ |
1067 | enum GNUNET_MQ_PreferenceKind | 1062 | enum GNUNET_MQ_PreferenceKind { |
1068 | { | ||
1069 | |||
1070 | /** | 1063 | /** |
1071 | * No preference was expressed. | 1064 | * No preference was expressed. |
1072 | */ | 1065 | */ |
@@ -1091,10 +1084,9 @@ enum GNUNET_MQ_PreferenceKind | |||
1091 | GNUNET_MQ_PREFERENCE_RELIABILITY = 3 | 1084 | GNUNET_MQ_PREFERENCE_RELIABILITY = 3 |
1092 | 1085 | ||
1093 | /** | 1086 | /** |
1094 | * Number of preference values allowed. | 1087 | * Number of preference values allowed. |
1095 | */ | 1088 | */ |
1096 | #define GNUNET_MQ_PREFERENCE_COUNT 4 | 1089 | #define GNUNET_MQ_PREFERENCE_COUNT 4 |
1097 | |||
1098 | }; | 1090 | }; |
1099 | 1091 | ||
1100 | 1092 | ||
@@ -1107,7 +1099,7 @@ enum GNUNET_MQ_PreferenceKind | |||
1107 | * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` | 1099 | * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` |
1108 | */ | 1100 | */ |
1109 | const char * | 1101 | const char * |
1110 | GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type); | 1102 | GNUNET_MQ_preference_to_string(enum GNUNET_MQ_PreferenceKind type); |
1111 | 1103 | ||
1112 | 1104 | ||
1113 | #endif | 1105 | #endif |
diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h index b048f94bc..2956ac24f 100644 --- a/src/include/gnunet_mst_lib.h +++ b/src/include/gnunet_mst_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -78,8 +78,8 @@ typedef int | |||
78 | * @return handle to tokenizer | 78 | * @return handle to tokenizer |
79 | */ | 79 | */ |
80 | struct GNUNET_MessageStreamTokenizer * | 80 | struct GNUNET_MessageStreamTokenizer * |
81 | GNUNET_MST_create (GNUNET_MessageTokenizerCallback cb, | 81 | GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb, |
82 | void *cb_cls); | 82 | void *cb_cls); |
83 | 83 | ||
84 | 84 | ||
85 | /** | 85 | /** |
@@ -97,11 +97,11 @@ GNUNET_MST_create (GNUNET_MessageTokenizerCallback cb, | |||
97 | * #GNUNET_SYSERR if the data stream is corrupt | 97 | * #GNUNET_SYSERR if the data stream is corrupt |
98 | */ | 98 | */ |
99 | int | 99 | int |
100 | GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, | 100 | GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst, |
101 | const char *buf, | 101 | const char *buf, |
102 | size_t size, | 102 | size_t size, |
103 | int purge, | 103 | int purge, |
104 | int one_shot); | 104 | int one_shot); |
105 | 105 | ||
106 | 106 | ||
107 | /** | 107 | /** |
@@ -119,10 +119,10 @@ GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, | |||
119 | * #GNUNET_SYSERR if the data stream is corrupt | 119 | * #GNUNET_SYSERR if the data stream is corrupt |
120 | */ | 120 | */ |
121 | int | 121 | int |
122 | GNUNET_MST_read (struct GNUNET_MessageStreamTokenizer *mst, | 122 | GNUNET_MST_read(struct GNUNET_MessageStreamTokenizer *mst, |
123 | struct GNUNET_NETWORK_Handle *sock, | 123 | struct GNUNET_NETWORK_Handle *sock, |
124 | int purge, | 124 | int purge, |
125 | int one_shot); | 125 | int one_shot); |
126 | 126 | ||
127 | 127 | ||
128 | /** | 128 | /** |
@@ -137,8 +137,8 @@ GNUNET_MST_read (struct GNUNET_MessageStreamTokenizer *mst, | |||
137 | * #GNUNET_SYSERR if the data stream is corrupt | 137 | * #GNUNET_SYSERR if the data stream is corrupt |
138 | */ | 138 | */ |
139 | int | 139 | int |
140 | GNUNET_MST_next (struct GNUNET_MessageStreamTokenizer *mst, | 140 | GNUNET_MST_next(struct GNUNET_MessageStreamTokenizer *mst, |
141 | int one_shot); | 141 | int one_shot); |
142 | 142 | ||
143 | 143 | ||
144 | /** | 144 | /** |
@@ -147,7 +147,7 @@ GNUNET_MST_next (struct GNUNET_MessageStreamTokenizer *mst, | |||
147 | * @param mst tokenizer to destroy | 147 | * @param mst tokenizer to destroy |
148 | */ | 148 | */ |
149 | void | 149 | void |
150 | GNUNET_MST_destroy (struct GNUNET_MessageStreamTokenizer *mst); | 150 | GNUNET_MST_destroy(struct GNUNET_MessageStreamTokenizer *mst); |
151 | 151 | ||
152 | 152 | ||
153 | #if 0 /* keep Emacsens' auto-indent happy */ | 153 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h index 744a646f0..1805c2795 100644 --- a/src/include/gnunet_my_lib.h +++ b/src/include/gnunet_my_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * @author Christophe Genevey | 22 | * @author Christophe Genevey |
@@ -62,7 +62,7 @@ struct GNUNET_MY_QueryParam; | |||
62 | */ | 62 | */ |
63 | typedef int | 63 | typedef int |
64 | (*GNUNET_MY_QueryConverter)(void *cls, | 64 | (*GNUNET_MY_QueryConverter)(void *cls, |
65 | const struct GNUNET_MY_QueryParam *qp, | 65 | const struct GNUNET_MY_QueryParam *qp, |
66 | MYSQL_BIND *qbind); | 66 | MYSQL_BIND *qbind); |
67 | 67 | ||
68 | 68 | ||
@@ -74,22 +74,20 @@ typedef int | |||
74 | */ | 74 | */ |
75 | typedef void | 75 | typedef void |
76 | (*GNUNET_MY_QueryCleanup)(void *cls, | 76 | (*GNUNET_MY_QueryCleanup)(void *cls, |
77 | MYSQL_BIND *qbind); | 77 | MYSQL_BIND *qbind); |
78 | /** | 78 | /** |
79 | * Information we pass to #GNUNET_MY_exec_prepared() to | 79 | * Information we pass to #GNUNET_MY_exec_prepared() to |
80 | * initialize the arguments of the prepared statement. | 80 | * initialize the arguments of the prepared statement. |
81 | */ | 81 | */ |
82 | 82 | ||
83 | 83 | ||
84 | struct GNUNET_MY_QueryParam | 84 | struct GNUNET_MY_QueryParam { |
85 | { | ||
86 | |||
87 | /** | 85 | /** |
88 | * Function to call for the type conversion. | 86 | * Function to call for the type conversion. |
89 | */ | 87 | */ |
90 | GNUNET_MY_QueryConverter conv; | 88 | GNUNET_MY_QueryConverter conv; |
91 | 89 | ||
92 | /** | 90 | /** |
93 | * Function to call for cleaning up the query. Can be NULL. | 91 | * Function to call for cleaning up the query. Can be NULL. |
94 | */ | 92 | */ |
95 | GNUNET_MY_QueryCleanup cleaner; | 93 | GNUNET_MY_QueryCleanup cleaner; |
@@ -113,7 +111,6 @@ struct GNUNET_MY_QueryParam | |||
113 | * Information to pass to @e conv. Size of @a data. | 111 | * Information to pass to @e conv. Size of @a data. |
114 | */ | 112 | */ |
115 | unsigned long data_len; | 113 | unsigned long data_len; |
116 | |||
117 | }; | 114 | }; |
118 | 115 | ||
119 | /** | 116 | /** |
@@ -132,8 +129,8 @@ struct GNUNET_MY_QueryParam | |||
132 | * @oaran ptr_size number of bytes in @a ptr | 129 | * @oaran ptr_size number of bytes in @a ptr |
133 | */ | 130 | */ |
134 | struct GNUNET_MY_QueryParam | 131 | struct GNUNET_MY_QueryParam |
135 | GNUNET_MY_query_param_fixed_size (const void *ptr, | 132 | GNUNET_MY_query_param_fixed_size(const void *ptr, |
136 | size_t ptr_size); | 133 | size_t ptr_size); |
137 | 134 | ||
138 | 135 | ||
139 | /** | 136 | /** |
@@ -145,9 +142,9 @@ GNUNET_MY_query_param_fixed_size (const void *ptr, | |||
145 | * @return TBD | 142 | * @return TBD |
146 | */ | 143 | */ |
147 | int | 144 | int |
148 | GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc, | 145 | GNUNET_MY_exec_prepared(struct GNUNET_MYSQL_Context *mc, |
149 | struct GNUNET_MYSQL_StatementHandle *sh, | 146 | struct GNUNET_MYSQL_StatementHandle *sh, |
150 | struct GNUNET_MY_QueryParam *params); | 147 | struct GNUNET_MY_QueryParam *params); |
151 | 148 | ||
152 | 149 | ||
153 | /** | 150 | /** |
@@ -194,9 +191,7 @@ typedef void | |||
194 | * Information we pass to #GNUNET_MY_extract_result() to | 191 | * Information we pass to #GNUNET_MY_extract_result() to |
195 | * initialize the arguments of the prepared statement. | 192 | * initialize the arguments of the prepared statement. |
196 | */ | 193 | */ |
197 | struct GNUNET_MY_ResultSpec | 194 | struct GNUNET_MY_ResultSpec { |
198 | { | ||
199 | |||
200 | /** | 195 | /** |
201 | * Function to call to initialize the MYSQL_BIND array. | 196 | * Function to call to initialize the MYSQL_BIND array. |
202 | */ | 197 | */ |
@@ -207,7 +202,7 @@ struct GNUNET_MY_ResultSpec | |||
207 | */ | 202 | */ |
208 | GNUNET_MY_ResultConverter post_conv; | 203 | GNUNET_MY_ResultConverter post_conv; |
209 | 204 | ||
210 | /** | 205 | /** |
211 | * Function to call for cleaning up the result. Can be NULL. | 206 | * Function to call for cleaning up the result. Can be NULL. |
212 | */ | 207 | */ |
213 | GNUNET_MY_ResultCleanup cleaner; | 208 | GNUNET_MY_ResultCleanup cleaner; |
@@ -250,7 +245,6 @@ struct GNUNET_MY_ResultSpec | |||
250 | * Memory for MySQL to notify us about NULL values. | 245 | * Memory for MySQL to notify us about NULL values. |
251 | */ | 246 | */ |
252 | my_bool is_null; | 247 | my_bool is_null; |
253 | |||
254 | }; | 248 | }; |
255 | 249 | ||
256 | 250 | ||
@@ -271,88 +265,88 @@ struct GNUNET_MY_ResultSpec | |||
271 | * @oaran ptr_size number of bytes available at @a ptr | 265 | * @oaran ptr_size number of bytes available at @a ptr |
272 | */ | 266 | */ |
273 | struct GNUNET_MY_ResultSpec | 267 | struct GNUNET_MY_ResultSpec |
274 | GNUNET_MY_result_spec_fixed_size (void *ptr, | 268 | GNUNET_MY_result_spec_fixed_size(void *ptr, |
275 | size_t ptr_size); | 269 | size_t ptr_size); |
276 | 270 | ||
277 | /** | 271 | /** |
278 | * Generate query parameter for a string | 272 | * Generate query parameter for a string |
279 | * | 273 | * |
280 | *@param ptr pointer to the string query parameter to pass | 274 | *@param ptr pointer to the string query parameter to pass |
281 | */ | 275 | */ |
282 | struct GNUNET_MY_QueryParam | 276 | struct GNUNET_MY_QueryParam |
283 | GNUNET_MY_query_param_string (const char *ptr); | 277 | GNUNET_MY_query_param_string(const char *ptr); |
284 | 278 | ||
285 | /** | 279 | /** |
286 | * Generate fixed-size query parameter with size determined | 280 | * Generate fixed-size query parameter with size determined |
287 | * by variable type. | 281 | * by variable type. |
288 | * | 282 | * |
289 | * @param x pointer to the query parameter to pass | 283 | * @param x pointer to the query parameter to pass |
290 | */ | 284 | */ |
291 | #define GNUNET_MY_query_param_auto_from_type(x) GNUNET_MY_query_param_fixed_size ((x), sizeof (*(x))) | 285 | #define GNUNET_MY_query_param_auto_from_type(x) GNUNET_MY_query_param_fixed_size((x), sizeof(*(x))) |
292 | 286 | ||
293 | /** | 287 | /** |
294 | * Generate query parameter for an RSA public key. The | 288 | * Generate query parameter for an RSA public key. The |
295 | * database must contain a BLOB type in the respective position. | 289 | * database must contain a BLOB type in the respective position. |
296 | * | 290 | * |
297 | * @param x the query parameter to pass | 291 | * @param x the query parameter to pass |
298 | * @return array entry for the query parameters to use | 292 | * @return array entry for the query parameters to use |
299 | */ | 293 | */ |
300 | struct GNUNET_MY_QueryParam | 294 | struct GNUNET_MY_QueryParam |
301 | GNUNET_MY_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x); | 295 | GNUNET_MY_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x); |
302 | 296 | ||
303 | /** | 297 | /** |
304 | * Generate query parameter for an RSA signature. The | 298 | * Generate query parameter for an RSA signature. The |
305 | * database must contain a BLOB type in the respective position | 299 | * database must contain a BLOB type in the respective position |
306 | * | 300 | * |
307 | *@param x the query parameter to pass | 301 | *@param x the query parameter to pass |
308 | *@return array entry for the query parameters to use | 302 | *@return array entry for the query parameters to use |
309 | */ | 303 | */ |
310 | struct GNUNET_MY_QueryParam | 304 | struct GNUNET_MY_QueryParam |
311 | GNUNET_MY_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x); | 305 | GNUNET_MY_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); |
312 | 306 | ||
313 | /** | 307 | /** |
314 | * Generate query parameter for an absolute time value. | 308 | * Generate query parameter for an absolute time value. |
315 | * The database must store a 64-bit integer. | 309 | * The database must store a 64-bit integer. |
316 | * | 310 | * |
317 | *@param x pointer to the query parameter to pass | 311 | *@param x pointer to the query parameter to pass |
318 | *@return array entry for the query parameters to use | 312 | *@return array entry for the query parameters to use |
319 | */ | 313 | */ |
320 | struct GNUNET_MY_QueryParam | 314 | struct GNUNET_MY_QueryParam |
321 | GNUNET_MY_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | 315 | GNUNET_MY_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); |
322 | 316 | ||
323 | 317 | ||
324 | /** | 318 | /** |
325 | * Generate query parameter for an absolute time value. | 319 | * Generate query parameter for an absolute time value. |
326 | * The database must store a 64-bit integer. | 320 | * The database must store a 64-bit integer. |
327 | * | 321 | * |
328 | *@param x pointer to the query parameter to pass | 322 | *@param x pointer to the query parameter to pass |
329 | */ | 323 | */ |
330 | struct GNUNET_MY_QueryParam | 324 | struct GNUNET_MY_QueryParam |
331 | GNUNET_MY_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x); | 325 | GNUNET_MY_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x); |
332 | 326 | ||
333 | /** | 327 | /** |
334 | * Generate query parameter for an uint16_t in host byte order. | 328 | * Generate query parameter for an uint16_t in host byte order. |
335 | * | 329 | * |
336 | * @param x pointer to the query parameter to pass | 330 | * @param x pointer to the query parameter to pass |
337 | */ | 331 | */ |
338 | struct GNUNET_MY_QueryParam | 332 | struct GNUNET_MY_QueryParam |
339 | GNUNET_MY_query_param_uint16 (const uint16_t *x); | 333 | GNUNET_MY_query_param_uint16(const uint16_t *x); |
340 | 334 | ||
341 | /** | 335 | /** |
342 | * Generate query parameter for an uint32_t in host byte order | 336 | * Generate query parameter for an uint32_t in host byte order |
343 | * | 337 | * |
344 | *@param x pointer to the query parameter to pass | 338 | *@param x pointer to the query parameter to pass |
345 | */ | 339 | */ |
346 | struct GNUNET_MY_QueryParam | 340 | struct GNUNET_MY_QueryParam |
347 | GNUNET_MY_query_param_uint32 (const uint32_t *x); | 341 | GNUNET_MY_query_param_uint32(const uint32_t *x); |
348 | 342 | ||
349 | /** | 343 | /** |
350 | * Generate query parameter for an uint64_t in host byte order | 344 | * Generate query parameter for an uint64_t in host byte order |
351 | * | 345 | * |
352 | *@param x pointer to the query parameter to pass | 346 | *@param x pointer to the query parameter to pass |
353 | */ | 347 | */ |
354 | struct GNUNET_MY_QueryParam | 348 | struct GNUNET_MY_QueryParam |
355 | GNUNET_MY_query_param_uint64 (const uint64_t *x); | 349 | GNUNET_MY_query_param_uint64(const uint64_t *x); |
356 | 350 | ||
357 | /** | 351 | /** |
358 | * We expect a fixed-size result, with size determined by the type of `* dst` | 352 | * We expect a fixed-size result, with size determined by the type of `* dst` |
@@ -361,7 +355,7 @@ GNUNET_MY_query_param_uint64 (const uint64_t *x); | |||
361 | * @spec dst point to where to store the result, type fits expected result size | 355 | * @spec dst point to where to store the result, type fits expected result size |
362 | * @return array entry for the result specification to use | 356 | * @return array entry for the result specification to use |
363 | */ | 357 | */ |
364 | #define GNUNET_MY_result_spec_auto_from_type(dst) GNUNET_MY_result_spec_fixed_size ((dst), sizeof (*(dst))) | 358 | #define GNUNET_MY_result_spec_auto_from_type(dst) GNUNET_MY_result_spec_fixed_size((dst), sizeof(*(dst))) |
365 | 359 | ||
366 | 360 | ||
367 | /** | 361 | /** |
@@ -372,8 +366,8 @@ GNUNET_MY_query_param_uint64 (const uint64_t *x); | |||
372 | * @return array entru for the result specification to use | 366 | * @return array entru for the result specification to use |
373 | */ | 367 | */ |
374 | struct GNUNET_MY_ResultSpec | 368 | struct GNUNET_MY_ResultSpec |
375 | GNUNET_MY_result_spec_variable_size (void **dst, | 369 | GNUNET_MY_result_spec_variable_size(void **dst, |
376 | size_t *ptr_size); | 370 | size_t *ptr_size); |
377 | 371 | ||
378 | /** | 372 | /** |
379 | * RSA public key expected | 373 | * RSA public key expected |
@@ -383,7 +377,7 @@ GNUNET_MY_result_spec_variable_size (void **dst, | |||
383 | * @return array entry for the result specification to use | 377 | * @return array entry for the result specification to use |
384 | */ | 378 | */ |
385 | struct GNUNET_MY_ResultSpec | 379 | struct GNUNET_MY_ResultSpec |
386 | GNUNET_MY_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); | 380 | GNUNET_MY_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); |
387 | 381 | ||
388 | 382 | ||
389 | /** | 383 | /** |
@@ -393,62 +387,62 @@ GNUNET_MY_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); | |||
393 | * @return array entry for the result specification to use | 387 | * @return array entry for the result specification to use |
394 | */ | 388 | */ |
395 | struct GNUNET_MY_ResultSpec | 389 | struct GNUNET_MY_ResultSpec |
396 | GNUNET_MY_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig); | 390 | GNUNET_MY_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); |
397 | 391 | ||
398 | /** | 392 | /** |
399 | * 0- terminated string exprected. | 393 | * 0- terminated string exprected. |
400 | * | 394 | * |
401 | * @param[out] dst where to store the result, allocated | 395 | * @param[out] dst where to store the result, allocated |
402 | * @return array entry for the result specification to use | 396 | * @return array entry for the result specification to use |
403 | */ | 397 | */ |
404 | struct GNUNET_MY_ResultSpec | 398 | struct GNUNET_MY_ResultSpec |
405 | GNUNET_MY_result_spec_string (char **dst); | 399 | GNUNET_MY_result_spec_string(char **dst); |
406 | 400 | ||
407 | /** | 401 | /** |
408 | * Absolute time expected | 402 | * Absolute time expected |
409 | * | 403 | * |
410 | * @param name name of the field in the table | 404 | * @param name name of the field in the table |
411 | * @param[out] at where to store the result | 405 | * @param[out] at where to store the result |
412 | * @return array entry for the result specification to use | 406 | * @return array entry for the result specification to use |
413 | */ | 407 | */ |
414 | struct GNUNET_MY_ResultSpec | 408 | struct GNUNET_MY_ResultSpec |
415 | GNUNET_MY_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at); | 409 | GNUNET_MY_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); |
416 | 410 | ||
417 | /** | 411 | /** |
418 | * Absolute time in network byte order expected | 412 | * Absolute time in network byte order expected |
419 | * | 413 | * |
420 | * @param[out] at where to store the result | 414 | * @param[out] at where to store the result |
421 | * @return array entry for the result specification to use | 415 | * @return array entry for the result specification to use |
422 | */ | 416 | */ |
423 | struct GNUNET_MY_ResultSpec | 417 | struct GNUNET_MY_ResultSpec |
424 | GNUNET_MY_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at); | 418 | GNUNET_MY_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); |
425 | 419 | ||
426 | /** | 420 | /** |
427 | * uint16_t expected | 421 | * uint16_t expected |
428 | * | 422 | * |
429 | * @param[out] u16 where to store the result | 423 | * @param[out] u16 where to store the result |
430 | * @return array entry for the result specification to use | 424 | * @return array entry for the result specification to use |
431 | */ | 425 | */ |
432 | struct GNUNET_MY_ResultSpec | 426 | struct GNUNET_MY_ResultSpec |
433 | GNUNET_MY_result_spec_uint16 (uint16_t *u16); | 427 | GNUNET_MY_result_spec_uint16(uint16_t *u16); |
434 | 428 | ||
435 | /** | 429 | /** |
436 | * uint32_t expected | 430 | * uint32_t expected |
437 | * | 431 | * |
438 | * @param[out] u32 where to store the result | 432 | * @param[out] u32 where to store the result |
439 | * @return array entry for the result specification to use | 433 | * @return array entry for the result specification to use |
440 | */ | 434 | */ |
441 | struct GNUNET_MY_ResultSpec | 435 | struct GNUNET_MY_ResultSpec |
442 | GNUNET_MY_result_spec_uint32 (uint32_t *u32); | 436 | GNUNET_MY_result_spec_uint32(uint32_t *u32); |
443 | 437 | ||
444 | /** | 438 | /** |
445 | * uint64_t expected. | 439 | * uint64_t expected. |
446 | * | 440 | * |
447 | * @param[out] u64 where to store the result | 441 | * @param[out] u64 where to store the result |
448 | * @return array entry for the result specification to use | 442 | * @return array entry for the result specification to use |
449 | */ | 443 | */ |
450 | struct GNUNET_MY_ResultSpec | 444 | struct GNUNET_MY_ResultSpec |
451 | GNUNET_MY_result_spec_uint64 (uint64_t *u64); | 445 | GNUNET_MY_result_spec_uint64(uint64_t *u64); |
452 | 446 | ||
453 | 447 | ||
454 | /** | 448 | /** |
@@ -463,8 +457,8 @@ GNUNET_MY_result_spec_uint64 (uint64_t *u64); | |||
463 | * #GNUNET_SYSERR if a result was invalid | 457 | * #GNUNET_SYSERR if a result was invalid |
464 | */ | 458 | */ |
465 | int | 459 | int |
466 | GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, | 460 | GNUNET_MY_extract_result(struct GNUNET_MYSQL_StatementHandle *sh, |
467 | struct GNUNET_MY_ResultSpec *specs); | 461 | struct GNUNET_MY_ResultSpec *specs); |
468 | 462 | ||
469 | 463 | ||
470 | /** | 464 | /** |
@@ -475,8 +469,8 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, | |||
475 | * @param qbind mysql query | 469 | * @param qbind mysql query |
476 | */ | 470 | */ |
477 | void | 471 | void |
478 | GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp, | 472 | GNUNET_MY_cleanup_query(struct GNUNET_MY_QueryParam *qp, |
479 | MYSQL_BIND *qbind); | 473 | MYSQL_BIND *qbind); |
480 | 474 | ||
481 | 475 | ||
482 | /** | 476 | /** |
@@ -486,7 +480,7 @@ GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp, | |||
486 | * @param rs reult specification to clean up | 480 | * @param rs reult specification to clean up |
487 | */ | 481 | */ |
488 | void | 482 | void |
489 | GNUNET_MY_cleanup_result (struct GNUNET_MY_ResultSpec *rs); | 483 | GNUNET_MY_cleanup_result(struct GNUNET_MY_ResultSpec *rs); |
490 | 484 | ||
491 | 485 | ||
492 | #if 0 /* keep Emacsens' auto-indent happy */ | 486 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_mysql_lib.h b/src/include/gnunet_mysql_lib.h index dbbcd2b19..0fef43a5a 100644 --- a/src/include/gnunet_mysql_lib.h +++ b/src/include/gnunet_mysql_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -77,8 +77,8 @@ typedef int | |||
77 | * @return the mysql context | 77 | * @return the mysql context |
78 | */ | 78 | */ |
79 | struct GNUNET_MYSQL_Context * | 79 | struct GNUNET_MYSQL_Context * |
80 | GNUNET_MYSQL_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 80 | GNUNET_MYSQL_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
81 | const char *section); | 81 | const char *section); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
@@ -87,7 +87,7 @@ GNUNET_MYSQL_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
87 | * @param mc context to destroy | 87 | * @param mc context to destroy |
88 | */ | 88 | */ |
89 | void | 89 | void |
90 | GNUNET_MYSQL_context_destroy (struct GNUNET_MYSQL_Context *mc); | 90 | GNUNET_MYSQL_context_destroy(struct GNUNET_MYSQL_Context *mc); |
91 | 91 | ||
92 | 92 | ||
93 | /** | 93 | /** |
@@ -98,7 +98,7 @@ GNUNET_MYSQL_context_destroy (struct GNUNET_MYSQL_Context *mc); | |||
98 | * @param mc mysql context | 98 | * @param mc mysql context |
99 | */ | 99 | */ |
100 | void | 100 | void |
101 | GNUNET_MYSQL_statements_invalidate (struct GNUNET_MYSQL_Context *mc); | 101 | GNUNET_MYSQL_statements_invalidate(struct GNUNET_MYSQL_Context *mc); |
102 | 102 | ||
103 | 103 | ||
104 | /** | 104 | /** |
@@ -110,7 +110,7 @@ GNUNET_MYSQL_statements_invalidate (struct GNUNET_MYSQL_Context *mc); | |||
110 | * @return MySQL statement handle, NULL on error | 110 | * @return MySQL statement handle, NULL on error |
111 | */ | 111 | */ |
112 | MYSQL_STMT * | 112 | MYSQL_STMT * |
113 | GNUNET_MYSQL_statement_get_stmt (struct GNUNET_MYSQL_StatementHandle *sh); | 113 | GNUNET_MYSQL_statement_get_stmt(struct GNUNET_MYSQL_StatementHandle *sh); |
114 | 114 | ||
115 | 115 | ||
116 | /** | 116 | /** |
@@ -122,8 +122,8 @@ GNUNET_MYSQL_statement_get_stmt (struct GNUNET_MYSQL_StatementHandle *sh); | |||
122 | * @return prepared statement, NULL on error | 122 | * @return prepared statement, NULL on error |
123 | */ | 123 | */ |
124 | struct GNUNET_MYSQL_StatementHandle * | 124 | struct GNUNET_MYSQL_StatementHandle * |
125 | GNUNET_MYSQL_statement_prepare (struct GNUNET_MYSQL_Context *mc, | 125 | GNUNET_MYSQL_statement_prepare(struct GNUNET_MYSQL_Context *mc, |
126 | const char *query); | 126 | const char *query); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -135,8 +135,8 @@ GNUNET_MYSQL_statement_prepare (struct GNUNET_MYSQL_Context *mc, | |||
135 | * #GNUNET_SYSERR if there was a problem | 135 | * #GNUNET_SYSERR if there was a problem |
136 | */ | 136 | */ |
137 | int | 137 | int |
138 | GNUNET_MYSQL_statement_run (struct GNUNET_MYSQL_Context *mc, | 138 | GNUNET_MYSQL_statement_run(struct GNUNET_MYSQL_Context *mc, |
139 | const char *sql); | 139 | const char *sql); |
140 | 140 | ||
141 | 141 | ||
142 | #if 0 /* keep Emacsens' auto-indent happy */ | 142 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_namecache_plugin.h b/src/include/gnunet_namecache_plugin.h index 5281fd3dc..8d3c4fb61 100644 --- a/src/include/gnunet_namecache_plugin.h +++ b/src/include/gnunet_namecache_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -54,15 +54,13 @@ extern "C" | |||
54 | * @param block lookup result | 54 | * @param block lookup result |
55 | */ | 55 | */ |
56 | typedef void (*GNUNET_NAMECACHE_BlockCallback) (void *cls, | 56 | typedef void (*GNUNET_NAMECACHE_BlockCallback) (void *cls, |
57 | const struct GNUNET_GNSRECORD_Block *block); | 57 | const struct GNUNET_GNSRECORD_Block *block); |
58 | 58 | ||
59 | 59 | ||
60 | /** | 60 | /** |
61 | * @brief struct returned by the initialization function of the plugin | 61 | * @brief struct returned by the initialization function of the plugin |
62 | */ | 62 | */ |
63 | struct GNUNET_NAMECACHE_PluginFunctions | 63 | struct GNUNET_NAMECACHE_PluginFunctions { |
64 | { | ||
65 | |||
66 | /** | 64 | /** |
67 | * Closure to pass to all plugin functions. | 65 | * Closure to pass to all plugin functions. |
68 | */ | 66 | */ |
@@ -77,7 +75,7 @@ struct GNUNET_NAMECACHE_PluginFunctions | |||
77 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 75 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
78 | */ | 76 | */ |
79 | int (*cache_block) (void *cls, | 77 | int (*cache_block) (void *cls, |
80 | const struct GNUNET_GNSRECORD_Block *block); | 78 | const struct GNUNET_GNSRECORD_Block *block); |
81 | 79 | ||
82 | 80 | ||
83 | /** | 81 | /** |
@@ -91,10 +89,8 @@ struct GNUNET_NAMECACHE_PluginFunctions | |||
91 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 89 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error |
92 | */ | 90 | */ |
93 | int (*lookup_block) (void *cls, | 91 | int (*lookup_block) (void *cls, |
94 | const struct GNUNET_HashCode *query, | 92 | const struct GNUNET_HashCode *query, |
95 | GNUNET_NAMECACHE_BlockCallback iter, void *iter_cls); | 93 | GNUNET_NAMECACHE_BlockCallback iter, void *iter_cls); |
96 | |||
97 | |||
98 | }; | 94 | }; |
99 | 95 | ||
100 | 96 | ||
diff --git a/src/include/gnunet_namecache_service.h b/src/include/gnunet_namecache_service.h index da0235fc1..271d16d19 100644 --- a/src/include/gnunet_namecache_service.h +++ b/src/include/gnunet_namecache_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -74,7 +74,7 @@ struct GNUNET_NAMECACHE_Handle; | |||
74 | * @return handle to use to access the service | 74 | * @return handle to use to access the service |
75 | */ | 75 | */ |
76 | struct GNUNET_NAMECACHE_Handle * | 76 | struct GNUNET_NAMECACHE_Handle * |
77 | GNUNET_NAMECACHE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 77 | GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
@@ -85,7 +85,7 @@ GNUNET_NAMECACHE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
85 | * @param h handle to the namecache | 85 | * @param h handle to the namecache |
86 | */ | 86 | */ |
87 | void | 87 | void |
88 | GNUNET_NAMECACHE_disconnect (struct GNUNET_NAMECACHE_Handle *h); | 88 | GNUNET_NAMECACHE_disconnect(struct GNUNET_NAMECACHE_Handle *h); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
@@ -116,10 +116,10 @@ typedef void | |||
116 | * @return handle to abort the request, NULL on error | 116 | * @return handle to abort the request, NULL on error |
117 | */ | 117 | */ |
118 | struct GNUNET_NAMECACHE_QueueEntry * | 118 | struct GNUNET_NAMECACHE_QueueEntry * |
119 | GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h, | 119 | GNUNET_NAMECACHE_block_cache(struct GNUNET_NAMECACHE_Handle *h, |
120 | const struct GNUNET_GNSRECORD_Block *block, | 120 | const struct GNUNET_GNSRECORD_Block *block, |
121 | GNUNET_NAMECACHE_ContinuationWithStatus cont, | 121 | GNUNET_NAMECACHE_ContinuationWithStatus cont, |
122 | void *cont_cls); | 122 | void *cont_cls); |
123 | 123 | ||
124 | 124 | ||
125 | /** | 125 | /** |
@@ -146,10 +146,10 @@ typedef void | |||
146 | * @return a handle that can be used to cancel, NULL on error | 146 | * @return a handle that can be used to cancel, NULL on error |
147 | */ | 147 | */ |
148 | struct GNUNET_NAMECACHE_QueueEntry * | 148 | struct GNUNET_NAMECACHE_QueueEntry * |
149 | GNUNET_NAMECACHE_lookup_block (struct GNUNET_NAMECACHE_Handle *h, | 149 | GNUNET_NAMECACHE_lookup_block(struct GNUNET_NAMECACHE_Handle *h, |
150 | const struct GNUNET_HashCode *derived_hash, | 150 | const struct GNUNET_HashCode *derived_hash, |
151 | GNUNET_NAMECACHE_BlockProcessor proc, | 151 | GNUNET_NAMECACHE_BlockProcessor proc, |
152 | void *proc_cls); | 152 | void *proc_cls); |
153 | 153 | ||
154 | 154 | ||
155 | /** | 155 | /** |
@@ -161,7 +161,7 @@ GNUNET_NAMECACHE_lookup_block (struct GNUNET_NAMECACHE_Handle *h, | |||
161 | * @param qe operation to cancel | 161 | * @param qe operation to cancel |
162 | */ | 162 | */ |
163 | void | 163 | void |
164 | GNUNET_NAMECACHE_cancel (struct GNUNET_NAMECACHE_QueueEntry *qe); | 164 | GNUNET_NAMECACHE_cancel(struct GNUNET_NAMECACHE_QueueEntry *qe); |
165 | 165 | ||
166 | 166 | ||
167 | #if 0 /* keep Emacsens' auto-indent happy */ | 167 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 3b603b4c0..b942bb592 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -56,19 +56,17 @@ extern "C" | |||
56 | */ | 56 | */ |
57 | typedef void | 57 | typedef void |
58 | (*GNUNET_NAMESTORE_RecordIterator) (void *cls, | 58 | (*GNUNET_NAMESTORE_RecordIterator) (void *cls, |
59 | uint64_t serial, | 59 | uint64_t serial, |
60 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 60 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, |
61 | const char *label, | 61 | const char *label, |
62 | unsigned int rd_count, | 62 | unsigned int rd_count, |
63 | const struct GNUNET_GNSRECORD_Data *rd); | 63 | const struct GNUNET_GNSRECORD_Data *rd); |
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
67 | * @brief struct returned by the initialization function of the plugin | 67 | * @brief struct returned by the initialization function of the plugin |
68 | */ | 68 | */ |
69 | struct GNUNET_NAMESTORE_PluginFunctions | 69 | struct GNUNET_NAMESTORE_PluginFunctions { |
70 | { | ||
71 | |||
72 | /** | 70 | /** |
73 | * Closure to pass to all plugin functions. | 71 | * Closure to pass to all plugin functions. |
74 | */ | 72 | */ |
@@ -87,10 +85,10 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
87 | */ | 85 | */ |
88 | int | 86 | int |
89 | (*store_records) (void *cls, | 87 | (*store_records) (void *cls, |
90 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 88 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
91 | const char *label, | 89 | const char *label, |
92 | unsigned int rd_count, | 90 | unsigned int rd_count, |
93 | const struct GNUNET_GNSRECORD_Data *rd); | 91 | const struct GNUNET_GNSRECORD_Data *rd); |
94 | 92 | ||
95 | /** | 93 | /** |
96 | * Lookup records in the datastore for which we are the authority. | 94 | * Lookup records in the datastore for which we are the authority. |
@@ -104,10 +102,10 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
104 | */ | 102 | */ |
105 | int | 103 | int |
106 | (*lookup_records) (void *cls, | 104 | (*lookup_records) (void *cls, |
107 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 105 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
108 | const char *label, | 106 | const char *label, |
109 | GNUNET_NAMESTORE_RecordIterator iter, | 107 | GNUNET_NAMESTORE_RecordIterator iter, |
110 | void *iter_cls); | 108 | void *iter_cls); |
111 | 109 | ||
112 | 110 | ||
113 | /** | 111 | /** |
@@ -126,11 +124,11 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
126 | */ | 124 | */ |
127 | int | 125 | int |
128 | (*iterate_records) (void *cls, | 126 | (*iterate_records) (void *cls, |
129 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 127 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
130 | uint64_t serial, | 128 | uint64_t serial, |
131 | uint64_t limit, | 129 | uint64_t limit, |
132 | GNUNET_NAMESTORE_RecordIterator iter, | 130 | GNUNET_NAMESTORE_RecordIterator iter, |
133 | void *iter_cls); | 131 | void *iter_cls); |
134 | 132 | ||
135 | 133 | ||
136 | /** | 134 | /** |
@@ -146,12 +144,10 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
146 | */ | 144 | */ |
147 | int | 145 | int |
148 | (*zone_to_name) (void *cls, | 146 | (*zone_to_name) (void *cls, |
149 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 147 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
150 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 148 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, |
151 | GNUNET_NAMESTORE_RecordIterator iter, | 149 | GNUNET_NAMESTORE_RecordIterator iter, |
152 | void *iter_cls); | 150 | void *iter_cls); |
153 | |||
154 | |||
155 | }; | 151 | }; |
156 | 152 | ||
157 | 153 | ||
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 9b6beef28..36221f195 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -74,7 +74,7 @@ struct GNUNET_NAMESTORE_ZoneIterator; | |||
74 | * @return handle to use to access the service | 74 | * @return handle to use to access the service |
75 | */ | 75 | */ |
76 | struct GNUNET_NAMESTORE_Handle * | 76 | struct GNUNET_NAMESTORE_Handle * |
77 | GNUNET_NAMESTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 77 | GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
@@ -85,7 +85,7 @@ GNUNET_NAMESTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
85 | * @param h handle to the namestore | 85 | * @param h handle to the namestore |
86 | */ | 86 | */ |
87 | void | 87 | void |
88 | GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h); | 88 | GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
@@ -125,13 +125,13 @@ typedef void | |||
125 | * @return handle to abort the request | 125 | * @return handle to abort the request |
126 | */ | 126 | */ |
127 | struct GNUNET_NAMESTORE_QueueEntry * | 127 | struct GNUNET_NAMESTORE_QueueEntry * |
128 | GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | 128 | GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, |
129 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 129 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
130 | const char *label, | 130 | const char *label, |
131 | unsigned int rd_count, | 131 | unsigned int rd_count, |
132 | const struct GNUNET_GNSRECORD_Data *rd, | 132 | const struct GNUNET_GNSRECORD_Data *rd, |
133 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 133 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
134 | void *cont_cls); | 134 | void *cont_cls); |
135 | 135 | ||
136 | 136 | ||
137 | /** | 137 | /** |
@@ -162,11 +162,11 @@ typedef void | |||
162 | * @return handle to abort the request | 162 | * @return handle to abort the request |
163 | */ | 163 | */ |
164 | struct GNUNET_NAMESTORE_QueueEntry * | 164 | struct GNUNET_NAMESTORE_QueueEntry * |
165 | GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h, | 165 | GNUNET_NAMESTORE_set_nick(struct GNUNET_NAMESTORE_Handle *h, |
166 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 166 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
167 | const char *nick, | 167 | const char *nick, |
168 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 168 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
169 | void *cont_cls); | 169 | void *cont_cls); |
170 | 170 | ||
171 | 171 | ||
172 | /** | 172 | /** |
@@ -184,13 +184,13 @@ GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h, | |||
184 | * @return handle to abort the request | 184 | * @return handle to abort the request |
185 | */ | 185 | */ |
186 | struct GNUNET_NAMESTORE_QueueEntry * | 186 | struct GNUNET_NAMESTORE_QueueEntry * |
187 | GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h, | 187 | GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, |
188 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 188 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
189 | const char *label, | 189 | const char *label, |
190 | GNUNET_SCHEDULER_TaskCallback error_cb, | 190 | GNUNET_SCHEDULER_TaskCallback error_cb, |
191 | void *error_cb_cls, | 191 | void *error_cb_cls, |
192 | GNUNET_NAMESTORE_RecordMonitor rm, | 192 | GNUNET_NAMESTORE_RecordMonitor rm, |
193 | void *rm_cls); | 193 | void *rm_cls); |
194 | 194 | ||
195 | 195 | ||
196 | /** | 196 | /** |
@@ -211,13 +211,13 @@ GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h, | |||
211 | * cancel | 211 | * cancel |
212 | */ | 212 | */ |
213 | struct GNUNET_NAMESTORE_QueueEntry * | 213 | struct GNUNET_NAMESTORE_QueueEntry * |
214 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | 214 | GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, |
215 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 215 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
216 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 216 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, |
217 | GNUNET_SCHEDULER_TaskCallback error_cb, | 217 | GNUNET_SCHEDULER_TaskCallback error_cb, |
218 | void *error_cb_cls, | 218 | void *error_cb_cls, |
219 | GNUNET_NAMESTORE_RecordMonitor proc, | 219 | GNUNET_NAMESTORE_RecordMonitor proc, |
220 | void *proc_cls); | 220 | void *proc_cls); |
221 | 221 | ||
222 | 222 | ||
223 | /** | 223 | /** |
@@ -229,7 +229,7 @@ GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | |||
229 | * @param qe operation to cancel | 229 | * @param qe operation to cancel |
230 | */ | 230 | */ |
231 | void | 231 | void |
232 | GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); | 232 | GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe); |
233 | 233 | ||
234 | 234 | ||
235 | /** | 235 | /** |
@@ -258,14 +258,14 @@ GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); | |||
258 | * @return an iterator handle to use for iteration | 258 | * @return an iterator handle to use for iteration |
259 | */ | 259 | */ |
260 | struct GNUNET_NAMESTORE_ZoneIterator * | 260 | struct GNUNET_NAMESTORE_ZoneIterator * |
261 | GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | 261 | GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, |
262 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 262 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
263 | GNUNET_SCHEDULER_TaskCallback error_cb, | 263 | GNUNET_SCHEDULER_TaskCallback error_cb, |
264 | void *error_cb_cls, | 264 | void *error_cb_cls, |
265 | GNUNET_NAMESTORE_RecordMonitor proc, | 265 | GNUNET_NAMESTORE_RecordMonitor proc, |
266 | void *proc_cls, | 266 | void *proc_cls, |
267 | GNUNET_SCHEDULER_TaskCallback finish_cb, | 267 | GNUNET_SCHEDULER_TaskCallback finish_cb, |
268 | void *finish_cb_cls); | 268 | void *finish_cb_cls); |
269 | 269 | ||
270 | 270 | ||
271 | /** | 271 | /** |
@@ -277,8 +277,8 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | |||
277 | * (before #GNUNET_NAMESTORE_zone_iterator_next is to be called again) | 277 | * (before #GNUNET_NAMESTORE_zone_iterator_next is to be called again) |
278 | */ | 278 | */ |
279 | void | 279 | void |
280 | GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it, | 280 | GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, |
281 | uint64_t limit); | 281 | uint64_t limit); |
282 | 282 | ||
283 | 283 | ||
284 | /** | 284 | /** |
@@ -289,7 +289,7 @@ GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it, | |||
289 | * @param it the iterator | 289 | * @param it the iterator |
290 | */ | 290 | */ |
291 | void | 291 | void |
292 | GNUNET_NAMESTORE_zone_iteration_stop (struct GNUNET_NAMESTORE_ZoneIterator *it); | 292 | GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it); |
293 | 293 | ||
294 | 294 | ||
295 | /** | 295 | /** |
@@ -326,15 +326,15 @@ struct GNUNET_NAMESTORE_ZoneMonitor; | |||
326 | * @return handle to stop monitoring | 326 | * @return handle to stop monitoring |
327 | */ | 327 | */ |
328 | struct GNUNET_NAMESTORE_ZoneMonitor * | 328 | struct GNUNET_NAMESTORE_ZoneMonitor * |
329 | GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 329 | GNUNET_NAMESTORE_zone_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
330 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 330 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
331 | int iterate_first, | 331 | int iterate_first, |
332 | GNUNET_SCHEDULER_TaskCallback error_cb, | 332 | GNUNET_SCHEDULER_TaskCallback error_cb, |
333 | void *error_cb_cls, | 333 | void *error_cb_cls, |
334 | GNUNET_NAMESTORE_RecordMonitor monitor, | 334 | GNUNET_NAMESTORE_RecordMonitor monitor, |
335 | void *monitor_cls, | 335 | void *monitor_cls, |
336 | GNUNET_SCHEDULER_TaskCallback sync_cb, | 336 | GNUNET_SCHEDULER_TaskCallback sync_cb, |
337 | void *sync_cb_cls); | 337 | void *sync_cb_cls); |
338 | 338 | ||
339 | 339 | ||
340 | /** | 340 | /** |
@@ -359,8 +359,8 @@ GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *c | |||
359 | * (before #GNUNET_NAMESTORE_zone_monitor_next is to be called again) | 359 | * (before #GNUNET_NAMESTORE_zone_monitor_next is to be called again) |
360 | */ | 360 | */ |
361 | void | 361 | void |
362 | GNUNET_NAMESTORE_zone_monitor_next (struct GNUNET_NAMESTORE_ZoneMonitor *zm, | 362 | GNUNET_NAMESTORE_zone_monitor_next(struct GNUNET_NAMESTORE_ZoneMonitor *zm, |
363 | uint64_t limit); | 363 | uint64_t limit); |
364 | 364 | ||
365 | 365 | ||
366 | /** | 366 | /** |
@@ -369,7 +369,7 @@ GNUNET_NAMESTORE_zone_monitor_next (struct GNUNET_NAMESTORE_ZoneMonitor *zm, | |||
369 | * @param zm handle to the monitor activity to stop | 369 | * @param zm handle to the monitor activity to stop |
370 | */ | 370 | */ |
371 | void | 371 | void |
372 | GNUNET_NAMESTORE_zone_monitor_stop (struct GNUNET_NAMESTORE_ZoneMonitor *zm); | 372 | GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm); |
373 | 373 | ||
374 | 374 | ||
375 | #if 0 /* keep Emacsens' auto-indent happy */ | 375 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nat_auto_service.h b/src/include/gnunet_nat_auto_service.h index dd74d1eeb..b40c515a5 100644 --- a/src/include/gnunet_nat_auto_service.h +++ b/src/include/gnunet_nat_auto_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -56,11 +56,11 @@ struct GNUNET_NAT_AUTO_Test; | |||
56 | * @return handle to cancel NAT test | 56 | * @return handle to cancel NAT test |
57 | */ | 57 | */ |
58 | struct GNUNET_NAT_AUTO_Test * | 58 | struct GNUNET_NAT_AUTO_Test * |
59 | GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 59 | GNUNET_NAT_AUTO_test_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
60 | uint8_t proto, | 60 | uint8_t proto, |
61 | const char *section_name, | 61 | const char *section_name, |
62 | GNUNET_NAT_TestCallback report, | 62 | GNUNET_NAT_TestCallback report, |
63 | void *report_cls); | 63 | void *report_cls); |
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
@@ -69,7 +69,7 @@ GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
69 | * @param tst test to stop. | 69 | * @param tst test to stop. |
70 | */ | 70 | */ |
71 | void | 71 | void |
72 | GNUNET_NAT_AUTO_test_stop (struct GNUNET_NAT_AUTO_Test *tst); | 72 | GNUNET_NAT_AUTO_test_stop(struct GNUNET_NAT_AUTO_Test *tst); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -85,7 +85,7 @@ struct GNUNET_NAT_AUTO_AutoHandle; | |||
85 | * @return point to a static string containing the error code | 85 | * @return point to a static string containing the error code |
86 | */ | 86 | */ |
87 | const char * | 87 | const char * |
88 | GNUNET_NAT_AUTO_status2string (enum GNUNET_NAT_StatusCode err); | 88 | GNUNET_NAT_AUTO_status2string(enum GNUNET_NAT_StatusCode err); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
@@ -99,9 +99,9 @@ GNUNET_NAT_AUTO_status2string (enum GNUNET_NAT_StatusCode err); | |||
99 | */ | 99 | */ |
100 | typedef void | 100 | typedef void |
101 | (*GNUNET_NAT_AUTO_AutoResultCallback)(void *cls, | 101 | (*GNUNET_NAT_AUTO_AutoResultCallback)(void *cls, |
102 | const struct GNUNET_CONFIGURATION_Handle *diff, | 102 | const struct GNUNET_CONFIGURATION_Handle *diff, |
103 | enum GNUNET_NAT_StatusCode result, | 103 | enum GNUNET_NAT_StatusCode result, |
104 | enum GNUNET_NAT_Type type); | 104 | enum GNUNET_NAT_Type type); |
105 | 105 | ||
106 | 106 | ||
107 | /** | 107 | /** |
@@ -114,9 +114,9 @@ typedef void | |||
114 | * @return handle to cancel operation | 114 | * @return handle to cancel operation |
115 | */ | 115 | */ |
116 | struct GNUNET_NAT_AUTO_AutoHandle * | 116 | struct GNUNET_NAT_AUTO_AutoHandle * |
117 | GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 117 | GNUNET_NAT_AUTO_autoconfig_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
118 | GNUNET_NAT_AUTO_AutoResultCallback cb, | 118 | GNUNET_NAT_AUTO_AutoResultCallback cb, |
119 | void *cb_cls); | 119 | void *cb_cls); |
120 | 120 | ||
121 | 121 | ||
122 | /** | 122 | /** |
@@ -125,7 +125,7 @@ GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
125 | * @param ah handle for operation to abort | 125 | * @param ah handle for operation to abort |
126 | */ | 126 | */ |
127 | void | 127 | void |
128 | GNUNET_NAT_AUTO_autoconfig_cancel (struct GNUNET_NAT_AUTO_AutoHandle *ah); | 128 | GNUNET_NAT_AUTO_autoconfig_cancel(struct GNUNET_NAT_AUTO_AutoHandle *ah); |
129 | 129 | ||
130 | 130 | ||
131 | #endif | 131 | #endif |
diff --git a/src/include/gnunet_nat_service.h b/src/include/gnunet_nat_service.h index b96b2386e..7f0e9764b 100644 --- a/src/include/gnunet_nat_service.h +++ b/src/include/gnunet_nat_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -49,9 +49,7 @@ | |||
49 | * an equivalent enum in gnunet_transport_hello_service.h; | 49 | * an equivalent enum in gnunet_transport_hello_service.h; |
50 | * might ultimately belong with the new HELLO definition. | 50 | * might ultimately belong with the new HELLO definition. |
51 | */ | 51 | */ |
52 | enum GNUNET_NAT_AddressClass | 52 | enum GNUNET_NAT_AddressClass { |
53 | { | ||
54 | |||
55 | /** | 53 | /** |
56 | * No address. | 54 | * No address. |
57 | */ | 55 | */ |
@@ -87,7 +85,7 @@ enum GNUNET_NAT_AddressClass | |||
87 | * Useful for broadcasts. | 85 | * Useful for broadcasts. |
88 | */ | 86 | */ |
89 | GNUNET_NAT_AC_LAN = 8, | 87 | GNUNET_NAT_AC_LAN = 8, |
90 | 88 | ||
91 | /** | 89 | /** |
92 | * Addresses useful in the local wired network, | 90 | * Addresses useful in the local wired network, |
93 | * i.e. a MAC. Sensitive, but obvious to people nearby. | 91 | * i.e. a MAC. Sensitive, but obvious to people nearby. |
@@ -112,12 +110,12 @@ enum GNUNET_NAT_AddressClass | |||
112 | * Loopback addresses, only useful under special cirumstances. | 110 | * Loopback addresses, only useful under special cirumstances. |
113 | */ | 111 | */ |
114 | GNUNET_NAT_AC_LOOPBACK = 64, | 112 | GNUNET_NAT_AC_LOOPBACK = 64, |
115 | 113 | ||
116 | /** | 114 | /** |
117 | * Addresses that should be our external IP address | 115 | * Addresses that should be our external IP address |
118 | * on the outside of a NAT. Might be incorrectly determined. | 116 | * on the outside of a NAT. Might be incorrectly determined. |
119 | * Used as a bit in combination with #GNUNET_NAT_AC_GLOBAL, | 117 | * Used as a bit in combination with #GNUNET_NAT_AC_GLOBAL, |
120 | * or in case of double-NAT with | 118 | * or in case of double-NAT with |
121 | * #GNUNET_NAT_AC_LAN. | 119 | * #GNUNET_NAT_AC_LAN. |
122 | */ | 120 | */ |
123 | GNUNET_NAT_AC_EXTERN = 128, | 121 | GNUNET_NAT_AC_EXTERN = 128, |
@@ -132,15 +130,13 @@ enum GNUNET_NAT_AddressClass | |||
132 | * Bitmask for "any" address. | 130 | * Bitmask for "any" address. |
133 | */ | 131 | */ |
134 | GNUNET_NAT_AC_ANY = 65535 | 132 | GNUNET_NAT_AC_ANY = 65535 |
135 | |||
136 | }; | 133 | }; |
137 | 134 | ||
138 | 135 | ||
139 | /** | 136 | /** |
140 | * Error Types for the NAT subsystem (which can then later be converted/resolved to a string) | 137 | * Error Types for the NAT subsystem (which can then later be converted/resolved to a string) |
141 | */ | 138 | */ |
142 | enum GNUNET_NAT_StatusCode | 139 | enum GNUNET_NAT_StatusCode { |
143 | { | ||
144 | /** | 140 | /** |
145 | * Just the default | 141 | * Just the default |
146 | */ | 142 | */ |
@@ -235,7 +231,6 @@ enum GNUNET_NAT_StatusCode | |||
235 | * | 231 | * |
236 | */ | 232 | */ |
237 | GNUNET_NAT_ERROR_HELPER_NAT_CLIENT_NOT_FOUND | 233 | GNUNET_NAT_ERROR_HELPER_NAT_CLIENT_NOT_FOUND |
238 | |||
239 | }; | 234 | }; |
240 | 235 | ||
241 | 236 | ||
@@ -243,8 +238,7 @@ enum GNUNET_NAT_StatusCode | |||
243 | /** | 238 | /** |
244 | * What the situation of the NAT connectivity | 239 | * What the situation of the NAT connectivity |
245 | */ | 240 | */ |
246 | enum GNUNET_NAT_Type | 241 | enum GNUNET_NAT_Type { |
247 | { | ||
248 | /** | 242 | /** |
249 | * We have a direct connection | 243 | * We have a direct connection |
250 | */ | 244 | */ |
@@ -269,7 +263,6 @@ enum GNUNET_NAT_Type | |||
269 | * We know nothing about the NAT. | 263 | * We know nothing about the NAT. |
270 | */ | 264 | */ |
271 | GNUNET_NAT_TYPE_UNKNOWN | 265 | GNUNET_NAT_TYPE_UNKNOWN |
272 | |||
273 | }; | 266 | }; |
274 | 267 | ||
275 | 268 | ||
@@ -281,7 +274,7 @@ enum GNUNET_NAT_Type | |||
281 | * @param cls closure | 274 | * @param cls closure |
282 | * @param app_ctx[in,out] location where the app can store stuff | 275 | * @param app_ctx[in,out] location where the app can store stuff |
283 | * on add and retrieve it on remove | 276 | * on add and retrieve it on remove |
284 | * @param add_remove #GNUNET_YES to add a new public IP address, | 277 | * @param add_remove #GNUNET_YES to add a new public IP address, |
285 | * #GNUNET_NO to remove a previous (now invalid) one | 278 | * #GNUNET_NO to remove a previous (now invalid) one |
286 | * @param ac address class the address belongs to | 279 | * @param ac address class the address belongs to |
287 | * @param addr either the previous or the new public IP address | 280 | * @param addr either the previous or the new public IP address |
@@ -289,9 +282,9 @@ enum GNUNET_NAT_Type | |||
289 | */ | 282 | */ |
290 | typedef void | 283 | typedef void |
291 | (*GNUNET_NAT_AddressCallback) (void *cls, | 284 | (*GNUNET_NAT_AddressCallback) (void *cls, |
292 | void **app_ctx, | 285 | void **app_ctx, |
293 | int add_remove, | 286 | int add_remove, |
294 | enum GNUNET_NAT_AddressClass ac, | 287 | enum GNUNET_NAT_AddressClass ac, |
295 | const struct sockaddr *addr, | 288 | const struct sockaddr *addr, |
296 | socklen_t addrlen); | 289 | socklen_t addrlen); |
297 | 290 | ||
@@ -307,7 +300,7 @@ typedef void | |||
307 | */ | 300 | */ |
308 | typedef void | 301 | typedef void |
309 | (*GNUNET_NAT_ReversalCallback) (void *cls, | 302 | (*GNUNET_NAT_ReversalCallback) (void *cls, |
310 | const struct sockaddr *remote_addr, | 303 | const struct sockaddr *remote_addr, |
311 | socklen_t remote_addrlen); | 304 | socklen_t remote_addrlen); |
312 | 305 | ||
313 | 306 | ||
@@ -338,15 +331,15 @@ struct GNUNET_NAT_Handle; | |||
338 | * @return NULL on error, otherwise handle that can be used to unregister | 331 | * @return NULL on error, otherwise handle that can be used to unregister |
339 | */ | 332 | */ |
340 | struct GNUNET_NAT_Handle * | 333 | struct GNUNET_NAT_Handle * |
341 | GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, | 334 | GNUNET_NAT_register(const struct GNUNET_CONFIGURATION_Handle *cfg, |
342 | const char *config_section, | 335 | const char *config_section, |
343 | uint8_t proto, | 336 | uint8_t proto, |
344 | unsigned int num_addrs, | 337 | unsigned int num_addrs, |
345 | const struct sockaddr **addrs, | 338 | const struct sockaddr **addrs, |
346 | const socklen_t *addrlens, | 339 | const socklen_t *addrlens, |
347 | GNUNET_NAT_AddressCallback address_callback, | 340 | GNUNET_NAT_AddressCallback address_callback, |
348 | GNUNET_NAT_ReversalCallback reversal_callback, | 341 | GNUNET_NAT_ReversalCallback reversal_callback, |
349 | void *callback_cls); | 342 | void *callback_cls); |
350 | 343 | ||
351 | 344 | ||
352 | /** | 345 | /** |
@@ -363,9 +356,9 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
363 | * #GNUNET_SYSERR if the address is malformed | 356 | * #GNUNET_SYSERR if the address is malformed |
364 | */ | 357 | */ |
365 | int | 358 | int |
366 | GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *nh, | 359 | GNUNET_NAT_test_address(struct GNUNET_NAT_Handle *nh, |
367 | const void *addr, | 360 | const void *addr, |
368 | socklen_t addrlen); | 361 | socklen_t addrlen); |
369 | 362 | ||
370 | 363 | ||
371 | /** | 364 | /** |
@@ -376,14 +369,14 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *nh, | |||
376 | * @param nh handle (used for configuration) | 369 | * @param nh handle (used for configuration) |
377 | * @param local_sa our local address of the peer (IPv4-only) | 370 | * @param local_sa our local address of the peer (IPv4-only) |
378 | * @param remote_sa the remote address of the peer (IPv4-only) | 371 | * @param remote_sa the remote address of the peer (IPv4-only) |
379 | * @return #GNUNET_SYSERR on error, | 372 | * @return #GNUNET_SYSERR on error, |
380 | * #GNUNET_NO if connection reversal is unavailable, | 373 | * #GNUNET_NO if connection reversal is unavailable, |
381 | * #GNUNET_OK otherwise (presumably in progress) | 374 | * #GNUNET_OK otherwise (presumably in progress) |
382 | */ | 375 | */ |
383 | int | 376 | int |
384 | GNUNET_NAT_request_reversal (struct GNUNET_NAT_Handle *nh, | 377 | GNUNET_NAT_request_reversal(struct GNUNET_NAT_Handle *nh, |
385 | const struct sockaddr_in *local_sa, | 378 | const struct sockaddr_in *local_sa, |
386 | const struct sockaddr_in *remote_sa); | 379 | const struct sockaddr_in *remote_sa); |
387 | 380 | ||
388 | 381 | ||
389 | /** | 382 | /** |
@@ -394,7 +387,7 @@ GNUNET_NAT_request_reversal (struct GNUNET_NAT_Handle *nh, | |||
394 | * @param nh the handle to unregister | 387 | * @param nh the handle to unregister |
395 | */ | 388 | */ |
396 | void | 389 | void |
397 | GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh); | 390 | GNUNET_NAT_unregister(struct GNUNET_NAT_Handle *nh); |
398 | 391 | ||
399 | 392 | ||
400 | /** | 393 | /** |
@@ -406,7 +399,7 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh); | |||
406 | * | 399 | * |
407 | * The function does some basic sanity checks on packet size and | 400 | * The function does some basic sanity checks on packet size and |
408 | * content, try to extract a bit of information. | 401 | * content, try to extract a bit of information. |
409 | * | 402 | * |
410 | * At the moment this only processes BIND requests, and returns the | 403 | * At the moment this only processes BIND requests, and returns the |
411 | * externally visible address of the request to the rest of the | 404 | * externally visible address of the request to the rest of the |
412 | * NAT logic. | 405 | * NAT logic. |
@@ -421,11 +414,11 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh); | |||
421 | * #GNUNET_SYSERR on internal error handling the packet | 414 | * #GNUNET_SYSERR on internal error handling the packet |
422 | */ | 415 | */ |
423 | int | 416 | int |
424 | GNUNET_NAT_stun_handle_packet (struct GNUNET_NAT_Handle *nh, | 417 | GNUNET_NAT_stun_handle_packet(struct GNUNET_NAT_Handle *nh, |
425 | const struct sockaddr *sender_addr, | 418 | const struct sockaddr *sender_addr, |
426 | size_t sender_addr_len, | 419 | size_t sender_addr_len, |
427 | const void *data, | 420 | const void *data, |
428 | size_t data_size); | 421 | size_t data_size); |
429 | 422 | ||
430 | 423 | ||
431 | /** | 424 | /** |
@@ -445,7 +438,7 @@ struct GNUNET_NAT_STUN_Handle; | |||
445 | */ | 438 | */ |
446 | typedef void | 439 | typedef void |
447 | (*GNUNET_NAT_TestCallback) (void *cls, | 440 | (*GNUNET_NAT_TestCallback) (void *cls, |
448 | enum GNUNET_NAT_StatusCode result); | 441 | enum GNUNET_NAT_StatusCode result); |
449 | 442 | ||
450 | 443 | ||
451 | /** | 444 | /** |
@@ -463,11 +456,11 @@ typedef void | |||
463 | * @return NULL on error | 456 | * @return NULL on error |
464 | */ | 457 | */ |
465 | struct GNUNET_NAT_STUN_Handle * | 458 | struct GNUNET_NAT_STUN_Handle * |
466 | GNUNET_NAT_stun_make_request (const char *server, | 459 | GNUNET_NAT_stun_make_request(const char *server, |
467 | uint16_t port, | 460 | uint16_t port, |
468 | struct GNUNET_NETWORK_Handle *sock, | 461 | struct GNUNET_NETWORK_Handle *sock, |
469 | GNUNET_NAT_TestCallback cb, | 462 | GNUNET_NAT_TestCallback cb, |
470 | void *cb_cls); | 463 | void *cb_cls); |
471 | 464 | ||
472 | 465 | ||
473 | /** | 466 | /** |
@@ -477,7 +470,7 @@ GNUNET_NAT_stun_make_request (const char *server, | |||
477 | * @param rh request to cancel | 470 | * @param rh request to cancel |
478 | */ | 471 | */ |
479 | void | 472 | void |
480 | GNUNET_NAT_stun_make_request_cancel (struct GNUNET_NAT_STUN_Handle *rh); | 473 | GNUNET_NAT_stun_make_request_cancel(struct GNUNET_NAT_STUN_Handle *rh); |
481 | 474 | ||
482 | 475 | ||
483 | #endif | 476 | #endif |
diff --git a/src/include/gnunet_nc_lib.h b/src/include/gnunet_nc_lib.h index 2bfa7040c..1bdb474ea 100644 --- a/src/include/gnunet_nc_lib.h +++ b/src/include/gnunet_nc_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -54,7 +54,7 @@ struct GNUNET_NotificationContext; | |||
54 | * @return handle to the notification context | 54 | * @return handle to the notification context |
55 | */ | 55 | */ |
56 | struct GNUNET_NotificationContext * | 56 | struct GNUNET_NotificationContext * |
57 | GNUNET_notification_context_create (unsigned int queue_length); | 57 | GNUNET_notification_context_create(unsigned int queue_length); |
58 | 58 | ||
59 | 59 | ||
60 | /** | 60 | /** |
@@ -63,7 +63,7 @@ GNUNET_notification_context_create (unsigned int queue_length); | |||
63 | * @param nc context to destroy. | 63 | * @param nc context to destroy. |
64 | */ | 64 | */ |
65 | void | 65 | void |
66 | GNUNET_notification_context_destroy (struct GNUNET_NotificationContext *nc); | 66 | GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -73,8 +73,8 @@ GNUNET_notification_context_destroy (struct GNUNET_NotificationContext *nc); | |||
73 | * @param mq message queue add | 73 | * @param mq message queue add |
74 | */ | 74 | */ |
75 | void | 75 | void |
76 | GNUNET_notification_context_add (struct GNUNET_NotificationContext *nc, | 76 | GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc, |
77 | struct GNUNET_MQ_Handle *mq); | 77 | struct GNUNET_MQ_Handle *mq); |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
@@ -85,9 +85,9 @@ GNUNET_notification_context_add (struct GNUNET_NotificationContext *nc, | |||
85 | * @param can_drop can this message be dropped due to queue length limitations | 85 | * @param can_drop can this message be dropped due to queue length limitations |
86 | */ | 86 | */ |
87 | void | 87 | void |
88 | GNUNET_notification_context_broadcast (struct GNUNET_NotificationContext *nc, | 88 | GNUNET_notification_context_broadcast(struct GNUNET_NotificationContext *nc, |
89 | const struct GNUNET_MessageHeader *msg, | 89 | const struct GNUNET_MessageHeader *msg, |
90 | int can_drop); | 90 | int can_drop); |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Return active number of subscribers in this context. | 93 | * Return active number of subscribers in this context. |
@@ -96,6 +96,6 @@ GNUNET_notification_context_broadcast (struct GNUNET_NotificationContext *nc, | |||
96 | * @return number of current subscribers | 96 | * @return number of current subscribers |
97 | */ | 97 | */ |
98 | unsigned int | 98 | unsigned int |
99 | GNUNET_notification_context_get_size (struct GNUNET_NotificationContext *nc); | 99 | GNUNET_notification_context_get_size(struct GNUNET_NotificationContext *nc); |
100 | 100 | ||
101 | #endif | 101 | #endif |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 6c02f3577..2a91621a3 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Nils Durner | 22 | * @author Nils Durner |
@@ -49,9 +49,7 @@ struct GNUNET_NETWORK_Handle; | |||
49 | /** | 49 | /** |
50 | * @brief collection of IO descriptors | 50 | * @brief collection of IO descriptors |
51 | */ | 51 | */ |
52 | struct GNUNET_NETWORK_FDSet | 52 | struct GNUNET_NETWORK_FDSet { |
53 | { | ||
54 | |||
55 | /** | 53 | /** |
56 | * Maximum number of any socket descriptor in the set (plus one) | 54 | * Maximum number of any socket descriptor in the set (plus one) |
57 | */ | 55 | */ |
@@ -80,9 +78,7 @@ struct GNUNET_NETWORK_FDSet | |||
80 | * smaller than @e handles_size. | 78 | * smaller than @e handles_size. |
81 | */ | 79 | */ |
82 | unsigned int handles_pos; | 80 | unsigned int handles_pos; |
83 | |||
84 | #endif | 81 | #endif |
85 | |||
86 | }; | 82 | }; |
87 | 83 | ||
88 | #include "gnunet_disk_lib.h" | 84 | #include "gnunet_disk_lib.h" |
@@ -95,7 +91,7 @@ struct GNUNET_NETWORK_FDSet | |||
95 | * @return #GNUNET_OK if the PF is supported | 91 | * @return #GNUNET_OK if the PF is supported |
96 | */ | 92 | */ |
97 | int | 93 | int |
98 | GNUNET_NETWORK_test_pf (int pf); | 94 | GNUNET_NETWORK_test_pf(int pf); |
99 | 95 | ||
100 | 96 | ||
101 | /** | 97 | /** |
@@ -108,7 +104,7 @@ GNUNET_NETWORK_test_pf (int pf); | |||
108 | * @return shortened unixpath, NULL on error | 104 | * @return shortened unixpath, NULL on error |
109 | */ | 105 | */ |
110 | char * | 106 | char * |
111 | GNUNET_NETWORK_shorten_unixpath (char *unixpath); | 107 | GNUNET_NETWORK_shorten_unixpath(char *unixpath); |
112 | 108 | ||
113 | 109 | ||
114 | #ifndef WINDOWS | 110 | #ifndef WINDOWS |
@@ -122,7 +118,7 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath); | |||
122 | * @param un unix domain socket address to check | 118 | * @param un unix domain socket address to check |
123 | */ | 119 | */ |
124 | void | 120 | void |
125 | GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un); | 121 | GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un); |
126 | #endif | 122 | #endif |
127 | 123 | ||
128 | 124 | ||
@@ -137,9 +133,9 @@ GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un); | |||
137 | * @return client socket | 133 | * @return client socket |
138 | */ | 134 | */ |
139 | struct GNUNET_NETWORK_Handle * | 135 | struct GNUNET_NETWORK_Handle * |
140 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | 136 | GNUNET_NETWORK_socket_accept(const struct GNUNET_NETWORK_Handle *desc, |
141 | struct sockaddr *address, | 137 | struct sockaddr *address, |
142 | socklen_t *address_len); | 138 | socklen_t *address_len); |
143 | 139 | ||
144 | 140 | ||
145 | /** | 141 | /** |
@@ -149,7 +145,7 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | |||
149 | * @return NULL on error (including not supported on target platform) | 145 | * @return NULL on error (including not supported on target platform) |
150 | */ | 146 | */ |
151 | struct GNUNET_NETWORK_Handle * | 147 | struct GNUNET_NETWORK_Handle * |
152 | GNUNET_NETWORK_socket_box_native (SOCKTYPE fd); | 148 | GNUNET_NETWORK_socket_box_native(SOCKTYPE fd); |
153 | 149 | ||
154 | 150 | ||
155 | /** | 151 | /** |
@@ -160,8 +156,8 @@ GNUNET_NETWORK_socket_box_native (SOCKTYPE fd); | |||
160 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 156 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
161 | */ | 157 | */ |
162 | int | 158 | int |
163 | GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | 159 | GNUNET_NETWORK_socket_set_blocking(struct GNUNET_NETWORK_Handle *fd, |
164 | int doBlock); | 160 | int doBlock); |
165 | 161 | ||
166 | 162 | ||
167 | /** | 163 | /** |
@@ -173,9 +169,9 @@ GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | |||
173 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 169 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
174 | */ | 170 | */ |
175 | int | 171 | int |
176 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | 172 | GNUNET_NETWORK_socket_bind(struct GNUNET_NETWORK_Handle *desc, |
177 | const struct sockaddr *address, | 173 | const struct sockaddr *address, |
178 | socklen_t address_len); | 174 | socklen_t address_len); |
179 | 175 | ||
180 | /** | 176 | /** |
181 | * Close a socket. | 177 | * Close a socket. |
@@ -184,7 +180,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
184 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 180 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
185 | */ | 181 | */ |
186 | int | 182 | int |
187 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 183 | GNUNET_NETWORK_socket_close(struct GNUNET_NETWORK_Handle *desc); |
188 | 184 | ||
189 | 185 | ||
190 | /** | 186 | /** |
@@ -193,7 +189,7 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | |||
193 | * @param desc socket | 189 | * @param desc socket |
194 | */ | 190 | */ |
195 | void | 191 | void |
196 | GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc); | 192 | GNUNET_NETWORK_socket_free_memory_only_(struct GNUNET_NETWORK_Handle *desc); |
197 | 193 | ||
198 | 194 | ||
199 | /** | 195 | /** |
@@ -205,9 +201,9 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc); | |||
205 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 201 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
206 | */ | 202 | */ |
207 | int | 203 | int |
208 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 204 | GNUNET_NETWORK_socket_connect(const struct GNUNET_NETWORK_Handle *desc, |
209 | const struct sockaddr *address, | 205 | const struct sockaddr *address, |
210 | socklen_t address_len); | 206 | socklen_t address_len); |
211 | 207 | ||
212 | 208 | ||
213 | /** | 209 | /** |
@@ -221,11 +217,11 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
221 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 217 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
222 | */ | 218 | */ |
223 | int | 219 | int |
224 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | 220 | GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, |
225 | int level, | 221 | int level, |
226 | int optname, | 222 | int optname, |
227 | void *optval, | 223 | void *optval, |
228 | socklen_t *optlen); | 224 | socklen_t *optlen); |
229 | 225 | ||
230 | 226 | ||
231 | /** | 227 | /** |
@@ -236,8 +232,8 @@ GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | |||
236 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 232 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
237 | */ | 233 | */ |
238 | int | 234 | int |
239 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 235 | GNUNET_NETWORK_socket_listen(const struct GNUNET_NETWORK_Handle *desc, |
240 | int backlog); | 236 | int backlog); |
241 | 237 | ||
242 | 238 | ||
243 | /** | 239 | /** |
@@ -247,7 +243,7 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | |||
247 | * @returns #GNUNET_SYSERR if no data is available, or on error! | 243 | * @returns #GNUNET_SYSERR if no data is available, or on error! |
248 | */ | 244 | */ |
249 | ssize_t | 245 | ssize_t |
250 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc); | 246 | GNUNET_NETWORK_socket_recvfrom_amount(const struct GNUNET_NETWORK_Handle *desc); |
251 | 247 | ||
252 | 248 | ||
253 | /** | 249 | /** |
@@ -261,11 +257,11 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc) | |||
261 | * @param addrlen length of the addr | 257 | * @param addrlen length of the addr |
262 | */ | 258 | */ |
263 | ssize_t | 259 | ssize_t |
264 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | 260 | GNUNET_NETWORK_socket_recvfrom(const struct GNUNET_NETWORK_Handle *desc, |
265 | void *buffer, | 261 | void *buffer, |
266 | size_t length, | 262 | size_t length, |
267 | struct sockaddr *src_addr, | 263 | struct sockaddr *src_addr, |
268 | socklen_t *addrlen); | 264 | socklen_t *addrlen); |
269 | 265 | ||
270 | 266 | ||
271 | /** | 267 | /** |
@@ -277,9 +273,9 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | |||
277 | * @return number of bytes read | 273 | * @return number of bytes read |
278 | */ | 274 | */ |
279 | ssize_t | 275 | ssize_t |
280 | GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | 276 | GNUNET_NETWORK_socket_recv(const struct GNUNET_NETWORK_Handle *desc, |
281 | void *buffer, | 277 | void *buffer, |
282 | size_t length); | 278 | size_t length); |
283 | 279 | ||
284 | 280 | ||
285 | /** | 281 | /** |
@@ -292,10 +288,10 @@ GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | |||
292 | * @return number of selected sockets, #GNUNET_SYSERR on error | 288 | * @return number of selected sockets, #GNUNET_SYSERR on error |
293 | */ | 289 | */ |
294 | int | 290 | int |
295 | GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | 291 | GNUNET_NETWORK_socket_select(struct GNUNET_NETWORK_FDSet *rfds, |
296 | struct GNUNET_NETWORK_FDSet *wfds, | 292 | struct GNUNET_NETWORK_FDSet *wfds, |
297 | struct GNUNET_NETWORK_FDSet *efds, | 293 | struct GNUNET_NETWORK_FDSet *efds, |
298 | struct GNUNET_TIME_Relative timeout); | 294 | struct GNUNET_TIME_Relative timeout); |
299 | 295 | ||
300 | 296 | ||
301 | /** | 297 | /** |
@@ -307,9 +303,9 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
307 | * @return number of bytes sent, #GNUNET_SYSERR on error | 303 | * @return number of bytes sent, #GNUNET_SYSERR on error |
308 | */ | 304 | */ |
309 | ssize_t | 305 | ssize_t |
310 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | 306 | GNUNET_NETWORK_socket_send(const struct GNUNET_NETWORK_Handle *desc, |
311 | const void *buffer, | 307 | const void *buffer, |
312 | size_t length); | 308 | size_t length); |
313 | 309 | ||
314 | 310 | ||
315 | /** | 311 | /** |
@@ -324,11 +320,11 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | |||
324 | * @return number of bytes sent, #GNUNET_SYSERR on error | 320 | * @return number of bytes sent, #GNUNET_SYSERR on error |
325 | */ | 321 | */ |
326 | ssize_t | 322 | ssize_t |
327 | GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | 323 | GNUNET_NETWORK_socket_sendto(const struct GNUNET_NETWORK_Handle *desc, |
328 | const void *message, | 324 | const void *message, |
329 | size_t length, | 325 | size_t length, |
330 | const struct sockaddr *dest_addr, | 326 | const struct sockaddr *dest_addr, |
331 | socklen_t dest_len); | 327 | socklen_t dest_len); |
332 | 328 | ||
333 | 329 | ||
334 | /** | 330 | /** |
@@ -342,11 +338,11 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | |||
342 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 338 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
343 | */ | 339 | */ |
344 | int | 340 | int |
345 | GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | 341 | GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd, |
346 | int level, | 342 | int level, |
347 | int option_name, | 343 | int option_name, |
348 | const void *option_value, | 344 | const void *option_value, |
349 | socklen_t option_len); | 345 | socklen_t option_len); |
350 | 346 | ||
351 | 347 | ||
352 | /** | 348 | /** |
@@ -357,8 +353,8 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
357 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 353 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
358 | */ | 354 | */ |
359 | int | 355 | int |
360 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 356 | GNUNET_NETWORK_socket_shutdown(struct GNUNET_NETWORK_Handle *desc, |
361 | int how); | 357 | int how); |
362 | 358 | ||
363 | 359 | ||
364 | /** | 360 | /** |
@@ -371,7 +367,7 @@ GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | |||
371 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 367 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
372 | */ | 368 | */ |
373 | int | 369 | int |
374 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | 370 | GNUNET_NETWORK_socket_disable_corking(struct GNUNET_NETWORK_Handle *desc); |
375 | 371 | ||
376 | 372 | ||
377 | /** | 373 | /** |
@@ -385,9 +381,9 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | |||
385 | * @return new socket, NULL on error | 381 | * @return new socket, NULL on error |
386 | */ | 382 | */ |
387 | struct GNUNET_NETWORK_Handle * | 383 | struct GNUNET_NETWORK_Handle * |
388 | GNUNET_NETWORK_socket_create (int domain, | 384 | GNUNET_NETWORK_socket_create(int domain, |
389 | int type, | 385 | int type, |
390 | int protocol); | 386 | int protocol); |
391 | 387 | ||
392 | 388 | ||
393 | /** | 389 | /** |
@@ -396,7 +392,7 @@ GNUNET_NETWORK_socket_create (int domain, | |||
396 | * @param fds fd set to clear | 392 | * @param fds fd set to clear |
397 | */ | 393 | */ |
398 | void | 394 | void |
399 | GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | 395 | GNUNET_NETWORK_fdset_zero(struct GNUNET_NETWORK_FDSet *fds); |
400 | 396 | ||
401 | 397 | ||
402 | /** | 398 | /** |
@@ -406,8 +402,8 @@ GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | |||
406 | * @param desc socket to add | 402 | * @param desc socket to add |
407 | */ | 403 | */ |
408 | void | 404 | void |
409 | GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | 405 | GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds, |
410 | const struct GNUNET_NETWORK_Handle *desc); | 406 | const struct GNUNET_NETWORK_Handle *desc); |
411 | 407 | ||
412 | 408 | ||
413 | #if WINDOWS | 409 | #if WINDOWS |
@@ -418,8 +414,8 @@ GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
418 | * @param h the file handle to add | 414 | * @param h the file handle to add |
419 | */ | 415 | */ |
420 | void | 416 | void |
421 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds, | 417 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle(struct GNUNET_NETWORK_FDSet *fds, |
422 | HANDLE h); | 418 | HANDLE h); |
423 | #endif | 419 | #endif |
424 | 420 | ||
425 | 421 | ||
@@ -431,8 +427,8 @@ GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet * | |||
431 | * @return #GNUNET_YES if the socket is in the set | 427 | * @return #GNUNET_YES if the socket is in the set |
432 | */ | 428 | */ |
433 | int | 429 | int |
434 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 430 | GNUNET_NETWORK_fdset_isset(const struct GNUNET_NETWORK_FDSet *fds, |
435 | const struct GNUNET_NETWORK_Handle *desc); | 431 | const struct GNUNET_NETWORK_Handle *desc); |
436 | 432 | ||
437 | 433 | ||
438 | /** | 434 | /** |
@@ -442,8 +438,8 @@ GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
442 | * @param src the fd set to add from | 438 | * @param src the fd set to add from |
443 | */ | 439 | */ |
444 | void | 440 | void |
445 | GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | 441 | GNUNET_NETWORK_fdset_add(struct GNUNET_NETWORK_FDSet *dst, |
446 | const struct GNUNET_NETWORK_FDSet *src); | 442 | const struct GNUNET_NETWORK_FDSet *src); |
447 | 443 | ||
448 | 444 | ||
449 | /** | 445 | /** |
@@ -453,8 +449,8 @@ GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
453 | * @param from source | 449 | * @param from source |
454 | */ | 450 | */ |
455 | void | 451 | void |
456 | GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | 452 | GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to, |
457 | const struct GNUNET_NETWORK_FDSet *from); | 453 | const struct GNUNET_NETWORK_FDSet *from); |
458 | 454 | ||
459 | 455 | ||
460 | /** | 456 | /** |
@@ -464,7 +460,7 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
464 | * @return POSIX file descriptor | 460 | * @return POSIX file descriptor |
465 | */ | 461 | */ |
466 | int | 462 | int |
467 | GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc); | 463 | GNUNET_NETWORK_get_fd(const struct GNUNET_NETWORK_Handle *desc); |
468 | 464 | ||
469 | 465 | ||
470 | /** | 466 | /** |
@@ -474,7 +470,7 @@ GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc); | |||
474 | * @return POSIX file descriptor | 470 | * @return POSIX file descriptor |
475 | */ | 471 | */ |
476 | struct sockaddr* | 472 | struct sockaddr* |
477 | GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc); | 473 | GNUNET_NETWORK_get_addr(const struct GNUNET_NETWORK_Handle *desc); |
478 | 474 | ||
479 | 475 | ||
480 | /** | 476 | /** |
@@ -484,7 +480,7 @@ GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc); | |||
484 | * @return socklen_t for sockaddr | 480 | * @return socklen_t for sockaddr |
485 | */ | 481 | */ |
486 | socklen_t | 482 | socklen_t |
487 | GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc); | 483 | GNUNET_NETWORK_get_addrlen(const struct GNUNET_NETWORK_Handle *desc); |
488 | 484 | ||
489 | 485 | ||
490 | /** | 486 | /** |
@@ -495,9 +491,9 @@ GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc); | |||
495 | * @param nfds the biggest socket number in from + 1 | 491 | * @param nfds the biggest socket number in from + 1 |
496 | */ | 492 | */ |
497 | void | 493 | void |
498 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | 494 | GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, |
499 | const fd_set *from, | 495 | const fd_set *from, |
500 | int nfds); | 496 | int nfds); |
501 | 497 | ||
502 | 498 | ||
503 | /** | 499 | /** |
@@ -507,8 +503,8 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | |||
507 | * @param nfd native FD to set | 503 | * @param nfd native FD to set |
508 | */ | 504 | */ |
509 | void | 505 | void |
510 | GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, | 506 | GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, |
511 | int nfd); | 507 | int nfd); |
512 | 508 | ||
513 | 509 | ||
514 | /** | 510 | /** |
@@ -519,8 +515,8 @@ GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, | |||
519 | * @return #GNUNET_YES if to contains nfd | 515 | * @return #GNUNET_YES if to contains nfd |
520 | */ | 516 | */ |
521 | int | 517 | int |
522 | GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | 518 | GNUNET_NETWORK_fdset_test_native(const struct GNUNET_NETWORK_FDSet *to, |
523 | int nfd); | 519 | int nfd); |
524 | 520 | ||
525 | 521 | ||
526 | /** | 522 | /** |
@@ -530,8 +526,8 @@ GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | |||
530 | * @param h the file handle to add | 526 | * @param h the file handle to add |
531 | */ | 527 | */ |
532 | void | 528 | void |
533 | GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | 529 | GNUNET_NETWORK_fdset_handle_set(struct GNUNET_NETWORK_FDSet *fds, |
534 | const struct GNUNET_DISK_FileHandle *h); | 530 | const struct GNUNET_DISK_FileHandle *h); |
535 | 531 | ||
536 | 532 | ||
537 | /** | 533 | /** |
@@ -542,8 +538,8 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | |||
542 | * @param h the file handle to add | 538 | * @param h the file handle to add |
543 | */ | 539 | */ |
544 | void | 540 | void |
545 | GNUNET_NETWORK_fdset_handle_set_first (struct GNUNET_NETWORK_FDSet *fds, | 541 | GNUNET_NETWORK_fdset_handle_set_first(struct GNUNET_NETWORK_FDSet *fds, |
546 | const struct GNUNET_DISK_FileHandle *h); | 542 | const struct GNUNET_DISK_FileHandle *h); |
547 | 543 | ||
548 | 544 | ||
549 | /** | 545 | /** |
@@ -554,8 +550,8 @@ GNUNET_NETWORK_fdset_handle_set_first (struct GNUNET_NETWORK_FDSet *fds, | |||
554 | * @return #GNUNET_YES if the file handle is part of the set | 550 | * @return #GNUNET_YES if the file handle is part of the set |
555 | */ | 551 | */ |
556 | int | 552 | int |
557 | GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | 553 | GNUNET_NETWORK_fdset_handle_isset(const struct GNUNET_NETWORK_FDSet *fds, |
558 | const struct GNUNET_DISK_FileHandle *h); | 554 | const struct GNUNET_DISK_FileHandle *h); |
559 | 555 | ||
560 | 556 | ||
561 | /** | 557 | /** |
@@ -566,8 +562,8 @@ GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
566 | * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise | 562 | * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise |
567 | */ | 563 | */ |
568 | int | 564 | int |
569 | GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | 565 | GNUNET_NETWORK_fdset_overlap(const struct GNUNET_NETWORK_FDSet *fds1, |
570 | const struct GNUNET_NETWORK_FDSet *fds2); | 566 | const struct GNUNET_NETWORK_FDSet *fds2); |
571 | 567 | ||
572 | 568 | ||
573 | /** | 569 | /** |
@@ -576,7 +572,7 @@ GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | |||
576 | * @return a new fd set | 572 | * @return a new fd set |
577 | */ | 573 | */ |
578 | struct GNUNET_NETWORK_FDSet * | 574 | struct GNUNET_NETWORK_FDSet * |
579 | GNUNET_NETWORK_fdset_create (void); | 575 | GNUNET_NETWORK_fdset_create(void); |
580 | 576 | ||
581 | 577 | ||
582 | /** | 578 | /** |
@@ -585,7 +581,7 @@ GNUNET_NETWORK_fdset_create (void); | |||
585 | * @param fds fd set | 581 | * @param fds fd set |
586 | */ | 582 | */ |
587 | void | 583 | void |
588 | GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | 584 | GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds); |
589 | 585 | ||
590 | 586 | ||
591 | /** | 587 | /** |
@@ -596,8 +592,8 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | |||
596 | * @return #GNUNET_OK if the port is available, #GNUNET_NO if not | 592 | * @return #GNUNET_OK if the port is available, #GNUNET_NO if not |
597 | */ | 593 | */ |
598 | int | 594 | int |
599 | GNUNET_NETWORK_test_port_free (int ipproto, | 595 | GNUNET_NETWORK_test_port_free(int ipproto, |
600 | uint16_t port); | 596 | uint16_t port); |
601 | 597 | ||
602 | 598 | ||
603 | #if 0 /* keep Emacsens' auto-indent happy */ | 599 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h index 08282058a..31b128533 100644 --- a/src/include/gnunet_nse_service.h +++ b/src/include/gnunet_nse_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -92,8 +92,8 @@ typedef void (*GNUNET_NSE_Callback) (void *cls, | |||
92 | * @return handle to use in #GNUNET_NSE_disconnect to stop NSE from invoking the callbacks | 92 | * @return handle to use in #GNUNET_NSE_disconnect to stop NSE from invoking the callbacks |
93 | */ | 93 | */ |
94 | struct GNUNET_NSE_Handle * | 94 | struct GNUNET_NSE_Handle * |
95 | GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 95 | GNUNET_NSE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
96 | GNUNET_NSE_Callback func, void *func_cls); | 96 | GNUNET_NSE_Callback func, void *func_cls); |
97 | 97 | ||
98 | 98 | ||
99 | /** | 99 | /** |
@@ -102,7 +102,7 @@ GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
102 | * @param h handle to destroy | 102 | * @param h handle to destroy |
103 | */ | 103 | */ |
104 | void | 104 | void |
105 | GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); | 105 | GNUNET_NSE_disconnect(struct GNUNET_NSE_Handle *h); |
106 | 106 | ||
107 | 107 | ||
108 | #if 0 /* keep Emacsens' auto-indent happy */ | 108 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nt_lib.h b/src/include/gnunet_nt_lib.h index 1da92a79a..48f3d7352 100644 --- a/src/include/gnunet_nt_lib.h +++ b/src/include/gnunet_nt_lib.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. | 3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -32,8 +32,7 @@ | |||
32 | /** | 32 | /** |
33 | * Types of networks (with separate quotas) we support. | 33 | * Types of networks (with separate quotas) we support. |
34 | */ | 34 | */ |
35 | enum GNUNET_NetworkType | 35 | enum GNUNET_NetworkType { |
36 | { | ||
37 | /** | 36 | /** |
38 | * Category of last resort. | 37 | * Category of last resort. |
39 | */ | 38 | */ |
@@ -68,7 +67,6 @@ enum GNUNET_NetworkType | |||
68 | * Number of network types supported by ATS | 67 | * Number of network types supported by ATS |
69 | */ | 68 | */ |
70 | #define GNUNET_NT_COUNT 6 | 69 | #define GNUNET_NT_COUNT 6 |
71 | |||
72 | }; | 70 | }; |
73 | 71 | ||
74 | 72 | ||
@@ -79,7 +77,7 @@ enum GNUNET_NetworkType | |||
79 | * @return a string or NULL if invalid | 77 | * @return a string or NULL if invalid |
80 | */ | 78 | */ |
81 | const char * | 79 | const char * |
82 | GNUNET_NT_to_string (enum GNUNET_NetworkType net); | 80 | GNUNET_NT_to_string(enum GNUNET_NetworkType net); |
83 | 81 | ||
84 | 82 | ||
85 | /** | 83 | /** |
@@ -97,9 +95,9 @@ struct GNUNET_NT_InterfaceScanner; | |||
97 | * @return type of the network the address belongs to | 95 | * @return type of the network the address belongs to |
98 | */ | 96 | */ |
99 | enum GNUNET_NetworkType | 97 | enum GNUNET_NetworkType |
100 | GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is, | 98 | GNUNET_NT_scanner_get_type(struct GNUNET_NT_InterfaceScanner *is, |
101 | const struct sockaddr *addr, | 99 | const struct sockaddr *addr, |
102 | socklen_t addrlen); | 100 | socklen_t addrlen); |
103 | 101 | ||
104 | 102 | ||
105 | /** | 103 | /** |
@@ -108,7 +106,7 @@ GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is, | |||
108 | * @return scanner handle, NULL on error | 106 | * @return scanner handle, NULL on error |
109 | */ | 107 | */ |
110 | struct GNUNET_NT_InterfaceScanner * | 108 | struct GNUNET_NT_InterfaceScanner * |
111 | GNUNET_NT_scanner_init (void); | 109 | GNUNET_NT_scanner_init(void); |
112 | 110 | ||
113 | 111 | ||
114 | /** | 112 | /** |
@@ -117,7 +115,7 @@ GNUNET_NT_scanner_init (void); | |||
117 | * @param is scanner we are done with | 115 | * @param is scanner we are done with |
118 | */ | 116 | */ |
119 | void | 117 | void |
120 | GNUNET_NT_scanner_done (struct GNUNET_NT_InterfaceScanner *is); | 118 | GNUNET_NT_scanner_done(struct GNUNET_NT_InterfaceScanner *is); |
121 | 119 | ||
122 | 120 | ||
123 | #endif | 121 | #endif |
diff --git a/src/include/gnunet_op_lib.h b/src/include/gnunet_op_lib.h index d04577e2d..c96db354d 100644 --- a/src/include/gnunet_op_lib.h +++ b/src/include/gnunet_op_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file | 22 | * @file |
@@ -40,14 +40,14 @@ struct GNUNET_OP_Handle; | |||
40 | * Create new operations handle. | 40 | * Create new operations handle. |
41 | */ | 41 | */ |
42 | struct GNUNET_OP_Handle * | 42 | struct GNUNET_OP_Handle * |
43 | GNUNET_OP_create (); | 43 | GNUNET_OP_create(); |
44 | 44 | ||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Destroy operations handle. | 47 | * Destroy operations handle. |
48 | */ | 48 | */ |
49 | void | 49 | void |
50 | GNUNET_OP_destroy (struct GNUNET_OP_Handle *h); | 50 | GNUNET_OP_destroy(struct GNUNET_OP_Handle *h); |
51 | 51 | ||
52 | 52 | ||
53 | /** | 53 | /** |
@@ -59,7 +59,7 @@ GNUNET_OP_destroy (struct GNUNET_OP_Handle *h); | |||
59 | * @return Operation ID to use. | 59 | * @return Operation ID to use. |
60 | */ | 60 | */ |
61 | uint64_t | 61 | uint64_t |
62 | GNUNET_OP_get_next_id (struct GNUNET_OP_Handle *h); | 62 | GNUNET_OP_get_next_id(struct GNUNET_OP_Handle *h); |
63 | 63 | ||
64 | 64 | ||
65 | /** | 65 | /** |
@@ -80,11 +80,11 @@ GNUNET_OP_get_next_id (struct GNUNET_OP_Handle *h); | |||
80 | * #GNUNET_NO if not found. | 80 | * #GNUNET_NO if not found. |
81 | */ | 81 | */ |
82 | int | 82 | int |
83 | GNUNET_OP_get (struct GNUNET_OP_Handle *h, | 83 | GNUNET_OP_get(struct GNUNET_OP_Handle *h, |
84 | uint64_t op_id, | 84 | uint64_t op_id, |
85 | GNUNET_ResultCallback *result_cb, | 85 | GNUNET_ResultCallback *result_cb, |
86 | void **cls, | 86 | void **cls, |
87 | void **ctx); | 87 | void **ctx); |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
@@ -102,10 +102,10 @@ GNUNET_OP_get (struct GNUNET_OP_Handle *h, | |||
102 | * @return ID of the new operation. | 102 | * @return ID of the new operation. |
103 | */ | 103 | */ |
104 | uint64_t | 104 | uint64_t |
105 | GNUNET_OP_add (struct GNUNET_OP_Handle *h, | 105 | GNUNET_OP_add(struct GNUNET_OP_Handle *h, |
106 | GNUNET_ResultCallback result_cb, | 106 | GNUNET_ResultCallback result_cb, |
107 | void *cls, | 107 | void *cls, |
108 | void *ctx); | 108 | void *ctx); |
109 | 109 | ||
110 | 110 | ||
111 | /** | 111 | /** |
@@ -128,12 +128,12 @@ GNUNET_OP_add (struct GNUNET_OP_Handle *h, | |||
128 | * #GNUNET_NO if the operation was not found. | 128 | * #GNUNET_NO if the operation was not found. |
129 | */ | 129 | */ |
130 | int | 130 | int |
131 | GNUNET_OP_result (struct GNUNET_OP_Handle *h, | 131 | GNUNET_OP_result(struct GNUNET_OP_Handle *h, |
132 | uint64_t op_id, | 132 | uint64_t op_id, |
133 | int64_t result_code, | 133 | int64_t result_code, |
134 | const void *data, | 134 | const void *data, |
135 | uint16_t data_size, | 135 | uint16_t data_size, |
136 | void **ctx); | 136 | void **ctx); |
137 | 137 | ||
138 | 138 | ||
139 | /** | 139 | /** |
@@ -148,8 +148,8 @@ GNUNET_OP_result (struct GNUNET_OP_Handle *h, | |||
148 | * #GNUNET_NO if the operation was not found. | 148 | * #GNUNET_NO if the operation was not found. |
149 | */ | 149 | */ |
150 | int | 150 | int |
151 | GNUNET_OP_remove (struct GNUNET_OP_Handle *h, | 151 | GNUNET_OP_remove(struct GNUNET_OP_Handle *h, |
152 | uint64_t op_id); | 152 | uint64_t op_id); |
153 | 153 | ||
154 | 154 | ||
155 | #endif // GNUNET_OP_H | 155 | #endif // GNUNET_OP_H |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index b632ab262..e5bc7146b 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -65,9 +65,7 @@ extern "C" | |||
65 | * Flags that determine which of the standard streams | 65 | * Flags that determine which of the standard streams |
66 | * should be inherited by the child process. | 66 | * should be inherited by the child process. |
67 | */ | 67 | */ |
68 | enum GNUNET_OS_InheritStdioFlags | 68 | enum GNUNET_OS_InheritStdioFlags { |
69 | { | ||
70 | |||
71 | /** | 69 | /** |
72 | * No standard streams should be inherited. | 70 | * No standard streams should be inherited. |
73 | */ | 71 | */ |
@@ -114,8 +112,7 @@ struct GNUNET_OS_Process; | |||
114 | /** | 112 | /** |
115 | * Possible installation paths to request | 113 | * Possible installation paths to request |
116 | */ | 114 | */ |
117 | enum GNUNET_OS_InstallationPathKind | 115 | enum GNUNET_OS_InstallationPathKind { |
118 | { | ||
119 | /** | 116 | /** |
120 | * Return the "PREFIX" directory given to configure. | 117 | * Return the "PREFIX" directory given to configure. |
121 | */ | 118 | */ |
@@ -169,8 +166,7 @@ enum GNUNET_OS_InstallationPathKind | |||
169 | /** | 166 | /** |
170 | * Process status types | 167 | * Process status types |
171 | */ | 168 | */ |
172 | enum GNUNET_OS_ProcessStatusType | 169 | enum GNUNET_OS_ProcessStatusType { |
173 | { | ||
174 | /** | 170 | /** |
175 | * The process is not known to the OS (or at | 171 | * The process is not known to the OS (or at |
176 | * least not one of our children). | 172 | * least not one of our children). |
@@ -203,8 +199,7 @@ enum GNUNET_OS_ProcessStatusType | |||
203 | * Project-specific data used to help the OS subsystem | 199 | * Project-specific data used to help the OS subsystem |
204 | * find installation paths. | 200 | * find installation paths. |
205 | */ | 201 | */ |
206 | struct GNUNET_OS_ProjectData | 202 | struct GNUNET_OS_ProjectData { |
207 | { | ||
208 | /** | 203 | /** |
209 | * Name of a library that is installed in the "lib/" directory of | 204 | * Name of a library that is installed in the "lib/" directory of |
210 | * the project, such as "libgnunetutil". Used to locate the | 205 | * the project, such as "libgnunetutil". Used to locate the |
@@ -295,14 +290,14 @@ struct GNUNET_OS_ProjectData | |||
295 | * Return default project data used by 'libgnunetutil' for GNUnet. | 290 | * Return default project data used by 'libgnunetutil' for GNUnet. |
296 | */ | 291 | */ |
297 | const struct GNUNET_OS_ProjectData * | 292 | const struct GNUNET_OS_ProjectData * |
298 | GNUNET_OS_project_data_default (void); | 293 | GNUNET_OS_project_data_default(void); |
299 | 294 | ||
300 | 295 | ||
301 | /** | 296 | /** |
302 | * @return current (actual) project data. | 297 | * @return current (actual) project data. |
303 | */ | 298 | */ |
304 | const struct GNUNET_OS_ProjectData * | 299 | const struct GNUNET_OS_ProjectData * |
305 | GNUNET_OS_project_data_get (void); | 300 | GNUNET_OS_project_data_get(void); |
306 | 301 | ||
307 | 302 | ||
308 | /** | 303 | /** |
@@ -311,7 +306,7 @@ GNUNET_OS_project_data_get (void); | |||
311 | * @param pd project data used to determine paths. | 306 | * @param pd project data used to determine paths. |
312 | */ | 307 | */ |
313 | void | 308 | void |
314 | GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd); | 309 | GNUNET_OS_init(const struct GNUNET_OS_ProjectData *pd); |
315 | 310 | ||
316 | 311 | ||
317 | /** | 312 | /** |
@@ -323,7 +318,7 @@ GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd); | |||
323 | * @return a pointer to the dir path (to be freed by the caller) | 318 | * @return a pointer to the dir path (to be freed by the caller) |
324 | */ | 319 | */ |
325 | char * | 320 | char * |
326 | GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); | 321 | GNUNET_OS_installation_get_path(enum GNUNET_OS_InstallationPathKind dirkind); |
327 | 322 | ||
328 | 323 | ||
329 | /** | 324 | /** |
@@ -335,7 +330,7 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); | |||
335 | * @return full path to the binary, if possible, otherwise copy of 'progname' | 330 | * @return full path to the binary, if possible, otherwise copy of 'progname' |
336 | */ | 331 | */ |
337 | char * | 332 | char * |
338 | GNUNET_OS_get_libexec_binary_path (const char *progname); | 333 | GNUNET_OS_get_libexec_binary_path(const char *progname); |
339 | 334 | ||
340 | 335 | ||
341 | /** | 336 | /** |
@@ -351,8 +346,8 @@ GNUNET_OS_get_libexec_binary_path (const char *progname); | |||
351 | * otherwise | 346 | * otherwise |
352 | */ | 347 | */ |
353 | char * | 348 | char * |
354 | GNUNET_OS_get_suid_binary_path (const struct GNUNET_CONFIGURATION_Handle *cfg, | 349 | GNUNET_OS_get_suid_binary_path(const struct GNUNET_CONFIGURATION_Handle *cfg, |
355 | const char *progname); | 350 | const char *progname); |
356 | 351 | ||
357 | 352 | ||
358 | /** | 353 | /** |
@@ -384,8 +379,8 @@ typedef int | |||
384 | * @param proc_cls closure for @a proc | 379 | * @param proc_cls closure for @a proc |
385 | */ | 380 | */ |
386 | void | 381 | void |
387 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, | 382 | GNUNET_OS_network_interfaces_list(GNUNET_OS_NetworkInterfaceProcessor proc, |
388 | void *proc_cls); | 383 | void *proc_cls); |
389 | 384 | ||
390 | /** | 385 | /** |
391 | * @brief Get maximum string length returned by gethostname() | 386 | * @brief Get maximum string length returned by gethostname() |
@@ -408,7 +403,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, | |||
408 | * @return pointer to the process sturcutre for this process | 403 | * @return pointer to the process sturcutre for this process |
409 | */ | 404 | */ |
410 | struct GNUNET_OS_Process * | 405 | struct GNUNET_OS_Process * |
411 | GNUNET_OS_process_current (void); | 406 | GNUNET_OS_process_current(void); |
412 | 407 | ||
413 | 408 | ||
414 | /** | 409 | /** |
@@ -419,8 +414,8 @@ GNUNET_OS_process_current (void); | |||
419 | * @return 0 on success, -1 on error | 414 | * @return 0 on success, -1 on error |
420 | */ | 415 | */ |
421 | int | 416 | int |
422 | GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, | 417 | GNUNET_OS_process_kill(struct GNUNET_OS_Process *proc, |
423 | int sig); | 418 | int sig); |
424 | 419 | ||
425 | 420 | ||
426 | /** | 421 | /** |
@@ -429,7 +424,7 @@ GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, | |||
429 | * @param proc pointer to process structure | 424 | * @param proc pointer to process structure |
430 | */ | 425 | */ |
431 | void | 426 | void |
432 | GNUNET_OS_process_destroy (struct GNUNET_OS_Process *proc); | 427 | GNUNET_OS_process_destroy(struct GNUNET_OS_Process *proc); |
433 | 428 | ||
434 | 429 | ||
435 | /** | 430 | /** |
@@ -440,7 +435,7 @@ GNUNET_OS_process_destroy (struct GNUNET_OS_Process *proc); | |||
440 | * @return the current process id | 435 | * @return the current process id |
441 | */ | 436 | */ |
442 | pid_t | 437 | pid_t |
443 | GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | 438 | GNUNET_OS_process_get_pid(struct GNUNET_OS_Process *proc); |
444 | 439 | ||
445 | 440 | ||
446 | /** | 441 | /** |
@@ -456,13 +451,13 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | |||
456 | * @return pointer to process structure of the new process, NULL on error | 451 | * @return pointer to process structure of the new process, NULL on error |
457 | */ | 452 | */ |
458 | struct GNUNET_OS_Process * | 453 | struct GNUNET_OS_Process * |
459 | GNUNET_OS_start_process_vap (int pipe_control, | 454 | GNUNET_OS_start_process_vap(int pipe_control, |
460 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 455 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
461 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 456 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
462 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 457 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
463 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | 458 | struct GNUNET_DISK_PipeHandle *pipe_stderr, |
464 | const char *filename, | 459 | const char *filename, |
465 | char *const argv[]); | 460 | char *const argv[]); |
466 | 461 | ||
467 | 462 | ||
468 | /** | 463 | /** |
@@ -478,12 +473,12 @@ GNUNET_OS_start_process_vap (int pipe_control, | |||
478 | * @return pointer to process structure of the new process, NULL on error | 473 | * @return pointer to process structure of the new process, NULL on error |
479 | */ | 474 | */ |
480 | struct GNUNET_OS_Process * | 475 | struct GNUNET_OS_Process * |
481 | GNUNET_OS_start_process (int pipe_control, | 476 | GNUNET_OS_start_process(int pipe_control, |
482 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 477 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
483 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 478 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
484 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 479 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
485 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | 480 | struct GNUNET_DISK_PipeHandle *pipe_stderr, |
486 | const char *filename, ...); | 481 | const char *filename, ...); |
487 | 482 | ||
488 | 483 | ||
489 | /** | 484 | /** |
@@ -499,12 +494,12 @@ GNUNET_OS_start_process (int pipe_control, | |||
499 | * @return pointer to process structure of the new process, NULL on error | 494 | * @return pointer to process structure of the new process, NULL on error |
500 | */ | 495 | */ |
501 | struct GNUNET_OS_Process * | 496 | struct GNUNET_OS_Process * |
502 | GNUNET_OS_start_process_va (int pipe_control, | 497 | GNUNET_OS_start_process_va(int pipe_control, |
503 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 498 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
504 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 499 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
505 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 500 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
506 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | 501 | struct GNUNET_DISK_PipeHandle *pipe_stderr, |
507 | const char *filename, va_list va); | 502 | const char *filename, va_list va); |
508 | 503 | ||
509 | /** | 504 | /** |
510 | * Start a process. | 505 | * Start a process. |
@@ -519,11 +514,11 @@ GNUNET_OS_start_process_va (int pipe_control, | |||
519 | * @return pointer to process structure of the new process, NULL on error | 514 | * @return pointer to process structure of the new process, NULL on error |
520 | */ | 515 | */ |
521 | struct GNUNET_OS_Process * | 516 | struct GNUNET_OS_Process * |
522 | GNUNET_OS_start_process_v (int pipe_control, | 517 | GNUNET_OS_start_process_v(int pipe_control, |
523 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 518 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
524 | const SOCKTYPE *lsocks, | 519 | const SOCKTYPE *lsocks, |
525 | const char *filename, | 520 | const char *filename, |
526 | char *const argv[]); | 521 | char *const argv[]); |
527 | 522 | ||
528 | 523 | ||
529 | /** | 524 | /** |
@@ -545,10 +540,10 @@ GNUNET_OS_start_process_v (int pipe_control, | |||
545 | * @return pointer to process structure of the new process, NULL on error | 540 | * @return pointer to process structure of the new process, NULL on error |
546 | */ | 541 | */ |
547 | struct GNUNET_OS_Process * | 542 | struct GNUNET_OS_Process * |
548 | GNUNET_OS_start_process_s (int pipe_control, | 543 | GNUNET_OS_start_process_s(int pipe_control, |
549 | unsigned int std_inheritance, | 544 | unsigned int std_inheritance, |
550 | const SOCKTYPE * lsocks, | 545 | const SOCKTYPE * lsocks, |
551 | const char *filename, ...); | 546 | const char *filename, ...); |
552 | 547 | ||
553 | 548 | ||
554 | /** | 549 | /** |
@@ -573,7 +568,7 @@ typedef void | |||
573 | * @param cmd handle to the process | 568 | * @param cmd handle to the process |
574 | */ | 569 | */ |
575 | void | 570 | void |
576 | GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | 571 | GNUNET_OS_command_stop(struct GNUNET_OS_CommandHandle *cmd); |
577 | 572 | ||
578 | 573 | ||
579 | /** | 574 | /** |
@@ -588,11 +583,11 @@ GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | |||
588 | * @return NULL on error | 583 | * @return NULL on error |
589 | */ | 584 | */ |
590 | struct GNUNET_OS_CommandHandle * | 585 | struct GNUNET_OS_CommandHandle * |
591 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, | 586 | GNUNET_OS_command_run(GNUNET_OS_LineProcessor proc, |
592 | void *proc_cls, | 587 | void *proc_cls, |
593 | struct GNUNET_TIME_Relative timeout, | 588 | struct GNUNET_TIME_Relative timeout, |
594 | const char *binary, | 589 | const char *binary, |
595 | ...); | 590 | ...); |
596 | 591 | ||
597 | 592 | ||
598 | /** | 593 | /** |
@@ -605,9 +600,9 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, | |||
605 | * @return #GNUNET_OK on success, #GNUNET_NO if the process is still running, #GNUNET_SYSERR otherwise | 600 | * @return #GNUNET_OK on success, #GNUNET_NO if the process is still running, #GNUNET_SYSERR otherwise |
606 | */ | 601 | */ |
607 | int | 602 | int |
608 | GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | 603 | GNUNET_OS_process_status(struct GNUNET_OS_Process *proc, |
609 | enum GNUNET_OS_ProcessStatusType *type, | 604 | enum GNUNET_OS_ProcessStatusType *type, |
610 | unsigned long *code); | 605 | unsigned long *code); |
611 | 606 | ||
612 | 607 | ||
613 | /** | 608 | /** |
@@ -621,7 +616,7 @@ GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | |||
621 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 616 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
622 | */ | 617 | */ |
623 | int | 618 | int |
624 | GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | 619 | GNUNET_OS_process_wait(struct GNUNET_OS_Process *proc); |
625 | 620 | ||
626 | 621 | ||
627 | 622 | ||
@@ -635,9 +630,9 @@ GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | |||
635 | * @return #GNUNET_OK on success, #GNUNET_NO if the process is still running, #GNUNET_SYSERR otherwise | 630 | * @return #GNUNET_OK on success, #GNUNET_NO if the process is still running, #GNUNET_SYSERR otherwise |
636 | */ | 631 | */ |
637 | int | 632 | int |
638 | GNUNET_OS_process_wait_status (struct GNUNET_OS_Process *proc, | 633 | GNUNET_OS_process_wait_status(struct GNUNET_OS_Process *proc, |
639 | enum GNUNET_OS_ProcessStatusType *type, | 634 | enum GNUNET_OS_ProcessStatusType *type, |
640 | unsigned long *code); | 635 | unsigned long *code); |
641 | 636 | ||
642 | 637 | ||
643 | /** | 638 | /** |
@@ -649,7 +644,7 @@ GNUNET_OS_process_wait_status (struct GNUNET_OS_Process *proc, | |||
649 | * @param cls closure (unused) | 644 | * @param cls closure (unused) |
650 | */ | 645 | */ |
651 | void | 646 | void |
652 | GNUNET_OS_install_parent_control_handler (void *cls); | 647 | GNUNET_OS_install_parent_control_handler(void *cls); |
653 | 648 | ||
654 | 649 | ||
655 | /** | 650 | /** |
@@ -670,9 +665,9 @@ GNUNET_OS_install_parent_control_handler (void *cls); | |||
670 | * #GNUNET_SYSERR on error (no such binary or not executable) | 665 | * #GNUNET_SYSERR on error (no such binary or not executable) |
671 | */ | 666 | */ |
672 | int | 667 | int |
673 | GNUNET_OS_check_helper_binary (const char *binary, | 668 | GNUNET_OS_check_helper_binary(const char *binary, |
674 | int check_suid, | 669 | int check_suid, |
675 | const char *params); | 670 | const char *params); |
676 | 671 | ||
677 | 672 | ||
678 | #if 0 /* keep Emacsens' auto-indent happy */ | 673 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_peer_lib.h b/src/include/gnunet_peer_lib.h index b1c7220e2..e7caa1062 100644 --- a/src/include/gnunet_peer_lib.h +++ b/src/include/gnunet_peer_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -58,7 +58,7 @@ typedef unsigned int GNUNET_PEER_Id; | |||
58 | * @return the interned identity or 0. | 58 | * @return the interned identity or 0. |
59 | */ | 59 | */ |
60 | GNUNET_PEER_Id | 60 | GNUNET_PEER_Id |
61 | GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | 61 | GNUNET_PEER_search(const struct GNUNET_PeerIdentity *pid); |
62 | 62 | ||
63 | 63 | ||
64 | /** | 64 | /** |
@@ -69,7 +69,7 @@ GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | |||
69 | * @return the interned identity. | 69 | * @return the interned identity. |
70 | */ | 70 | */ |
71 | GNUNET_PEER_Id | 71 | GNUNET_PEER_Id |
72 | GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | 72 | GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -79,7 +79,7 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | |||
79 | * @param delta how much to change the RC | 79 | * @param delta how much to change the RC |
80 | */ | 80 | */ |
81 | void | 81 | void |
82 | GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | 82 | GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta); |
83 | 83 | ||
84 | 84 | ||
85 | /** | 85 | /** |
@@ -89,8 +89,8 @@ GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | |||
89 | * @param count size of the @a ids array | 89 | * @param count size of the @a ids array |
90 | */ | 90 | */ |
91 | void | 91 | void |
92 | GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, | 92 | GNUNET_PEER_decrement_rcs(const GNUNET_PEER_Id *ids, |
93 | unsigned int count); | 93 | unsigned int count); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -100,8 +100,8 @@ GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, | |||
100 | * @param pid where to write the normal peer identity | 100 | * @param pid where to write the normal peer identity |
101 | */ | 101 | */ |
102 | void | 102 | void |
103 | GNUNET_PEER_resolve (GNUNET_PEER_Id id, | 103 | GNUNET_PEER_resolve(GNUNET_PEER_Id id, |
104 | struct GNUNET_PeerIdentity *pid); | 104 | struct GNUNET_PeerIdentity *pid); |
105 | 105 | ||
106 | 106 | ||
107 | /** | 107 | /** |
@@ -111,7 +111,7 @@ GNUNET_PEER_resolve (GNUNET_PEER_Id id, | |||
111 | * @return pointer to peer identity, valid as long @a id is valid | 111 | * @return pointer to peer identity, valid as long @a id is valid |
112 | */ | 112 | */ |
113 | const struct GNUNET_PeerIdentity * | 113 | const struct GNUNET_PeerIdentity * |
114 | GNUNET_PEER_resolve2 (GNUNET_PEER_Id id); | 114 | GNUNET_PEER_resolve2(GNUNET_PEER_Id id); |
115 | 115 | ||
116 | 116 | ||
117 | #if 0 /* keep Emacsens' auto-indent happy */ | 117 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 6fc48f806..f7663c43e 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -64,7 +64,7 @@ struct GNUNET_PEERINFO_Handle; | |||
64 | * etablishment may happen asynchronously). | 64 | * etablishment may happen asynchronously). |
65 | */ | 65 | */ |
66 | struct GNUNET_PEERINFO_Handle * | 66 | struct GNUNET_PEERINFO_Handle * |
67 | GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 67 | GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
68 | 68 | ||
69 | 69 | ||
70 | /** | 70 | /** |
@@ -77,7 +77,7 @@ GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
77 | * @param h handle to disconnect | 77 | * @param h handle to disconnect |
78 | */ | 78 | */ |
79 | void | 79 | void |
80 | GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | 80 | GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h); |
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
@@ -99,10 +99,10 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | |||
99 | * calling @a cont must be prevented) | 99 | * calling @a cont must be prevented) |
100 | */ | 100 | */ |
101 | struct GNUNET_MQ_Envelope * | 101 | struct GNUNET_MQ_Envelope * |
102 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | 102 | GNUNET_PEERINFO_add_peer(struct GNUNET_PEERINFO_Handle *h, |
103 | const struct GNUNET_HELLO_Message *hello, | 103 | const struct GNUNET_HELLO_Message *hello, |
104 | GNUNET_SCHEDULER_TaskCallback cont, | 104 | GNUNET_SCHEDULER_TaskCallback cont, |
105 | void *cont_cls); | 105 | void *cont_cls); |
106 | 106 | ||
107 | 107 | ||
108 | /** | 108 | /** |
@@ -145,11 +145,11 @@ struct GNUNET_PEERINFO_IteratorContext; | |||
145 | * @return iterator context | 145 | * @return iterator context |
146 | */ | 146 | */ |
147 | struct GNUNET_PEERINFO_IteratorContext * | 147 | struct GNUNET_PEERINFO_IteratorContext * |
148 | GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, | 148 | GNUNET_PEERINFO_iterate(struct GNUNET_PEERINFO_Handle *h, |
149 | int include_friend_only, | 149 | int include_friend_only, |
150 | const struct GNUNET_PeerIdentity *peer, | 150 | const struct GNUNET_PeerIdentity *peer, |
151 | GNUNET_PEERINFO_Processor callback, | 151 | GNUNET_PEERINFO_Processor callback, |
152 | void *callback_cls); | 152 | void *callback_cls); |
153 | 153 | ||
154 | 154 | ||
155 | /** | 155 | /** |
@@ -158,7 +158,7 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, | |||
158 | * @param ic context of the iterator to cancel | 158 | * @param ic context of the iterator to cancel |
159 | */ | 159 | */ |
160 | void | 160 | void |
161 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic); | 161 | GNUNET_PEERINFO_iterate_cancel(struct GNUNET_PEERINFO_IteratorContext *ic); |
162 | 162 | ||
163 | 163 | ||
164 | /** | 164 | /** |
@@ -183,10 +183,10 @@ struct GNUNET_PEERINFO_NotifyContext; | |||
183 | * @return NULL on error | 183 | * @return NULL on error |
184 | */ | 184 | */ |
185 | struct GNUNET_PEERINFO_NotifyContext * | 185 | struct GNUNET_PEERINFO_NotifyContext * |
186 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | 186 | GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, |
187 | int include_friend_only, | 187 | int include_friend_only, |
188 | GNUNET_PEERINFO_Processor callback, | 188 | GNUNET_PEERINFO_Processor callback, |
189 | void *callback_cls); | 189 | void *callback_cls); |
190 | 190 | ||
191 | 191 | ||
192 | /** | 192 | /** |
@@ -195,7 +195,7 @@ GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
195 | * @param nc context to stop notifying | 195 | * @param nc context to stop notifying |
196 | */ | 196 | */ |
197 | void | 197 | void |
198 | GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); | 198 | GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc); |
199 | 199 | ||
200 | 200 | ||
201 | #if 0 /* keep Emacsens' auto-indent happy */ | 201 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_peerstore_plugin.h b/src/include/gnunet_peerstore_plugin.h index bd5d18068..20130dec2 100644 --- a/src/include/gnunet_peerstore_plugin.h +++ b/src/include/gnunet_peerstore_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Omar Tarabai | 22 | * @author Omar Tarabai |
@@ -46,9 +46,7 @@ extern "C" | |||
46 | /** | 46 | /** |
47 | * @brief struct returned by the initialization function of the plugin | 47 | * @brief struct returned by the initialization function of the plugin |
48 | */ | 48 | */ |
49 | struct GNUNET_PEERSTORE_PluginFunctions | 49 | struct GNUNET_PEERSTORE_PluginFunctions { |
50 | { | ||
51 | |||
52 | /** | 50 | /** |
53 | * Closure to pass to all plugin functions. | 51 | * Closure to pass to all plugin functions. |
54 | */ | 52 | */ |
@@ -119,7 +117,6 @@ struct GNUNET_PEERSTORE_PluginFunctions | |||
119 | struct GNUNET_TIME_Absolute now, | 117 | struct GNUNET_TIME_Absolute now, |
120 | GNUNET_PEERSTORE_Continuation cont, | 118 | GNUNET_PEERSTORE_Continuation cont, |
121 | void *cont_cls); | 119 | void *cont_cls); |
122 | |||
123 | }; | 120 | }; |
124 | 121 | ||
125 | 122 | ||
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h index ad80a3fa3..ac390ada2 100644 --- a/src/include/gnunet_peerstore_service.h +++ b/src/include/gnunet_peerstore_service.h | |||
@@ -71,9 +71,7 @@ extern "C" { | |||
71 | /** | 71 | /** |
72 | * Options for storing values in PEERSTORE | 72 | * Options for storing values in PEERSTORE |
73 | */ | 73 | */ |
74 | enum GNUNET_PEERSTORE_StoreOption | 74 | enum GNUNET_PEERSTORE_StoreOption { |
75 | { | ||
76 | |||
77 | /** | 75 | /** |
78 | * Possibly store multiple values under given key. | 76 | * Possibly store multiple values under given key. |
79 | */ | 77 | */ |
@@ -84,7 +82,6 @@ enum GNUNET_PEERSTORE_StoreOption | |||
84 | * storing the given value. | 82 | * storing the given value. |
85 | */ | 83 | */ |
86 | GNUNET_PEERSTORE_STOREOPTION_REPLACE = 1 | 84 | GNUNET_PEERSTORE_STOREOPTION_REPLACE = 1 |
87 | |||
88 | }; | 85 | }; |
89 | 86 | ||
90 | /** | 87 | /** |
@@ -100,9 +97,7 @@ struct GNUNET_PEERSTORE_StoreContext; | |||
100 | /** | 97 | /** |
101 | * Single PEERSTORE record | 98 | * Single PEERSTORE record |
102 | */ | 99 | */ |
103 | struct GNUNET_PEERSTORE_Record | 100 | struct GNUNET_PEERSTORE_Record { |
104 | { | ||
105 | |||
106 | /** | 101 | /** |
107 | * Responsible sub system string | 102 | * Responsible sub system string |
108 | */ | 103 | */ |
@@ -169,7 +164,7 @@ typedef void (*GNUNET_PEERSTORE_Processor) ( | |||
169 | * @return NULL on error | 164 | * @return NULL on error |
170 | */ | 165 | */ |
171 | struct GNUNET_PEERSTORE_Handle * | 166 | struct GNUNET_PEERSTORE_Handle * |
172 | GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 167 | GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
173 | 168 | ||
174 | 169 | ||
175 | /** | 170 | /** |
@@ -181,7 +176,7 @@ GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
181 | * @param sync_first send any pending STORE requests before disconnecting | 176 | * @param sync_first send any pending STORE requests before disconnecting |
182 | */ | 177 | */ |
183 | void | 178 | void |
184 | GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first); | 179 | GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h, int sync_first); |
185 | 180 | ||
186 | 181 | ||
187 | /** | 182 | /** |
@@ -201,16 +196,16 @@ GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first); | |||
201 | * @param cont_cls Closure for @a cont | 196 | * @param cont_cls Closure for @a cont |
202 | */ | 197 | */ |
203 | struct GNUNET_PEERSTORE_StoreContext * | 198 | struct GNUNET_PEERSTORE_StoreContext * |
204 | GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, | 199 | GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h, |
205 | const char *sub_system, | 200 | const char *sub_system, |
206 | const struct GNUNET_PeerIdentity *peer, | 201 | const struct GNUNET_PeerIdentity *peer, |
207 | const char *key, | 202 | const char *key, |
208 | const void *value, | 203 | const void *value, |
209 | size_t size, | 204 | size_t size, |
210 | struct GNUNET_TIME_Absolute expiry, | 205 | struct GNUNET_TIME_Absolute expiry, |
211 | enum GNUNET_PEERSTORE_StoreOption options, | 206 | enum GNUNET_PEERSTORE_StoreOption options, |
212 | GNUNET_PEERSTORE_Continuation cont, | 207 | GNUNET_PEERSTORE_Continuation cont, |
213 | void *cont_cls); | 208 | void *cont_cls); |
214 | 209 | ||
215 | 210 | ||
216 | /** | 211 | /** |
@@ -219,7 +214,7 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, | |||
219 | * @param sc Store request context | 214 | * @param sc Store request context |
220 | */ | 215 | */ |
221 | void | 216 | void |
222 | GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc); | 217 | GNUNET_PEERSTORE_store_cancel(struct GNUNET_PEERSTORE_StoreContext *sc); |
223 | 218 | ||
224 | 219 | ||
225 | /** | 220 | /** |
@@ -233,12 +228,12 @@ GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc); | |||
233 | * @param callback_cls closure for @a callback | 228 | * @param callback_cls closure for @a callback |
234 | */ | 229 | */ |
235 | struct GNUNET_PEERSTORE_IterateContext * | 230 | struct GNUNET_PEERSTORE_IterateContext * |
236 | GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h, | 231 | GNUNET_PEERSTORE_iterate(struct GNUNET_PEERSTORE_Handle *h, |
237 | const char *sub_system, | 232 | const char *sub_system, |
238 | const struct GNUNET_PeerIdentity *peer, | 233 | const struct GNUNET_PeerIdentity *peer, |
239 | const char *key, | 234 | const char *key, |
240 | GNUNET_PEERSTORE_Processor callback, | 235 | GNUNET_PEERSTORE_Processor callback, |
241 | void *callback_cls); | 236 | void *callback_cls); |
242 | 237 | ||
243 | 238 | ||
244 | /** | 239 | /** |
@@ -248,7 +243,7 @@ GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h, | |||
248 | * @param ic Iterate request context as returned by GNUNET_PEERSTORE_iterate() | 243 | * @param ic Iterate request context as returned by GNUNET_PEERSTORE_iterate() |
249 | */ | 244 | */ |
250 | void | 245 | void |
251 | GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic); | 246 | GNUNET_PEERSTORE_iterate_cancel(struct GNUNET_PEERSTORE_IterateContext *ic); |
252 | 247 | ||
253 | 248 | ||
254 | /** | 249 | /** |
@@ -264,12 +259,12 @@ GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic); | |||
264 | * @return Handle to watch request | 259 | * @return Handle to watch request |
265 | */ | 260 | */ |
266 | struct GNUNET_PEERSTORE_WatchContext * | 261 | struct GNUNET_PEERSTORE_WatchContext * |
267 | GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h, | 262 | GNUNET_PEERSTORE_watch(struct GNUNET_PEERSTORE_Handle *h, |
268 | const char *sub_system, | 263 | const char *sub_system, |
269 | const struct GNUNET_PeerIdentity *peer, | 264 | const struct GNUNET_PeerIdentity *peer, |
270 | const char *key, | 265 | const char *key, |
271 | GNUNET_PEERSTORE_Processor callback, | 266 | GNUNET_PEERSTORE_Processor callback, |
272 | void *callback_cls); | 267 | void *callback_cls); |
273 | 268 | ||
274 | 269 | ||
275 | /** | 270 | /** |
@@ -278,7 +273,7 @@ GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h, | |||
278 | * @param wc handle to the watch request | 273 | * @param wc handle to the watch request |
279 | */ | 274 | */ |
280 | void | 275 | void |
281 | GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext *wc); | 276 | GNUNET_PEERSTORE_watch_cancel(struct GNUNET_PEERSTORE_WatchContext *wc); |
282 | 277 | ||
283 | 278 | ||
284 | #if 0 /* keep Emacsens' auto-indent happy */ | 279 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h index bfcf1924f..67e6b5131 100644 --- a/src/include/gnunet_plugin_lib.h +++ b/src/include/gnunet_plugin_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -66,7 +66,7 @@ typedef void * | |||
66 | * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not | 66 | * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not |
67 | */ | 67 | */ |
68 | int | 68 | int |
69 | GNUNET_PLUGIN_test (const char *library_name); | 69 | GNUNET_PLUGIN_test(const char *library_name); |
70 | 70 | ||
71 | 71 | ||
72 | /** | 72 | /** |
@@ -82,8 +82,8 @@ GNUNET_PLUGIN_test (const char *library_name); | |||
82 | * @return whatever the initialization function returned, NULL on error | 82 | * @return whatever the initialization function returned, NULL on error |
83 | */ | 83 | */ |
84 | void * | 84 | void * |
85 | GNUNET_PLUGIN_load (const char *library_name, | 85 | GNUNET_PLUGIN_load(const char *library_name, |
86 | void *arg); | 86 | void *arg); |
87 | 87 | ||
88 | 88 | ||
89 | /** | 89 | /** |
@@ -115,10 +115,10 @@ typedef void | |||
115 | * @param cb_cls closure for @a cb | 115 | * @param cb_cls closure for @a cb |
116 | */ | 116 | */ |
117 | void | 117 | void |
118 | GNUNET_PLUGIN_load_all (const char *basename, | 118 | GNUNET_PLUGIN_load_all(const char *basename, |
119 | void *arg, | 119 | void *arg, |
120 | GNUNET_PLUGIN_LoaderCallback cb, | 120 | GNUNET_PLUGIN_LoaderCallback cb, |
121 | void *cb_cls); | 121 | void *cb_cls); |
122 | 122 | ||
123 | 123 | ||
124 | /** | 124 | /** |
@@ -131,8 +131,8 @@ GNUNET_PLUGIN_load_all (const char *basename, | |||
131 | * or a "char *" representing the error message | 131 | * or a "char *" representing the error message |
132 | */ | 132 | */ |
133 | void * | 133 | void * |
134 | GNUNET_PLUGIN_unload (const char *library_name, | 134 | GNUNET_PLUGIN_unload(const char *library_name, |
135 | void *arg); | 135 | void *arg); |
136 | 136 | ||
137 | 137 | ||
138 | #if 0 /* keep Emacsens' auto-indent happy */ | 138 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h index 1734fb94d..fcd886521 100644 --- a/src/include/gnunet_pq_lib.h +++ b/src/include/gnunet_pq_lib.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2016, 2017 GNUnet e.V. | 3 | Copyright (C) 2016, 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file include/gnunet_pq_lib.h | 21 | * @file include/gnunet_pq_lib.h |
22 | * @brief helper functions for Postgres DB interactions | 22 | * @brief helper functions for Postgres DB interactions |
@@ -60,9 +60,7 @@ typedef int (*GNUNET_PQ_QueryConverter) (void *cls, | |||
60 | /** | 60 | /** |
61 | * @brief Description of a DB query parameter. | 61 | * @brief Description of a DB query parameter. |
62 | */ | 62 | */ |
63 | struct GNUNET_PQ_QueryParam | 63 | struct GNUNET_PQ_QueryParam { |
64 | { | ||
65 | |||
66 | /** | 64 | /** |
67 | * Function for how to handle this type of entry. | 65 | * Function for how to handle this type of entry. |
68 | */ | 66 | */ |
@@ -107,7 +105,7 @@ struct GNUNET_PQ_QueryParam | |||
107 | * @oaran ptr_size number of bytes in @a ptr | 105 | * @oaran ptr_size number of bytes in @a ptr |
108 | */ | 106 | */ |
109 | struct GNUNET_PQ_QueryParam | 107 | struct GNUNET_PQ_QueryParam |
110 | GNUNET_PQ_query_param_fixed_size (const void *ptr, size_t ptr_size); | 108 | GNUNET_PQ_query_param_fixed_size(const void *ptr, size_t ptr_size); |
111 | 109 | ||
112 | 110 | ||
113 | /** | 111 | /** |
@@ -116,7 +114,7 @@ GNUNET_PQ_query_param_fixed_size (const void *ptr, size_t ptr_size); | |||
116 | * @param ptr pointer to the string query parameter to pass | 114 | * @param ptr pointer to the string query parameter to pass |
117 | */ | 115 | */ |
118 | struct GNUNET_PQ_QueryParam | 116 | struct GNUNET_PQ_QueryParam |
119 | GNUNET_PQ_query_param_string (const char *ptr); | 117 | GNUNET_PQ_query_param_string(const char *ptr); |
120 | 118 | ||
121 | 119 | ||
122 | /** | 120 | /** |
@@ -126,7 +124,7 @@ GNUNET_PQ_query_param_string (const char *ptr); | |||
126 | * @param x pointer to the query parameter to pass. | 124 | * @param x pointer to the query parameter to pass. |
127 | */ | 125 | */ |
128 | #define GNUNET_PQ_query_param_auto_from_type(x) \ | 126 | #define GNUNET_PQ_query_param_auto_from_type(x) \ |
129 | GNUNET_PQ_query_param_fixed_size ((x), sizeof (*(x))) | 127 | GNUNET_PQ_query_param_fixed_size((x), sizeof(*(x))) |
130 | 128 | ||
131 | 129 | ||
132 | /** | 130 | /** |
@@ -136,7 +134,7 @@ GNUNET_PQ_query_param_string (const char *ptr); | |||
136 | * @param x the query parameter to pass. | 134 | * @param x the query parameter to pass. |
137 | */ | 135 | */ |
138 | struct GNUNET_PQ_QueryParam | 136 | struct GNUNET_PQ_QueryParam |
139 | GNUNET_PQ_query_param_rsa_public_key ( | 137 | GNUNET_PQ_query_param_rsa_public_key( |
140 | const struct GNUNET_CRYPTO_RsaPublicKey *x); | 138 | const struct GNUNET_CRYPTO_RsaPublicKey *x); |
141 | 139 | ||
142 | 140 | ||
@@ -147,7 +145,7 @@ GNUNET_PQ_query_param_rsa_public_key ( | |||
147 | * @param x the query parameter to pass | 145 | * @param x the query parameter to pass |
148 | */ | 146 | */ |
149 | struct GNUNET_PQ_QueryParam | 147 | struct GNUNET_PQ_QueryParam |
150 | GNUNET_PQ_query_param_rsa_signature ( | 148 | GNUNET_PQ_query_param_rsa_signature( |
151 | const struct GNUNET_CRYPTO_RsaSignature *x); | 149 | const struct GNUNET_CRYPTO_RsaSignature *x); |
152 | 150 | ||
153 | 151 | ||
@@ -158,7 +156,7 @@ GNUNET_PQ_query_param_rsa_signature ( | |||
158 | * @param x pointer to the query parameter to pass | 156 | * @param x pointer to the query parameter to pass |
159 | */ | 157 | */ |
160 | struct GNUNET_PQ_QueryParam | 158 | struct GNUNET_PQ_QueryParam |
161 | GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | 159 | GNUNET_PQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); |
162 | 160 | ||
163 | 161 | ||
164 | /** | 162 | /** |
@@ -168,7 +166,7 @@ GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | |||
168 | * @param x pointer to the query parameter to pass | 166 | * @param x pointer to the query parameter to pass |
169 | */ | 167 | */ |
170 | struct GNUNET_PQ_QueryParam | 168 | struct GNUNET_PQ_QueryParam |
171 | GNUNET_PQ_query_param_absolute_time_nbo ( | 169 | GNUNET_PQ_query_param_absolute_time_nbo( |
172 | const struct GNUNET_TIME_AbsoluteNBO *x); | 170 | const struct GNUNET_TIME_AbsoluteNBO *x); |
173 | 171 | ||
174 | 172 | ||
@@ -178,7 +176,7 @@ GNUNET_PQ_query_param_absolute_time_nbo ( | |||
178 | * @param x pointer to the query parameter to pass | 176 | * @param x pointer to the query parameter to pass |
179 | */ | 177 | */ |
180 | struct GNUNET_PQ_QueryParam | 178 | struct GNUNET_PQ_QueryParam |
181 | GNUNET_PQ_query_param_uint16 (const uint16_t *x); | 179 | GNUNET_PQ_query_param_uint16(const uint16_t *x); |
182 | 180 | ||
183 | 181 | ||
184 | /** | 182 | /** |
@@ -187,7 +185,7 @@ GNUNET_PQ_query_param_uint16 (const uint16_t *x); | |||
187 | * @param x pointer to the query parameter to pass | 185 | * @param x pointer to the query parameter to pass |
188 | */ | 186 | */ |
189 | struct GNUNET_PQ_QueryParam | 187 | struct GNUNET_PQ_QueryParam |
190 | GNUNET_PQ_query_param_uint32 (const uint32_t *x); | 188 | GNUNET_PQ_query_param_uint32(const uint32_t *x); |
191 | 189 | ||
192 | 190 | ||
193 | /** | 191 | /** |
@@ -196,7 +194,7 @@ GNUNET_PQ_query_param_uint32 (const uint32_t *x); | |||
196 | * @param x pointer to the query parameter to pass | 194 | * @param x pointer to the query parameter to pass |
197 | */ | 195 | */ |
198 | struct GNUNET_PQ_QueryParam | 196 | struct GNUNET_PQ_QueryParam |
199 | GNUNET_PQ_query_param_uint64 (const uint64_t *x); | 197 | GNUNET_PQ_query_param_uint64(const uint64_t *x); |
200 | 198 | ||
201 | 199 | ||
202 | /* ************************* pq_result_helper.c functions ************************ */ | 200 | /* ************************* pq_result_helper.c functions ************************ */ |
@@ -236,9 +234,7 @@ typedef void (*GNUNET_PQ_ResultCleanup) (void *cls, void *rd); | |||
236 | /** | 234 | /** |
237 | * @brief Description of a DB result cell. | 235 | * @brief Description of a DB result cell. |
238 | */ | 236 | */ |
239 | struct GNUNET_PQ_ResultSpec | 237 | struct GNUNET_PQ_ResultSpec { |
240 | { | ||
241 | |||
242 | /** | 238 | /** |
243 | * What is the format of the result? | 239 | * What is the format of the result? |
244 | */ | 240 | */ |
@@ -299,9 +295,9 @@ struct GNUNET_PQ_ResultSpec | |||
299 | * @return array entry for the result specification to use | 295 | * @return array entry for the result specification to use |
300 | */ | 296 | */ |
301 | struct GNUNET_PQ_ResultSpec | 297 | struct GNUNET_PQ_ResultSpec |
302 | GNUNET_PQ_result_spec_variable_size (const char *name, | 298 | GNUNET_PQ_result_spec_variable_size(const char *name, |
303 | void **dst, | 299 | void **dst, |
304 | size_t *sptr); | 300 | size_t *sptr); |
305 | 301 | ||
306 | 302 | ||
307 | /** | 303 | /** |
@@ -313,7 +309,7 @@ GNUNET_PQ_result_spec_variable_size (const char *name, | |||
313 | * @return array entry for the result specification to use | 309 | * @return array entry for the result specification to use |
314 | */ | 310 | */ |
315 | struct GNUNET_PQ_ResultSpec | 311 | struct GNUNET_PQ_ResultSpec |
316 | GNUNET_PQ_result_spec_fixed_size (const char *name, void *dst, size_t dst_size); | 312 | GNUNET_PQ_result_spec_fixed_size(const char *name, void *dst, size_t dst_size); |
317 | 313 | ||
318 | 314 | ||
319 | /** | 315 | /** |
@@ -324,7 +320,7 @@ GNUNET_PQ_result_spec_fixed_size (const char *name, void *dst, size_t dst_size); | |||
324 | * @return array entry for the result specification to use | 320 | * @return array entry for the result specification to use |
325 | */ | 321 | */ |
326 | #define GNUNET_PQ_result_spec_auto_from_type(name, dst) \ | 322 | #define GNUNET_PQ_result_spec_auto_from_type(name, dst) \ |
327 | GNUNET_PQ_result_spec_fixed_size (name, (dst), sizeof (*(dst))) | 323 | GNUNET_PQ_result_spec_fixed_size(name, (dst), sizeof(*(dst))) |
328 | 324 | ||
329 | 325 | ||
330 | /** | 326 | /** |
@@ -335,7 +331,7 @@ GNUNET_PQ_result_spec_fixed_size (const char *name, void *dst, size_t dst_size); | |||
335 | * @return array entry for the result specification to use | 331 | * @return array entry for the result specification to use |
336 | */ | 332 | */ |
337 | struct GNUNET_PQ_ResultSpec | 333 | struct GNUNET_PQ_ResultSpec |
338 | GNUNET_PQ_result_spec_string (const char *name, char **dst); | 334 | GNUNET_PQ_result_spec_string(const char *name, char **dst); |
339 | 335 | ||
340 | 336 | ||
341 | /** | 337 | /** |
@@ -346,8 +342,8 @@ GNUNET_PQ_result_spec_string (const char *name, char **dst); | |||
346 | * @return array entry for the result specification to use | 342 | * @return array entry for the result specification to use |
347 | */ | 343 | */ |
348 | struct GNUNET_PQ_ResultSpec | 344 | struct GNUNET_PQ_ResultSpec |
349 | GNUNET_PQ_result_spec_rsa_public_key (const char *name, | 345 | GNUNET_PQ_result_spec_rsa_public_key(const char *name, |
350 | struct GNUNET_CRYPTO_RsaPublicKey **rsa); | 346 | struct GNUNET_CRYPTO_RsaPublicKey **rsa); |
351 | 347 | ||
352 | 348 | ||
353 | /** | 349 | /** |
@@ -358,8 +354,8 @@ GNUNET_PQ_result_spec_rsa_public_key (const char *name, | |||
358 | * @return array entry for the result specification to use | 354 | * @return array entry for the result specification to use |
359 | */ | 355 | */ |
360 | struct GNUNET_PQ_ResultSpec | 356 | struct GNUNET_PQ_ResultSpec |
361 | GNUNET_PQ_result_spec_rsa_signature (const char *name, | 357 | GNUNET_PQ_result_spec_rsa_signature(const char *name, |
362 | struct GNUNET_CRYPTO_RsaSignature **sig); | 358 | struct GNUNET_CRYPTO_RsaSignature **sig); |
363 | 359 | ||
364 | 360 | ||
365 | /** | 361 | /** |
@@ -370,8 +366,8 @@ GNUNET_PQ_result_spec_rsa_signature (const char *name, | |||
370 | * @return array entry for the result specification to use | 366 | * @return array entry for the result specification to use |
371 | */ | 367 | */ |
372 | struct GNUNET_PQ_ResultSpec | 368 | struct GNUNET_PQ_ResultSpec |
373 | GNUNET_PQ_result_spec_absolute_time (const char *name, | 369 | GNUNET_PQ_result_spec_absolute_time(const char *name, |
374 | struct GNUNET_TIME_Absolute *at); | 370 | struct GNUNET_TIME_Absolute *at); |
375 | 371 | ||
376 | 372 | ||
377 | /** | 373 | /** |
@@ -382,8 +378,8 @@ GNUNET_PQ_result_spec_absolute_time (const char *name, | |||
382 | * @return array entry for the result specification to use | 378 | * @return array entry for the result specification to use |
383 | */ | 379 | */ |
384 | struct GNUNET_PQ_ResultSpec | 380 | struct GNUNET_PQ_ResultSpec |
385 | GNUNET_PQ_result_spec_absolute_time_nbo (const char *name, | 381 | GNUNET_PQ_result_spec_absolute_time_nbo(const char *name, |
386 | struct GNUNET_TIME_AbsoluteNBO *at); | 382 | struct GNUNET_TIME_AbsoluteNBO *at); |
387 | 383 | ||
388 | 384 | ||
389 | /** | 385 | /** |
@@ -394,7 +390,7 @@ GNUNET_PQ_result_spec_absolute_time_nbo (const char *name, | |||
394 | * @return array entry for the result specification to use | 390 | * @return array entry for the result specification to use |
395 | */ | 391 | */ |
396 | struct GNUNET_PQ_ResultSpec | 392 | struct GNUNET_PQ_ResultSpec |
397 | GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t *u16); | 393 | GNUNET_PQ_result_spec_uint16(const char *name, uint16_t *u16); |
398 | 394 | ||
399 | 395 | ||
400 | /** | 396 | /** |
@@ -405,7 +401,7 @@ GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t *u16); | |||
405 | * @return array entry for the result specification to use | 401 | * @return array entry for the result specification to use |
406 | */ | 402 | */ |
407 | struct GNUNET_PQ_ResultSpec | 403 | struct GNUNET_PQ_ResultSpec |
408 | GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t *u32); | 404 | GNUNET_PQ_result_spec_uint32(const char *name, uint32_t *u32); |
409 | 405 | ||
410 | 406 | ||
411 | /** | 407 | /** |
@@ -416,7 +412,7 @@ GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t *u32); | |||
416 | * @return array entry for the result specification to use | 412 | * @return array entry for the result specification to use |
417 | */ | 413 | */ |
418 | struct GNUNET_PQ_ResultSpec | 414 | struct GNUNET_PQ_ResultSpec |
419 | GNUNET_PQ_result_spec_uint64 (const char *name, uint64_t *u64); | 415 | GNUNET_PQ_result_spec_uint64(const char *name, uint64_t *u64); |
420 | 416 | ||
421 | 417 | ||
422 | /* ************************* pq.c functions ************************ */ | 418 | /* ************************* pq.c functions ************************ */ |
@@ -431,9 +427,9 @@ GNUNET_PQ_result_spec_uint64 (const char *name, uint64_t *u64); | |||
431 | * @deprecated (should become an internal API) | 427 | * @deprecated (should become an internal API) |
432 | */ | 428 | */ |
433 | PGresult * | 429 | PGresult * |
434 | GNUNET_PQ_exec_prepared (PGconn *db_conn, | 430 | GNUNET_PQ_exec_prepared(PGconn *db_conn, |
435 | const char *name, | 431 | const char *name, |
436 | const struct GNUNET_PQ_QueryParam *params); | 432 | const struct GNUNET_PQ_QueryParam *params); |
437 | 433 | ||
438 | 434 | ||
439 | /** | 435 | /** |
@@ -448,9 +444,9 @@ GNUNET_PQ_exec_prepared (PGconn *db_conn, | |||
448 | * @deprecated (should become an internal API) | 444 | * @deprecated (should become an internal API) |
449 | */ | 445 | */ |
450 | int | 446 | int |
451 | GNUNET_PQ_extract_result (PGresult *result, | 447 | GNUNET_PQ_extract_result(PGresult *result, |
452 | struct GNUNET_PQ_ResultSpec *rs, | 448 | struct GNUNET_PQ_ResultSpec *rs, |
453 | int row); | 449 | int row); |
454 | 450 | ||
455 | 451 | ||
456 | /** | 452 | /** |
@@ -460,7 +456,7 @@ GNUNET_PQ_extract_result (PGresult *result, | |||
460 | * @param rs reult specification to clean up | 456 | * @param rs reult specification to clean up |
461 | */ | 457 | */ |
462 | void | 458 | void |
463 | GNUNET_PQ_cleanup_result (struct GNUNET_PQ_ResultSpec *rs); | 459 | GNUNET_PQ_cleanup_result(struct GNUNET_PQ_ResultSpec *rs); |
464 | 460 | ||
465 | 461 | ||
466 | /* ******************** pq_eval.c functions ************** */ | 462 | /* ******************** pq_eval.c functions ************** */ |
@@ -480,9 +476,9 @@ GNUNET_PQ_cleanup_result (struct GNUNET_PQ_ResultSpec *rs); | |||
480 | * @deprecated (low level, let's see if we can do with just the high-level functions) | 476 | * @deprecated (low level, let's see if we can do with just the high-level functions) |
481 | */ | 477 | */ |
482 | enum GNUNET_DB_QueryStatus | 478 | enum GNUNET_DB_QueryStatus |
483 | GNUNET_PQ_eval_result (PGconn *connection, | 479 | GNUNET_PQ_eval_result(PGconn *connection, |
484 | const char *statement_name, | 480 | const char *statement_name, |
485 | PGresult *result); | 481 | PGresult *result); |
486 | 482 | ||
487 | 483 | ||
488 | /** | 484 | /** |
@@ -502,9 +498,9 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
502 | * zero; if INSERT was successful, we return one. | 498 | * zero; if INSERT was successful, we return one. |
503 | */ | 499 | */ |
504 | enum GNUNET_DB_QueryStatus | 500 | enum GNUNET_DB_QueryStatus |
505 | GNUNET_PQ_eval_prepared_non_select (PGconn *connection, | 501 | GNUNET_PQ_eval_prepared_non_select(PGconn *connection, |
506 | const char *statement_name, | 502 | const char *statement_name, |
507 | const struct GNUNET_PQ_QueryParam *params); | 503 | const struct GNUNET_PQ_QueryParam *params); |
508 | 504 | ||
509 | 505 | ||
510 | /** | 506 | /** |
@@ -536,11 +532,11 @@ typedef void (*GNUNET_PQ_PostgresResultHandler) (void *cls, | |||
536 | * codes to `enum GNUNET_DB_QueryStatus`. | 532 | * codes to `enum GNUNET_DB_QueryStatus`. |
537 | */ | 533 | */ |
538 | enum GNUNET_DB_QueryStatus | 534 | enum GNUNET_DB_QueryStatus |
539 | GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | 535 | GNUNET_PQ_eval_prepared_multi_select(PGconn *connection, |
540 | const char *statement_name, | 536 | const char *statement_name, |
541 | const struct GNUNET_PQ_QueryParam *params, | 537 | const struct GNUNET_PQ_QueryParam *params, |
542 | GNUNET_PQ_PostgresResultHandler rh, | 538 | GNUNET_PQ_PostgresResultHandler rh, |
543 | void *rh_cls); | 539 | void *rh_cls); |
544 | 540 | ||
545 | 541 | ||
546 | /** | 542 | /** |
@@ -559,7 +555,7 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
559 | * codes to `enum GNUNET_DB_QueryStatus`. | 555 | * codes to `enum GNUNET_DB_QueryStatus`. |
560 | */ | 556 | */ |
561 | enum GNUNET_DB_QueryStatus | 557 | enum GNUNET_DB_QueryStatus |
562 | GNUNET_PQ_eval_prepared_singleton_select ( | 558 | GNUNET_PQ_eval_prepared_singleton_select( |
563 | PGconn *connection, | 559 | PGconn *connection, |
564 | const char *statement_name, | 560 | const char *statement_name, |
565 | const struct GNUNET_PQ_QueryParam *params, | 561 | const struct GNUNET_PQ_QueryParam *params, |
@@ -573,9 +569,7 @@ GNUNET_PQ_eval_prepared_singleton_select ( | |||
573 | * Information needed to prepare a list of SQL statements using | 569 | * Information needed to prepare a list of SQL statements using |
574 | * #GNUNET_PQ_prepare_statements(). | 570 | * #GNUNET_PQ_prepare_statements(). |
575 | */ | 571 | */ |
576 | struct GNUNET_PQ_PreparedStatement | 572 | struct GNUNET_PQ_PreparedStatement { |
577 | { | ||
578 | |||
579 | /** | 573 | /** |
580 | * Name of the statement. | 574 | * Name of the statement. |
581 | */ | 575 | */ |
@@ -611,9 +605,9 @@ struct GNUNET_PQ_PreparedStatement | |||
611 | * @return initialized struct | 605 | * @return initialized struct |
612 | */ | 606 | */ |
613 | struct GNUNET_PQ_PreparedStatement | 607 | struct GNUNET_PQ_PreparedStatement |
614 | GNUNET_PQ_make_prepare (const char *name, | 608 | GNUNET_PQ_make_prepare(const char *name, |
615 | const char *sql, | 609 | const char *sql, |
616 | unsigned int num_args); | 610 | unsigned int num_args); |
617 | 611 | ||
618 | 612 | ||
619 | /** | 613 | /** |
@@ -626,8 +620,8 @@ GNUNET_PQ_make_prepare (const char *name, | |||
626 | * #GNUNET_SYSERR on error | 620 | * #GNUNET_SYSERR on error |
627 | */ | 621 | */ |
628 | int | 622 | int |
629 | GNUNET_PQ_prepare_statements (PGconn *connection, | 623 | GNUNET_PQ_prepare_statements(PGconn *connection, |
630 | const struct GNUNET_PQ_PreparedStatement *ps); | 624 | const struct GNUNET_PQ_PreparedStatement *ps); |
631 | 625 | ||
632 | 626 | ||
633 | /* ******************** pq_exec.c functions ************** */ | 627 | /* ******************** pq_exec.c functions ************** */ |
@@ -637,9 +631,7 @@ GNUNET_PQ_prepare_statements (PGconn *connection, | |||
637 | * Information needed to run a list of SQL statements using | 631 | * Information needed to run a list of SQL statements using |
638 | * #GNUNET_PQ_exec_statements(). | 632 | * #GNUNET_PQ_exec_statements(). |
639 | */ | 633 | */ |
640 | struct GNUNET_PQ_ExecuteStatement | 634 | struct GNUNET_PQ_ExecuteStatement { |
641 | { | ||
642 | |||
643 | /** | 635 | /** |
644 | * Actual SQL statement. | 636 | * Actual SQL statement. |
645 | */ | 637 | */ |
@@ -668,7 +660,7 @@ struct GNUNET_PQ_ExecuteStatement | |||
668 | * @return initialized struct | 660 | * @return initialized struct |
669 | */ | 661 | */ |
670 | struct GNUNET_PQ_ExecuteStatement | 662 | struct GNUNET_PQ_ExecuteStatement |
671 | GNUNET_PQ_make_execute (const char *sql); | 663 | GNUNET_PQ_make_execute(const char *sql); |
672 | 664 | ||
673 | 665 | ||
674 | /** | 666 | /** |
@@ -679,7 +671,7 @@ GNUNET_PQ_make_execute (const char *sql); | |||
679 | * @return initialized struct | 671 | * @return initialized struct |
680 | */ | 672 | */ |
681 | struct GNUNET_PQ_ExecuteStatement | 673 | struct GNUNET_PQ_ExecuteStatement |
682 | GNUNET_PQ_make_try_execute (const char *sql); | 674 | GNUNET_PQ_make_try_execute(const char *sql); |
683 | 675 | ||
684 | 676 | ||
685 | /** | 677 | /** |
@@ -692,8 +684,8 @@ GNUNET_PQ_make_try_execute (const char *sql); | |||
692 | * #GNUNET_SYSERR on error | 684 | * #GNUNET_SYSERR on error |
693 | */ | 685 | */ |
694 | int | 686 | int |
695 | GNUNET_PQ_exec_statements (PGconn *connection, | 687 | GNUNET_PQ_exec_statements(PGconn *connection, |
696 | const struct GNUNET_PQ_ExecuteStatement *es); | 688 | const struct GNUNET_PQ_ExecuteStatement *es); |
697 | 689 | ||
698 | 690 | ||
699 | /* ******************** pq_connect.c functions ************** */ | 691 | /* ******************** pq_connect.c functions ************** */ |
@@ -708,7 +700,7 @@ GNUNET_PQ_exec_statements (PGconn *connection, | |||
708 | * @return NULL on error | 700 | * @return NULL on error |
709 | */ | 701 | */ |
710 | PGconn * | 702 | PGconn * |
711 | GNUNET_PQ_connect (const char *config_str); | 703 | GNUNET_PQ_connect(const char *config_str); |
712 | 704 | ||
713 | 705 | ||
714 | /** | 706 | /** |
@@ -720,8 +712,8 @@ GNUNET_PQ_connect (const char *config_str); | |||
720 | * @return the postgres handle, NULL on error | 712 | * @return the postgres handle, NULL on error |
721 | */ | 713 | */ |
722 | PGconn * | 714 | PGconn * |
723 | GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, | 715 | GNUNET_PQ_connect_with_cfg(const struct GNUNET_CONFIGURATION_Handle *cfg, |
724 | const char *section); | 716 | const char *section); |
725 | 717 | ||
726 | 718 | ||
727 | #endif /* GNUNET_PQ_LIB_H_ */ | 719 | #endif /* GNUNET_PQ_LIB_H_ */ |
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index c434c9170..a65a7510d 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -75,14 +75,14 @@ typedef void | |||
75 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 75 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
76 | */ | 76 | */ |
77 | int | 77 | int |
78 | GNUNET_PROGRAM_run2 (int argc, | 78 | GNUNET_PROGRAM_run2(int argc, |
79 | char *const *argv, | 79 | char *const *argv, |
80 | const char *binaryName, | 80 | const char *binaryName, |
81 | const char *binaryHelp, | 81 | const char *binaryHelp, |
82 | const struct GNUNET_GETOPT_CommandLineOption *options, | 82 | const struct GNUNET_GETOPT_CommandLineOption *options, |
83 | GNUNET_PROGRAM_Main task, | 83 | GNUNET_PROGRAM_Main task, |
84 | void *task_cls, | 84 | void *task_cls, |
85 | int run_without_scheduler); | 85 | int run_without_scheduler); |
86 | 86 | ||
87 | 87 | ||
88 | /** | 88 | /** |
@@ -99,13 +99,13 @@ GNUNET_PROGRAM_run2 (int argc, | |||
99 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 99 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
100 | */ | 100 | */ |
101 | int | 101 | int |
102 | GNUNET_PROGRAM_run (int argc, | 102 | GNUNET_PROGRAM_run(int argc, |
103 | char *const *argv, | 103 | char *const *argv, |
104 | const char *binaryName, | 104 | const char *binaryName, |
105 | const char *binaryHelp, | 105 | const char *binaryHelp, |
106 | const struct GNUNET_GETOPT_CommandLineOption *options, | 106 | const struct GNUNET_GETOPT_CommandLineOption *options, |
107 | GNUNET_PROGRAM_Main task, | 107 | GNUNET_PROGRAM_Main task, |
108 | void *task_cls); | 108 | void *task_cls); |
109 | 109 | ||
110 | 110 | ||
111 | #if 0 /* keep Emacsens' auto-indent happy */ | 111 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 45bfa4f1b..c932c44d0 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -85,8 +85,8 @@ extern "C" { | |||
85 | #define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5 | 85 | #define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5 |
86 | 86 | ||
87 | /******************************************************************************* | 87 | /******************************************************************************* |
88 | * AGPL source code download | 88 | * AGPL source code download |
89 | * *****************************************************************************/ | 89 | * *****************************************************************************/ |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Message to request source code link. | 92 | * Message to request source code link. |
@@ -3048,8 +3048,8 @@ extern "C" { | |||
3048 | 3048 | ||
3049 | 3049 | ||
3050 | /******************************************************* | 3050 | /******************************************************* |
3051 | NEW (TNG) Transport service | 3051 | NEW (TNG) Transport service |
3052 | ******************************************************* */ | 3052 | ******************************************************* */ |
3053 | 3053 | ||
3054 | /** | 3054 | /** |
3055 | * @brief inform transport to add an address of this peer | 3055 | * @brief inform transport to add an address of this peer |
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h index e96937ea8..527a3977e 100644 --- a/src/include/gnunet_reclaim_attribute_lib.h +++ b/src/include/gnunet_reclaim_attribute_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Martin Schanzenbach | 22 | * @author Martin Schanzenbach |
@@ -54,8 +54,7 @@ extern "C" { | |||
54 | /** | 54 | /** |
55 | * An attribute. | 55 | * An attribute. |
56 | */ | 56 | */ |
57 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim | 57 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim { |
58 | { | ||
59 | /** | 58 | /** |
60 | * ID | 59 | * ID |
61 | */ | 60 | */ |
@@ -93,8 +92,7 @@ struct GNUNET_RECLAIM_ATTRIBUTE_Claim | |||
93 | /** | 92 | /** |
94 | * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures. | 93 | * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures. |
95 | */ | 94 | */ |
96 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList | 95 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList { |
97 | { | ||
98 | /** | 96 | /** |
99 | * List head | 97 | * List head |
100 | */ | 98 | */ |
@@ -107,8 +105,7 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList | |||
107 | }; | 105 | }; |
108 | 106 | ||
109 | 107 | ||
110 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry | 108 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry { |
111 | { | ||
112 | /** | 109 | /** |
113 | * DLL | 110 | * DLL |
114 | */ | 111 | */ |
@@ -136,10 +133,10 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry | |||
136 | * @return the new attribute | 133 | * @return the new attribute |
137 | */ | 134 | */ |
138 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim * | 135 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim * |
139 | GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char *attr_name, | 136 | GNUNET_RECLAIM_ATTRIBUTE_claim_new(const char *attr_name, |
140 | uint32_t type, | 137 | uint32_t type, |
141 | const void *data, | 138 | const void *data, |
142 | size_t data_size); | 139 | size_t data_size); |
143 | 140 | ||
144 | 141 | ||
145 | /** | 142 | /** |
@@ -149,7 +146,7 @@ GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char *attr_name, | |||
149 | * @return the required buffer size | 146 | * @return the required buffer size |
150 | */ | 147 | */ |
151 | size_t | 148 | size_t |
152 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size ( | 149 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size( |
153 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); | 150 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); |
154 | 151 | ||
155 | 152 | ||
@@ -159,7 +156,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size ( | |||
159 | * @param attrs list to destroy | 156 | * @param attrs list to destroy |
160 | */ | 157 | */ |
161 | void | 158 | void |
162 | GNUNET_RECLAIM_ATTRIBUTE_list_destroy ( | 159 | GNUNET_RECLAIM_ATTRIBUTE_list_destroy( |
163 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); | 160 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); |
164 | 161 | ||
165 | 162 | ||
@@ -172,7 +169,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_destroy ( | |||
172 | * @param data_size claim payload size | 169 | * @param data_size claim payload size |
173 | */ | 170 | */ |
174 | void | 171 | void |
175 | GNUNET_RECLAIM_ATTRIBUTE_list_add ( | 172 | GNUNET_RECLAIM_ATTRIBUTE_list_add( |
176 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, | 173 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, |
177 | const char *attr_name, | 174 | const char *attr_name, |
178 | uint32_t type, | 175 | uint32_t type, |
@@ -188,7 +185,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_add ( | |||
188 | * @return length of serialized data | 185 | * @return length of serialized data |
189 | */ | 186 | */ |
190 | size_t | 187 | size_t |
191 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize ( | 188 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize( |
192 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, | 189 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, |
193 | char *result); | 190 | char *result); |
194 | 191 | ||
@@ -201,7 +198,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize ( | |||
201 | * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller | 198 | * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller |
202 | */ | 199 | */ |
203 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * | 200 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * |
204 | GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char *data, size_t data_size); | 201 | GNUNET_RECLAIM_ATTRIBUTE_list_deserialize(const char *data, size_t data_size); |
205 | 202 | ||
206 | 203 | ||
207 | /** | 204 | /** |
@@ -211,7 +208,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char *data, size_t data_size); | |||
211 | * @return the required buffer size | 208 | * @return the required buffer size |
212 | */ | 209 | */ |
213 | size_t | 210 | size_t |
214 | GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size ( | 211 | GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size( |
215 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); | 212 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); |
216 | 213 | ||
217 | 214 | ||
@@ -223,7 +220,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size ( | |||
223 | * @return length of serialized data | 220 | * @return length of serialized data |
224 | */ | 221 | */ |
225 | size_t | 222 | size_t |
226 | GNUNET_RECLAIM_ATTRIBUTE_serialize ( | 223 | GNUNET_RECLAIM_ATTRIBUTE_serialize( |
227 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, | 224 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, |
228 | char *result); | 225 | char *result); |
229 | 226 | ||
@@ -237,7 +234,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize ( | |||
237 | * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller | 234 | * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller |
238 | */ | 235 | */ |
239 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim * | 236 | struct GNUNET_RECLAIM_ATTRIBUTE_Claim * |
240 | GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size); | 237 | GNUNET_RECLAIM_ATTRIBUTE_deserialize(const char *data, size_t data_size); |
241 | 238 | ||
242 | 239 | ||
243 | /** | 240 | /** |
@@ -246,7 +243,7 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size); | |||
246 | * @return copied claim list | 243 | * @return copied claim list |
247 | */ | 244 | */ |
248 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * | 245 | struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * |
249 | GNUNET_RECLAIM_ATTRIBUTE_list_dup ( | 246 | GNUNET_RECLAIM_ATTRIBUTE_list_dup( |
250 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); | 247 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); |
251 | 248 | ||
252 | 249 | ||
@@ -257,7 +254,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_dup ( | |||
257 | * @return corresponding number, UINT32_MAX on error | 254 | * @return corresponding number, UINT32_MAX on error |
258 | */ | 255 | */ |
259 | uint32_t | 256 | uint32_t |
260 | GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename); | 257 | GNUNET_RECLAIM_ATTRIBUTE_typename_to_number(const char *typename); |
261 | 258 | ||
262 | /** | 259 | /** |
263 | * Convert human-readable version of a 'claim' of an attribute to the binary | 260 | * Convert human-readable version of a 'claim' of an attribute to the binary |
@@ -270,10 +267,10 @@ GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename); | |||
270 | * @return #GNUNET_OK on success | 267 | * @return #GNUNET_OK on success |
271 | */ | 268 | */ |
272 | int | 269 | int |
273 | GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type, | 270 | GNUNET_RECLAIM_ATTRIBUTE_string_to_value(uint32_t type, |
274 | const char *s, | 271 | const char *s, |
275 | void **data, | 272 | void **data, |
276 | size_t *data_size); | 273 | size_t *data_size); |
277 | 274 | ||
278 | 275 | ||
279 | /** | 276 | /** |
@@ -285,9 +282,9 @@ GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type, | |||
285 | * @return NULL on error, otherwise human-readable representation of the claim | 282 | * @return NULL on error, otherwise human-readable representation of the claim |
286 | */ | 283 | */ |
287 | char * | 284 | char * |
288 | GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type, | 285 | GNUNET_RECLAIM_ATTRIBUTE_value_to_string(uint32_t type, |
289 | const void *data, | 286 | const void *data, |
290 | size_t data_size); | 287 | size_t data_size); |
291 | 288 | ||
292 | 289 | ||
293 | /** | 290 | /** |
@@ -297,7 +294,7 @@ GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type, | |||
297 | * @return corresponding typestring, NULL on error | 294 | * @return corresponding typestring, NULL on error |
298 | */ | 295 | */ |
299 | const char * | 296 | const char * |
300 | GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (uint32_t type); | 297 | GNUNET_RECLAIM_ATTRIBUTE_number_to_typename(uint32_t type); |
301 | 298 | ||
302 | 299 | ||
303 | #if 0 /* keep Emacsens' auto-indent happy */ | 300 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_reclaim_attribute_plugin.h b/src/include/gnunet_reclaim_attribute_plugin.h index c05c80b07..d35916379 100644 --- a/src/include/gnunet_reclaim_attribute_plugin.h +++ b/src/include/gnunet_reclaim_attribute_plugin.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Martin Schanzenbach | 22 | * @author Martin Schanzenbach |
@@ -108,9 +108,7 @@ typedef const char *(*GNUNET_RECLAIM_ATTRIBUTE_NumberToTypenameFunction) ( | |||
108 | * Each plugin is required to return a pointer to a struct of this | 108 | * Each plugin is required to return a pointer to a struct of this |
109 | * type as the return value from its entry point. | 109 | * type as the return value from its entry point. |
110 | */ | 110 | */ |
111 | struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions | 111 | struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions { |
112 | { | ||
113 | |||
114 | /** | 112 | /** |
115 | * Closure for all of the callbacks. | 113 | * Closure for all of the callbacks. |
116 | */ | 114 | */ |
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 8d7babd7c..9f0a141c9 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Martin Schanzenbach | 22 | * @author Martin Schanzenbach |
@@ -64,8 +64,7 @@ struct GNUNET_RECLAIM_Operation; | |||
64 | * The contents of a ticket must be protected and should be treated as a | 64 | * The contents of a ticket must be protected and should be treated as a |
65 | * shared secret between user and relying party. | 65 | * shared secret between user and relying party. |
66 | */ | 66 | */ |
67 | struct GNUNET_RECLAIM_Ticket | 67 | struct GNUNET_RECLAIM_Ticket { |
68 | { | ||
69 | /** | 68 | /** |
70 | * The ticket issuer (= the user) | 69 | * The ticket issuer (= the user) |
71 | */ | 70 | */ |
@@ -92,7 +91,7 @@ struct GNUNET_RECLAIM_Ticket | |||
92 | * @param ticket the ticket | 91 | * @param ticket the ticket |
93 | */ | 92 | */ |
94 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( | 93 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( |
95 | void *cls, const struct GNUNET_RECLAIM_Ticket *ticket); | 94 | void *cls, const struct GNUNET_RECLAIM_Ticket *ticket); |
96 | 95 | ||
97 | 96 | ||
98 | /** | 97 | /** |
@@ -116,8 +115,8 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, | |||
116 | * @param attr The attribute | 115 | * @param attr The attribute |
117 | */ | 116 | */ |
118 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( | 117 | typedef void (*GNUNET_RECLAIM_AttributeResult) ( |
119 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 118 | void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
120 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); | 119 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); |
121 | 120 | ||
122 | 121 | ||
123 | /** | 122 | /** |
@@ -127,7 +126,7 @@ typedef void (*GNUNET_RECLAIM_AttributeResult) ( | |||
127 | * @return handle to communicate with the service | 126 | * @return handle to communicate with the service |
128 | */ | 127 | */ |
129 | struct GNUNET_RECLAIM_Handle * | 128 | struct GNUNET_RECLAIM_Handle * |
130 | GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 129 | GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
131 | 130 | ||
132 | 131 | ||
133 | /** | 132 | /** |
@@ -143,12 +142,12 @@ GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
143 | * @return handle Used to to abort the request | 142 | * @return handle Used to to abort the request |
144 | */ | 143 | */ |
145 | struct GNUNET_RECLAIM_Operation * | 144 | struct GNUNET_RECLAIM_Operation * |
146 | GNUNET_RECLAIM_attribute_store ( | 145 | GNUNET_RECLAIM_attribute_store( |
147 | struct GNUNET_RECLAIM_Handle *h, | 146 | struct GNUNET_RECLAIM_Handle *h, |
148 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 147 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
149 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, | 148 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, |
150 | const struct GNUNET_TIME_Relative *exp_interval, | 149 | const struct GNUNET_TIME_Relative *exp_interval, |
151 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); | 150 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); |
152 | 151 | ||
153 | 152 | ||
154 | /** | 153 | /** |
@@ -163,11 +162,11 @@ GNUNET_RECLAIM_attribute_store ( | |||
163 | * @return handle Used to to abort the request | 162 | * @return handle Used to to abort the request |
164 | */ | 163 | */ |
165 | struct GNUNET_RECLAIM_Operation * | 164 | struct GNUNET_RECLAIM_Operation * |
166 | GNUNET_RECLAIM_attribute_delete ( | 165 | GNUNET_RECLAIM_attribute_delete( |
167 | struct GNUNET_RECLAIM_Handle *h, | 166 | struct GNUNET_RECLAIM_Handle *h, |
168 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 167 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, |
169 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, | 168 | const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, |
170 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); | 169 | GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); |
171 | 170 | ||
172 | 171 | ||
173 | /** | 172 | /** |
@@ -195,12 +194,12 @@ GNUNET_RECLAIM_attribute_delete ( | |||
195 | * @return an iterator Handle to use for iteration | 194 | * @return an iterator Handle to use for iteration |
196 | */ | 195 | */ |
197 | struct GNUNET_RECLAIM_AttributeIterator * | 196 | struct GNUNET_RECLAIM_AttributeIterator * |
198 | GNUNET_RECLAIM_get_attributes_start ( | 197 | GNUNET_RECLAIM_get_attributes_start( |
199 | struct GNUNET_RECLAIM_Handle *h, | 198 | struct GNUNET_RECLAIM_Handle *h, |
200 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 199 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
201 | GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, | 200 | GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, |
202 | GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, | 201 | GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, |
203 | GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls); | 202 | GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls); |
204 | 203 | ||
205 | 204 | ||
206 | /** | 205 | /** |
@@ -210,8 +209,8 @@ GNUNET_RECLAIM_get_attributes_start ( | |||
210 | * @param it The iterator | 209 | * @param it The iterator |
211 | */ | 210 | */ |
212 | void | 211 | void |
213 | GNUNET_RECLAIM_get_attributes_next ( | 212 | GNUNET_RECLAIM_get_attributes_next( |
214 | struct GNUNET_RECLAIM_AttributeIterator *it); | 213 | struct GNUNET_RECLAIM_AttributeIterator *it); |
215 | 214 | ||
216 | 215 | ||
217 | /** | 216 | /** |
@@ -222,8 +221,8 @@ GNUNET_RECLAIM_get_attributes_next ( | |||
222 | * @param it the iterator | 221 | * @param it the iterator |
223 | */ | 222 | */ |
224 | void | 223 | void |
225 | GNUNET_RECLAIM_get_attributes_stop ( | 224 | GNUNET_RECLAIM_get_attributes_stop( |
226 | struct GNUNET_RECLAIM_AttributeIterator *it); | 225 | struct GNUNET_RECLAIM_AttributeIterator *it); |
227 | 226 | ||
228 | 227 | ||
229 | /** | 228 | /** |
@@ -240,12 +239,12 @@ GNUNET_RECLAIM_get_attributes_stop ( | |||
240 | * @return handle to abort the operation | 239 | * @return handle to abort the operation |
241 | */ | 240 | */ |
242 | struct GNUNET_RECLAIM_Operation * | 241 | struct GNUNET_RECLAIM_Operation * |
243 | GNUNET_RECLAIM_ticket_issue ( | 242 | GNUNET_RECLAIM_ticket_issue( |
244 | struct GNUNET_RECLAIM_Handle *h, | 243 | struct GNUNET_RECLAIM_Handle *h, |
245 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, | 244 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, |
246 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, | 245 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, |
247 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, | 246 | const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, |
248 | GNUNET_RECLAIM_TicketCallback cb, void *cb_cls); | 247 | GNUNET_RECLAIM_TicketCallback cb, void *cb_cls); |
249 | 248 | ||
250 | 249 | ||
251 | /** | 250 | /** |
@@ -262,11 +261,11 @@ GNUNET_RECLAIM_ticket_issue ( | |||
262 | * @return handle to abort the operation | 261 | * @return handle to abort the operation |
263 | */ | 262 | */ |
264 | struct GNUNET_RECLAIM_Operation * | 263 | struct GNUNET_RECLAIM_Operation * |
265 | GNUNET_RECLAIM_ticket_revoke ( | 264 | GNUNET_RECLAIM_ticket_revoke( |
266 | struct GNUNET_RECLAIM_Handle *h, | 265 | struct GNUNET_RECLAIM_Handle *h, |
267 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 266 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
268 | const struct GNUNET_RECLAIM_Ticket *ticket, | 267 | const struct GNUNET_RECLAIM_Ticket *ticket, |
269 | GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls); | 268 | GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls); |
270 | 269 | ||
271 | 270 | ||
272 | /** | 271 | /** |
@@ -282,11 +281,11 @@ GNUNET_RECLAIM_ticket_revoke ( | |||
282 | * @return handle to abort the operation | 281 | * @return handle to abort the operation |
283 | */ | 282 | */ |
284 | struct GNUNET_RECLAIM_Operation * | 283 | struct GNUNET_RECLAIM_Operation * |
285 | GNUNET_RECLAIM_ticket_consume ( | 284 | GNUNET_RECLAIM_ticket_consume( |
286 | struct GNUNET_RECLAIM_Handle *h, | 285 | struct GNUNET_RECLAIM_Handle *h, |
287 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 286 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
288 | const struct GNUNET_RECLAIM_Ticket *ticket, | 287 | const struct GNUNET_RECLAIM_Ticket *ticket, |
289 | GNUNET_RECLAIM_AttributeResult cb, void *cb_cls); | 288 | GNUNET_RECLAIM_AttributeResult cb, void *cb_cls); |
290 | 289 | ||
291 | 290 | ||
292 | /** | 291 | /** |
@@ -307,12 +306,12 @@ GNUNET_RECLAIM_ticket_consume ( | |||
307 | * @return an iterator handle to use for iteration | 306 | * @return an iterator handle to use for iteration |
308 | */ | 307 | */ |
309 | struct GNUNET_RECLAIM_TicketIterator * | 308 | struct GNUNET_RECLAIM_TicketIterator * |
310 | GNUNET_RECLAIM_ticket_iteration_start ( | 309 | GNUNET_RECLAIM_ticket_iteration_start( |
311 | struct GNUNET_RECLAIM_Handle *h, | 310 | struct GNUNET_RECLAIM_Handle *h, |
312 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 311 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
313 | GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, | 312 | GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, |
314 | GNUNET_RECLAIM_TicketCallback proc, void *proc_cls, | 313 | GNUNET_RECLAIM_TicketCallback proc, void *proc_cls, |
315 | GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls); | 314 | GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls); |
316 | 315 | ||
317 | 316 | ||
318 | /** | 317 | /** |
@@ -322,7 +321,7 @@ GNUNET_RECLAIM_ticket_iteration_start ( | |||
322 | * @param it the iterator | 321 | * @param it the iterator |
323 | */ | 322 | */ |
324 | void | 323 | void |
325 | GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it); | 324 | GNUNET_RECLAIM_ticket_iteration_next(struct GNUNET_RECLAIM_TicketIterator *it); |
326 | 325 | ||
327 | 326 | ||
328 | /** | 327 | /** |
@@ -333,7 +332,7 @@ GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it); | |||
333 | * @param it the iterator | 332 | * @param it the iterator |
334 | */ | 333 | */ |
335 | void | 334 | void |
336 | GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it); | 335 | GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it); |
337 | 336 | ||
338 | 337 | ||
339 | /** | 338 | /** |
@@ -342,7 +341,7 @@ GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it); | |||
342 | * @param h identity provider service to disconnect | 341 | * @param h identity provider service to disconnect |
343 | */ | 342 | */ |
344 | void | 343 | void |
345 | GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h); | 344 | GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h); |
346 | 345 | ||
347 | 346 | ||
348 | /** | 347 | /** |
@@ -354,7 +353,7 @@ GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h); | |||
354 | * @param op operation to cancel | 353 | * @param op operation to cancel |
355 | */ | 354 | */ |
356 | void | 355 | void |
357 | GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op); | 356 | GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op); |
358 | 357 | ||
359 | 358 | ||
360 | #if 0 /* keep Emacsens' auto-indent happy */ | 359 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_regex_service.h b/src/include/gnunet_regex_service.h index 4976adc6a..19cead5d4 100644 --- a/src/include/gnunet_regex_service.h +++ b/src/include/gnunet_regex_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Maximilian Szengel | 21 | * @author Maximilian Szengel |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -77,10 +77,10 @@ struct GNUNET_REGEX_Search; | |||
77 | * Must be freed by calling #GNUNET_REGEX_announce_cancel. | 77 | * Must be freed by calling #GNUNET_REGEX_announce_cancel. |
78 | */ | 78 | */ |
79 | struct GNUNET_REGEX_Announcement * | 79 | struct GNUNET_REGEX_Announcement * |
80 | GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, | 80 | GNUNET_REGEX_announce(const struct GNUNET_CONFIGURATION_Handle *cfg, |
81 | const char *regex, | 81 | const char *regex, |
82 | struct GNUNET_TIME_Relative refresh_delay, | 82 | struct GNUNET_TIME_Relative refresh_delay, |
83 | uint16_t compression); | 83 | uint16_t compression); |
84 | 84 | ||
85 | 85 | ||
86 | /** | 86 | /** |
@@ -89,7 +89,7 @@ GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
89 | * @param a handle returned by a previous #GNUNET_REGEX_announce call. | 89 | * @param a handle returned by a previous #GNUNET_REGEX_announce call. |
90 | */ | 90 | */ |
91 | void | 91 | void |
92 | GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *a); | 92 | GNUNET_REGEX_announce_cancel(struct GNUNET_REGEX_Announcement *a); |
93 | 93 | ||
94 | 94 | ||
95 | /** | 95 | /** |
@@ -124,10 +124,10 @@ typedef void | |||
124 | * Must be freed by calling #GNUNET_REGEX_search_cancel. | 124 | * Must be freed by calling #GNUNET_REGEX_search_cancel. |
125 | */ | 125 | */ |
126 | struct GNUNET_REGEX_Search * | 126 | struct GNUNET_REGEX_Search * |
127 | GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg, | 127 | GNUNET_REGEX_search(const struct GNUNET_CONFIGURATION_Handle *cfg, |
128 | const char *string, | 128 | const char *string, |
129 | GNUNET_REGEX_Found callback, | 129 | GNUNET_REGEX_Found callback, |
130 | void *callback_cls); | 130 | void *callback_cls); |
131 | 131 | ||
132 | 132 | ||
133 | /** | 133 | /** |
@@ -136,7 +136,7 @@ GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
136 | * @param s Handle returned by a previous #GNUNET_REGEX_search call. | 136 | * @param s Handle returned by a previous #GNUNET_REGEX_search call. |
137 | */ | 137 | */ |
138 | void | 138 | void |
139 | GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_Search *s); | 139 | GNUNET_REGEX_search_cancel(struct GNUNET_REGEX_Search *s); |
140 | 140 | ||
141 | 141 | ||
142 | #if 0 /* keep Emacsens' auto-indent happy */ | 142 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index 1929feec6..1536a93ca 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -70,14 +70,14 @@ struct GNUNET_RESOLVER_RequestHandle; | |||
70 | * @param cfg configuration to use | 70 | * @param cfg configuration to use |
71 | */ | 71 | */ |
72 | void | 72 | void |
73 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 73 | GNUNET_RESOLVER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
74 | 74 | ||
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Destroy the connection to the resolver service. | 77 | * Destroy the connection to the resolver service. |
78 | */ | 78 | */ |
79 | void | 79 | void |
80 | GNUNET_RESOLVER_disconnect (void); | 80 | GNUNET_RESOLVER_disconnect(void); |
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
@@ -91,11 +91,11 @@ GNUNET_RESOLVER_disconnect (void); | |||
91 | * @return handle that can be used to cancel the request, NULL on error | 91 | * @return handle that can be used to cancel the request, NULL on error |
92 | */ | 92 | */ |
93 | struct GNUNET_RESOLVER_RequestHandle * | 93 | struct GNUNET_RESOLVER_RequestHandle * |
94 | GNUNET_RESOLVER_ip_get (const char *hostname, | 94 | GNUNET_RESOLVER_ip_get(const char *hostname, |
95 | int af, | 95 | int af, |
96 | struct GNUNET_TIME_Relative timeout, | 96 | struct GNUNET_TIME_Relative timeout, |
97 | GNUNET_RESOLVER_AddressCallback callback, | 97 | GNUNET_RESOLVER_AddressCallback callback, |
98 | void *callback_cls); | 98 | void *callback_cls); |
99 | 99 | ||
100 | 100 | ||
101 | /** | 101 | /** |
@@ -108,10 +108,10 @@ GNUNET_RESOLVER_ip_get (const char *hostname, | |||
108 | * @return handle that can be used to cancel the request, NULL on error | 108 | * @return handle that can be used to cancel the request, NULL on error |
109 | */ | 109 | */ |
110 | struct GNUNET_RESOLVER_RequestHandle * | 110 | struct GNUNET_RESOLVER_RequestHandle * |
111 | GNUNET_RESOLVER_hostname_resolve (int af, | 111 | GNUNET_RESOLVER_hostname_resolve(int af, |
112 | struct GNUNET_TIME_Relative timeout, | 112 | struct GNUNET_TIME_Relative timeout, |
113 | GNUNET_RESOLVER_AddressCallback callback, | 113 | GNUNET_RESOLVER_AddressCallback callback, |
114 | void *cls); | 114 | void *cls); |
115 | 115 | ||
116 | 116 | ||
117 | /** | 117 | /** |
@@ -131,7 +131,7 @@ typedef void | |||
131 | * @return local hostname, caller must free | 131 | * @return local hostname, caller must free |
132 | */ | 132 | */ |
133 | char * | 133 | char * |
134 | GNUNET_RESOLVER_local_fqdn_get (void); | 134 | GNUNET_RESOLVER_local_fqdn_get(void); |
135 | 135 | ||
136 | 136 | ||
137 | /** | 137 | /** |
@@ -146,12 +146,12 @@ GNUNET_RESOLVER_local_fqdn_get (void); | |||
146 | * @return handle that can be used to cancel the request, NULL on error | 146 | * @return handle that can be used to cancel the request, NULL on error |
147 | */ | 147 | */ |
148 | struct GNUNET_RESOLVER_RequestHandle * | 148 | struct GNUNET_RESOLVER_RequestHandle * |
149 | GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, | 149 | GNUNET_RESOLVER_hostname_get(const struct sockaddr *sa, |
150 | socklen_t salen, | 150 | socklen_t salen, |
151 | int do_resolve, | 151 | int do_resolve, |
152 | struct GNUNET_TIME_Relative timeout, | 152 | struct GNUNET_TIME_Relative timeout, |
153 | GNUNET_RESOLVER_HostnameCallback callback, | 153 | GNUNET_RESOLVER_HostnameCallback callback, |
154 | void *cls); | 154 | void *cls); |
155 | 155 | ||
156 | 156 | ||
157 | /** | 157 | /** |
@@ -163,7 +163,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, | |||
163 | * @param rh handle of request to cancel | 163 | * @param rh handle of request to cancel |
164 | */ | 164 | */ |
165 | void | 165 | void |
166 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); | 166 | GNUNET_RESOLVER_request_cancel(struct GNUNET_RESOLVER_RequestHandle *rh); |
167 | 167 | ||
168 | 168 | ||
169 | #if 0 /* keep Emacsens' auto-indent happy */ | 169 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h index 83741ab95..e70759590 100644 --- a/src/include/gnunet_rest_lib.h +++ b/src/include/gnunet_rest_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -34,10 +34,9 @@ | |||
34 | #include "gnunet_util_lib.h" | 34 | #include "gnunet_util_lib.h" |
35 | #include <microhttpd.h> | 35 | #include <microhttpd.h> |
36 | 36 | ||
37 | #define GNUNET_REST_HANDLER_END {NULL, NULL, NULL} | 37 | #define GNUNET_REST_HANDLER_END { NULL, NULL, NULL } |
38 | 38 | ||
39 | struct GNUNET_REST_RequestHandle | 39 | struct GNUNET_REST_RequestHandle { |
40 | { | ||
41 | /** | 40 | /** |
42 | * Map of url parameters | 41 | * Map of url parameters |
43 | */ | 42 | */ |
@@ -69,14 +68,12 @@ struct GNUNET_REST_RequestHandle | |||
69 | size_t data_size; | 68 | size_t data_size; |
70 | }; | 69 | }; |
71 | 70 | ||
72 | struct GNUNET_REST_RequestHandlerError | 71 | struct GNUNET_REST_RequestHandlerError { |
73 | { | ||
74 | int error_code; | 72 | int error_code; |
75 | char* error_text; | 73 | char* error_text; |
76 | }; | 74 | }; |
77 | 75 | ||
78 | struct GNUNET_REST_RequestHandler | 76 | struct GNUNET_REST_RequestHandler { |
79 | { | ||
80 | /** | 77 | /** |
81 | * Http method to handle | 78 | * Http method to handle |
82 | */ | 79 | */ |
@@ -93,7 +90,6 @@ struct GNUNET_REST_RequestHandler | |||
93 | void (*proc) (struct GNUNET_REST_RequestHandle *handle, | 90 | void (*proc) (struct GNUNET_REST_RequestHandle *handle, |
94 | const char *url, | 91 | const char *url, |
95 | void *cls); | 92 | void *cls); |
96 | |||
97 | }; | 93 | }; |
98 | 94 | ||
99 | 95 | ||
@@ -116,7 +112,7 @@ typedef void (*GNUNET_REST_ResultProcessor) (void *cls, | |||
116 | * @return GNUNET_YES if namespace matches | 112 | * @return GNUNET_YES if namespace matches |
117 | */ | 113 | */ |
118 | int | 114 | int |
119 | GNUNET_REST_namespace_match (const char *url, const char *namespace); | 115 | GNUNET_REST_namespace_match(const char *url, const char *namespace); |
120 | 116 | ||
121 | /** | 117 | /** |
122 | * Create REST MHD response | 118 | * Create REST MHD response |
@@ -124,15 +120,15 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace); | |||
124 | * @param data result | 120 | * @param data result |
125 | * @return MHD response | 121 | * @return MHD response |
126 | */ | 122 | */ |
127 | struct MHD_Response* | 123 | struct MHD_Response* |
128 | GNUNET_REST_create_response (const char *data); | 124 | GNUNET_REST_create_response(const char *data); |
129 | 125 | ||
130 | 126 | ||
131 | int | 127 | int |
132 | GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn, | 128 | GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn, |
133 | const struct GNUNET_REST_RequestHandler *handlers, | 129 | const struct GNUNET_REST_RequestHandler *handlers, |
134 | struct GNUNET_REST_RequestHandlerError *err, | 130 | struct GNUNET_REST_RequestHandlerError *err, |
135 | void *cls); | 131 | void *cls); |
136 | 132 | ||
137 | 133 | ||
138 | #endif | 134 | #endif |
diff --git a/src/include/gnunet_rest_plugin.h b/src/include/gnunet_rest_plugin.h index 54eeb902d..596f9937a 100644 --- a/src/include/gnunet_rest_plugin.h +++ b/src/include/gnunet_rest_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Martin Schanzenbach | 21 | * @author Martin Schanzenbach |
22 | * | 22 | * |
@@ -45,9 +45,7 @@ extern "C" | |||
45 | /** | 45 | /** |
46 | * @brief struct returned by the initialization function of the plugin | 46 | * @brief struct returned by the initialization function of the plugin |
47 | */ | 47 | */ |
48 | struct GNUNET_REST_Plugin | 48 | struct GNUNET_REST_Plugin { |
49 | { | ||
50 | |||
51 | /** | 49 | /** |
52 | * | 50 | * |
53 | * The closure of the plugin | 51 | * The closure of the plugin |
@@ -74,7 +72,6 @@ struct GNUNET_REST_Plugin | |||
74 | void (*process_request) (struct GNUNET_REST_RequestHandle *handle, | 72 | void (*process_request) (struct GNUNET_REST_RequestHandle *handle, |
75 | GNUNET_REST_ResultProcessor proc, | 73 | GNUNET_REST_ResultProcessor proc, |
76 | void *proc_cls); | 74 | void *proc_cls); |
77 | |||
78 | }; | 75 | }; |
79 | 76 | ||
80 | 77 | ||
diff --git a/src/include/gnunet_revocation_service.h b/src/include/gnunet_revocation_service.h index 5fb2ed7c5..2acbe89d8 100644 --- a/src/include/gnunet_revocation_service.h +++ b/src/include/gnunet_revocation_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -65,7 +65,7 @@ struct GNUNET_REVOCATION_Query; | |||
65 | * | 65 | * |
66 | */ | 66 | */ |
67 | typedef void (*GNUNET_REVOCATION_Callback) (void *cls, | 67 | typedef void (*GNUNET_REVOCATION_Callback) (void *cls, |
68 | int is_valid); | 68 | int is_valid); |
69 | 69 | ||
70 | 70 | ||
71 | /** | 71 | /** |
@@ -78,9 +78,9 @@ typedef void (*GNUNET_REVOCATION_Callback) (void *cls, | |||
78 | * @return handle to use in #GNUNET_REVOCATION_query_cancel to stop REVOCATION from invoking the callback | 78 | * @return handle to use in #GNUNET_REVOCATION_query_cancel to stop REVOCATION from invoking the callback |
79 | */ | 79 | */ |
80 | struct GNUNET_REVOCATION_Query * | 80 | struct GNUNET_REVOCATION_Query * |
81 | GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, | 81 | GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg, |
82 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 82 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, |
83 | GNUNET_REVOCATION_Callback func, void *func_cls); | 83 | GNUNET_REVOCATION_Callback func, void *func_cls); |
84 | 84 | ||
85 | 85 | ||
86 | /** | 86 | /** |
@@ -89,7 +89,7 @@ GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
89 | * @param q query to cancel | 89 | * @param q query to cancel |
90 | */ | 90 | */ |
91 | void | 91 | void |
92 | GNUNET_REVOCATION_query_cancel (struct GNUNET_REVOCATION_Query *q); | 92 | GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q); |
93 | 93 | ||
94 | 94 | ||
95 | /** | 95 | /** |
@@ -114,11 +114,11 @@ struct GNUNET_REVOCATION_Handle; | |||
114 | * @return handle to use in #GNUNET_REVOCATION_revoke_cancel to stop REVOCATION from invoking the callback | 114 | * @return handle to use in #GNUNET_REVOCATION_revoke_cancel to stop REVOCATION from invoking the callback |
115 | */ | 115 | */ |
116 | struct GNUNET_REVOCATION_Handle * | 116 | struct GNUNET_REVOCATION_Handle * |
117 | GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, | 117 | GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg, |
118 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 118 | const struct GNUNET_CRYPTO_EcdsaPublicKey *key, |
119 | const struct GNUNET_CRYPTO_EcdsaSignature *sig, | 119 | const struct GNUNET_CRYPTO_EcdsaSignature *sig, |
120 | uint64_t pow, | 120 | uint64_t pow, |
121 | GNUNET_REVOCATION_Callback func, void *func_cls); | 121 | GNUNET_REVOCATION_Callback func, void *func_cls); |
122 | 122 | ||
123 | 123 | ||
124 | /** | 124 | /** |
@@ -127,7 +127,7 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
127 | * @param h operation to cancel | 127 | * @param h operation to cancel |
128 | */ | 128 | */ |
129 | void | 129 | void |
130 | GNUNET_REVOCATION_revoke_cancel (struct GNUNET_REVOCATION_Handle *h); | 130 | GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h); |
131 | 131 | ||
132 | 132 | ||
133 | /** | 133 | /** |
@@ -140,9 +140,9 @@ GNUNET_REVOCATION_revoke_cancel (struct GNUNET_REVOCATION_Handle *h); | |||
140 | * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not | 140 | * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not |
141 | */ | 141 | */ |
142 | int | 142 | int |
143 | GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 143 | GNUNET_REVOCATION_check_pow(const struct GNUNET_CRYPTO_EcdsaPublicKey *key, |
144 | uint64_t pow, | 144 | uint64_t pow, |
145 | unsigned int matching_bits); | 145 | unsigned int matching_bits); |
146 | 146 | ||
147 | 147 | ||
148 | /** | 148 | /** |
@@ -152,8 +152,8 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | |||
152 | * @param sig where to write the revocation signature | 152 | * @param sig where to write the revocation signature |
153 | */ | 153 | */ |
154 | void | 154 | void |
155 | GNUNET_REVOCATION_sign_revocation (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 155 | GNUNET_REVOCATION_sign_revocation(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
156 | struct GNUNET_CRYPTO_EcdsaSignature *sig); | 156 | struct GNUNET_CRYPTO_EcdsaSignature *sig); |
157 | 157 | ||
158 | 158 | ||
159 | #if 0 /* keep Emacsens' auto-indent happy */ | 159 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_rps_service.h b/src/include/gnunet_rps_service.h index b669c55ef..a580d1cc2 100644 --- a/src/include/gnunet_rps_service.h +++ b/src/include/gnunet_rps_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -62,8 +62,8 @@ struct GNUNET_RPS_Request_Handle; | |||
62 | * @param peers array with num_peers PeerIDs | 62 | * @param peers array with num_peers PeerIDs |
63 | */ | 63 | */ |
64 | typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, | 64 | typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, |
65 | uint64_t num_peers, | 65 | uint64_t num_peers, |
66 | const struct GNUNET_PeerIdentity *peers); | 66 | const struct GNUNET_PeerIdentity *peers); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -76,9 +76,9 @@ typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, | |||
76 | * @param num_observed Number of IDs this sampler has observed | 76 | * @param num_observed Number of IDs this sampler has observed |
77 | */ | 77 | */ |
78 | typedef void (* GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls, | 78 | typedef void (* GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls, |
79 | const struct GNUNET_PeerIdentity *peer, | 79 | const struct GNUNET_PeerIdentity *peer, |
80 | double probability, | 80 | double probability, |
81 | uint32_t num_observed); | 81 | uint32_t num_observed); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
@@ -88,7 +88,7 @@ typedef void (* GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls, | |||
88 | * @return handle to the rps service | 88 | * @return handle to the rps service |
89 | */ | 89 | */ |
90 | struct GNUNET_RPS_Handle * | 90 | struct GNUNET_RPS_Handle * |
91 | GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 91 | GNUNET_RPS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
92 | 92 | ||
93 | 93 | ||
94 | /** | 94 | /** |
@@ -98,8 +98,8 @@ GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
98 | * @param shared_value The shared value that defines the members of the sub (-group) | 98 | * @param shared_value The shared value that defines the members of the sub (-group) |
99 | */ | 99 | */ |
100 | void | 100 | void |
101 | GNUNET_RPS_sub_start (struct GNUNET_RPS_Handle *h, | 101 | GNUNET_RPS_sub_start(struct GNUNET_RPS_Handle *h, |
102 | const char *shared_value); | 102 | const char *shared_value); |
103 | 103 | ||
104 | 104 | ||
105 | /** | 105 | /** |
@@ -109,8 +109,8 @@ GNUNET_RPS_sub_start (struct GNUNET_RPS_Handle *h, | |||
109 | * @param shared_value The shared value that defines the members of the sub (-group) | 109 | * @param shared_value The shared value that defines the members of the sub (-group) |
110 | */ | 110 | */ |
111 | void | 111 | void |
112 | GNUNET_RPS_sub_stop (struct GNUNET_RPS_Handle *h, | 112 | GNUNET_RPS_sub_stop(struct GNUNET_RPS_Handle *h, |
113 | const char *shared_value); | 113 | const char *shared_value); |
114 | 114 | ||
115 | 115 | ||
116 | /** | 116 | /** |
@@ -128,9 +128,9 @@ GNUNET_RPS_sub_stop (struct GNUNET_RPS_Handle *h, | |||
128 | * @return handle to this request | 128 | * @return handle to this request |
129 | */ | 129 | */ |
130 | struct GNUNET_RPS_Request_Handle * | 130 | struct GNUNET_RPS_Request_Handle * |
131 | GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n, | 131 | GNUNET_RPS_request_peers(struct GNUNET_RPS_Handle *h, uint32_t n, |
132 | GNUNET_RPS_NotifyReadyCB ready_cb, | 132 | GNUNET_RPS_NotifyReadyCB ready_cb, |
133 | void *cls); | 133 | void *cls); |
134 | 134 | ||
135 | 135 | ||
136 | /** | 136 | /** |
@@ -142,9 +142,9 @@ GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n, | |||
142 | * @return a handle to cancel this request | 142 | * @return a handle to cancel this request |
143 | */ | 143 | */ |
144 | struct GNUNET_RPS_Request_Handle_Single_Info * | 144 | struct GNUNET_RPS_Request_Handle_Single_Info * |
145 | GNUNET_RPS_request_peer_info (struct GNUNET_RPS_Handle *rps_handle, | 145 | GNUNET_RPS_request_peer_info(struct GNUNET_RPS_Handle *rps_handle, |
146 | GNUNET_RPS_NotifyReadySingleInfoCB ready_cb, | 146 | GNUNET_RPS_NotifyReadySingleInfoCB ready_cb, |
147 | void *cls); | 147 | void *cls); |
148 | 148 | ||
149 | 149 | ||
150 | /** | 150 | /** |
@@ -155,8 +155,8 @@ GNUNET_RPS_request_peer_info (struct GNUNET_RPS_Handle *rps_handle, | |||
155 | * @param ids the ids of the peers seeded | 155 | * @param ids the ids of the peers seeded |
156 | */ | 156 | */ |
157 | void | 157 | void |
158 | GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint32_t n, | 158 | GNUNET_RPS_seed_ids(struct GNUNET_RPS_Handle *h, uint32_t n, |
159 | const struct GNUNET_PeerIdentity * ids); | 159 | const struct GNUNET_PeerIdentity * ids); |
160 | 160 | ||
161 | /** | 161 | /** |
162 | * Cancle an issued request. | 162 | * Cancle an issued request. |
@@ -164,7 +164,7 @@ GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint32_t n, | |||
164 | * @param rh handle of the pending request to be canceled | 164 | * @param rh handle of the pending request to be canceled |
165 | */ | 165 | */ |
166 | void | 166 | void |
167 | GNUNET_RPS_request_cancel (struct GNUNET_RPS_Request_Handle *rh); | 167 | GNUNET_RPS_request_cancel(struct GNUNET_RPS_Request_Handle *rh); |
168 | 168 | ||
169 | 169 | ||
170 | /** | 170 | /** |
@@ -173,8 +173,8 @@ GNUNET_RPS_request_cancel (struct GNUNET_RPS_Request_Handle *rh); | |||
173 | * @param rhs request handle of request to cancle | 173 | * @param rhs request handle of request to cancle |
174 | */ | 174 | */ |
175 | void | 175 | void |
176 | GNUNET_RPS_request_single_info_cancel ( | 176 | GNUNET_RPS_request_single_info_cancel( |
177 | struct GNUNET_RPS_Request_Handle_Single_Info *rhs); | 177 | struct GNUNET_RPS_Request_Handle_Single_Info *rhs); |
178 | 178 | ||
179 | 179 | ||
180 | #if ENABLE_MALICIOUS | 180 | #if ENABLE_MALICIOUS |
@@ -192,12 +192,12 @@ GNUNET_RPS_request_single_info_cancel ( | |||
192 | * if @type is 2 the last id is the id of the | 192 | * if @type is 2 the last id is the id of the |
193 | * peer to be isolated from the rest | 193 | * peer to be isolated from the rest |
194 | */ | 194 | */ |
195 | void | 195 | void |
196 | GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, | 196 | GNUNET_RPS_act_malicious(struct GNUNET_RPS_Handle *h, |
197 | uint32_t type, | 197 | uint32_t type, |
198 | uint32_t num_peers, | 198 | uint32_t num_peers, |
199 | const struct GNUNET_PeerIdentity *ids, | 199 | const struct GNUNET_PeerIdentity *ids, |
200 | const struct GNUNET_PeerIdentity *target_peer); | 200 | const struct GNUNET_PeerIdentity *target_peer); |
201 | #endif /* ENABLE_MALICIOUS */ | 201 | #endif /* ENABLE_MALICIOUS */ |
202 | 202 | ||
203 | /* Get internals for debugging/profiling purposes */ | 203 | /* Get internals for debugging/profiling purposes */ |
@@ -212,10 +212,10 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, | |||
212 | * @param ready_cb the callback called when the peers are available | 212 | * @param ready_cb the callback called when the peers are available |
213 | */ | 213 | */ |
214 | void | 214 | void |
215 | GNUNET_RPS_view_request (struct GNUNET_RPS_Handle *rps_handle, | 215 | GNUNET_RPS_view_request(struct GNUNET_RPS_Handle *rps_handle, |
216 | uint32_t num_updates, | 216 | uint32_t num_updates, |
217 | GNUNET_RPS_NotifyReadyCB view_update_cb, | 217 | GNUNET_RPS_NotifyReadyCB view_update_cb, |
218 | void *cls); | 218 | void *cls); |
219 | 219 | ||
220 | 220 | ||
221 | /** | 221 | /** |
@@ -226,9 +226,9 @@ GNUNET_RPS_view_request (struct GNUNET_RPS_Handle *rps_handle, | |||
226 | * @param ready_cb the callback called when the peers are available | 226 | * @param ready_cb the callback called when the peers are available |
227 | */ | 227 | */ |
228 | struct GNUNET_RPS_StreamRequestHandle * | 228 | struct GNUNET_RPS_StreamRequestHandle * |
229 | GNUNET_RPS_stream_request (struct GNUNET_RPS_Handle *rps_handle, | 229 | GNUNET_RPS_stream_request(struct GNUNET_RPS_Handle *rps_handle, |
230 | GNUNET_RPS_NotifyReadyCB stream_input_cb, | 230 | GNUNET_RPS_NotifyReadyCB stream_input_cb, |
231 | void *cls); | 231 | void *cls); |
232 | 232 | ||
233 | 233 | ||
234 | /** | 234 | /** |
@@ -237,7 +237,7 @@ GNUNET_RPS_stream_request (struct GNUNET_RPS_Handle *rps_handle, | |||
237 | * @param srh The request handle to cancel | 237 | * @param srh The request handle to cancel |
238 | */ | 238 | */ |
239 | void | 239 | void |
240 | GNUNET_RPS_stream_cancel (struct GNUNET_RPS_StreamRequestHandle *srh); | 240 | GNUNET_RPS_stream_cancel(struct GNUNET_RPS_StreamRequestHandle *srh); |
241 | 241 | ||
242 | 242 | ||
243 | /** | 243 | /** |
@@ -245,8 +245,8 @@ GNUNET_RPS_stream_cancel (struct GNUNET_RPS_StreamRequestHandle *srh); | |||
245 | * | 245 | * |
246 | * @param h the handle to the rps service | 246 | * @param h the handle to the rps service |
247 | */ | 247 | */ |
248 | void | 248 | void |
249 | GNUNET_RPS_disconnect (struct GNUNET_RPS_Handle *h); | 249 | GNUNET_RPS_disconnect(struct GNUNET_RPS_Handle *h); |
250 | 250 | ||
251 | 251 | ||
252 | #if 0 /* keep Emacsens' auto-indent happy */ | 252 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_scalarproduct_service.h b/src/include/gnunet_scalarproduct_service.h index 5d61946bb..512d72260 100644 --- a/src/include/gnunet_scalarproduct_service.h +++ b/src/include/gnunet_scalarproduct_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -49,9 +49,7 @@ extern "C" { | |||
49 | /** | 49 | /** |
50 | * Result status values for the computation. | 50 | * Result status values for the computation. |
51 | */ | 51 | */ |
52 | enum GNUNET_SCALARPRODUCT_ResponseStatus | 52 | enum GNUNET_SCALARPRODUCT_ResponseStatus { |
53 | { | ||
54 | |||
55 | /** | 53 | /** |
56 | * Operation is still active (never returned, used internally). | 54 | * Operation is still active (never returned, used internally). |
57 | */ | 55 | */ |
@@ -95,8 +93,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
95 | /** | 93 | /** |
96 | * An element key-value pair for scalarproduct | 94 | * An element key-value pair for scalarproduct |
97 | */ | 95 | */ |
98 | struct GNUNET_SCALARPRODUCT_Element | 96 | struct GNUNET_SCALARPRODUCT_Element { |
99 | { | ||
100 | /** | 97 | /** |
101 | * Key used to identify matching pairs of values to multiply. | 98 | * Key used to identify matching pairs of values to multiply. |
102 | */ | 99 | */ |
@@ -155,13 +152,13 @@ struct GNUNET_SCALARPRODUCT_ComputationHandle; | |||
155 | * @return a new handle for this computation | 152 | * @return a new handle for this computation |
156 | */ | 153 | */ |
157 | struct GNUNET_SCALARPRODUCT_ComputationHandle * | 154 | struct GNUNET_SCALARPRODUCT_ComputationHandle * |
158 | GNUNET_SCALARPRODUCT_start_computation (const struct GNUNET_CONFIGURATION_Handle *cfg, | 155 | GNUNET_SCALARPRODUCT_start_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, |
159 | const struct GNUNET_HashCode *session_key, | 156 | const struct GNUNET_HashCode *session_key, |
160 | const struct GNUNET_PeerIdentity *peer, | 157 | const struct GNUNET_PeerIdentity *peer, |
161 | const struct GNUNET_SCALARPRODUCT_Element *elements, | 158 | const struct GNUNET_SCALARPRODUCT_Element *elements, |
162 | uint32_t element_count, | 159 | uint32_t element_count, |
163 | GNUNET_SCALARPRODUCT_DatumProcessor cont, | 160 | GNUNET_SCALARPRODUCT_DatumProcessor cont, |
164 | void *cont_cls); | 161 | void *cont_cls); |
165 | 162 | ||
166 | 163 | ||
167 | /** | 164 | /** |
@@ -176,12 +173,12 @@ GNUNET_SCALARPRODUCT_start_computation (const struct GNUNET_CONFIGURATION_Handle | |||
176 | * @return a new handle for this computation | 173 | * @return a new handle for this computation |
177 | */ | 174 | */ |
178 | struct GNUNET_SCALARPRODUCT_ComputationHandle * | 175 | struct GNUNET_SCALARPRODUCT_ComputationHandle * |
179 | GNUNET_SCALARPRODUCT_accept_computation (const struct GNUNET_CONFIGURATION_Handle *cfg, | 176 | GNUNET_SCALARPRODUCT_accept_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, |
180 | const struct GNUNET_HashCode *key, | 177 | const struct GNUNET_HashCode *key, |
181 | const struct GNUNET_SCALARPRODUCT_Element *elements, | 178 | const struct GNUNET_SCALARPRODUCT_Element *elements, |
182 | uint32_t element_count, | 179 | uint32_t element_count, |
183 | GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, | 180 | GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, |
184 | void *cont_cls); | 181 | void *cont_cls); |
185 | 182 | ||
186 | 183 | ||
187 | /** | 184 | /** |
@@ -191,7 +188,7 @@ GNUNET_SCALARPRODUCT_accept_computation (const struct GNUNET_CONFIGURATION_Handl | |||
191 | * @param h computation handle to terminate | 188 | * @param h computation handle to terminate |
192 | */ | 189 | */ |
193 | void | 190 | void |
194 | GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle *h); | 191 | GNUNET_SCALARPRODUCT_cancel(struct GNUNET_SCALARPRODUCT_ComputationHandle *h); |
195 | 192 | ||
196 | 193 | ||
197 | #if 0 /* keep Emacsens' auto-indent happy */ | 194 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 3f0350f54..39b16a1b4 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -52,8 +52,7 @@ struct GNUNET_SCHEDULER_Task; | |||
52 | * Reasons why the schedule may have triggered | 52 | * Reasons why the schedule may have triggered |
53 | * the task now. | 53 | * the task now. |
54 | */ | 54 | */ |
55 | enum GNUNET_SCHEDULER_Reason | 55 | enum GNUNET_SCHEDULER_Reason { |
56 | { | ||
57 | /** | 56 | /** |
58 | * This task is not ready. | 57 | * This task is not ready. |
59 | */ | 58 | */ |
@@ -100,9 +99,7 @@ enum GNUNET_SCHEDULER_Reason | |||
100 | * Possible events on FDs, used as a bitmask. | 99 | * Possible events on FDs, used as a bitmask. |
101 | * Modelled after GPollFD. | 100 | * Modelled after GPollFD. |
102 | */ | 101 | */ |
103 | enum GNUNET_SCHEDULER_EventType | 102 | enum GNUNET_SCHEDULER_EventType { |
104 | { | ||
105 | |||
106 | /** | 103 | /** |
107 | * No event (useful for timeout). | 104 | * No event (useful for timeout). |
108 | */ | 105 | */ |
@@ -137,16 +134,13 @@ enum GNUNET_SCHEDULER_EventType | |||
137 | * | 134 | * |
138 | */ | 135 | */ |
139 | GNUNET_SCHEDULER_ET_NVAL = 32 | 136 | GNUNET_SCHEDULER_ET_NVAL = 32 |
140 | |||
141 | }; | 137 | }; |
142 | 138 | ||
143 | 139 | ||
144 | /** | 140 | /** |
145 | * Information about an event relating to a file descriptor/socket. | 141 | * Information about an event relating to a file descriptor/socket. |
146 | */ | 142 | */ |
147 | struct GNUNET_SCHEDULER_FdInfo | 143 | struct GNUNET_SCHEDULER_FdInfo { |
148 | { | ||
149 | |||
150 | /** | 144 | /** |
151 | * GNUnet network socket the event is about, matches @a sock, | 145 | * GNUnet network socket the event is about, matches @a sock, |
152 | * NULL if this is about a file handle or if no network | 146 | * NULL if this is about a file handle or if no network |
@@ -170,15 +164,13 @@ struct GNUNET_SCHEDULER_FdInfo | |||
170 | * Underlying OS handle the event was about. | 164 | * Underlying OS handle the event was about. |
171 | */ | 165 | */ |
172 | int sock; | 166 | int sock; |
173 | |||
174 | }; | 167 | }; |
175 | 168 | ||
176 | 169 | ||
177 | /** | 170 | /** |
178 | * Context information passed to each scheduler task. | 171 | * Context information passed to each scheduler task. |
179 | */ | 172 | */ |
180 | struct GNUNET_SCHEDULER_TaskContext | 173 | struct GNUNET_SCHEDULER_TaskContext { |
181 | { | ||
182 | /** | 174 | /** |
183 | * Reason why the task is run now | 175 | * Reason why the task is run now |
184 | */ | 176 | */ |
@@ -210,7 +202,6 @@ struct GNUNET_SCHEDULER_TaskContext | |||
210 | * @deprecated | 202 | * @deprecated |
211 | */ | 203 | */ |
212 | const struct GNUNET_NETWORK_FDSet *write_ready; | 204 | const struct GNUNET_NETWORK_FDSet *write_ready; |
213 | |||
214 | }; | 205 | }; |
215 | 206 | ||
216 | 207 | ||
@@ -228,8 +219,8 @@ struct GNUNET_SCHEDULER_TaskContext | |||
228 | * @param fdi information about the related FD | 219 | * @param fdi information about the related FD |
229 | */ | 220 | */ |
230 | void | 221 | void |
231 | GNUNET_SCHEDULER_task_ready (struct GNUNET_SCHEDULER_Task *task, | 222 | GNUNET_SCHEDULER_task_ready(struct GNUNET_SCHEDULER_Task *task, |
232 | struct GNUNET_SCHEDULER_FdInfo *fdi); | 223 | struct GNUNET_SCHEDULER_FdInfo *fdi); |
233 | 224 | ||
234 | 225 | ||
235 | /** | 226 | /** |
@@ -241,7 +232,7 @@ struct GNUNET_SCHEDULER_Handle; | |||
241 | /** | 232 | /** |
242 | * Function called by external event loop implementations to tell the | 233 | * Function called by external event loop implementations to tell the |
243 | * scheduler to run some of the tasks that are ready. Must be called | 234 | * scheduler to run some of the tasks that are ready. Must be called |
244 | * only after #GNUNET_SCHEDULER_driver_init has been called and before | 235 | * only after #GNUNET_SCHEDULER_driver_init has been called and before |
245 | * #GNUNET_SCHEDULER_driver_done is called. | 236 | * #GNUNET_SCHEDULER_driver_done is called. |
246 | * This function may return even though there are tasks left to run | 237 | * This function may return even though there are tasks left to run |
247 | * just to give other tasks a chance as well. If we return #GNUNET_YES, | 238 | * just to give other tasks a chance as well. If we return #GNUNET_YES, |
@@ -259,23 +250,21 @@ struct GNUNET_SCHEDULER_Handle; | |||
259 | * if we are done running tasks (yield to block) | 250 | * if we are done running tasks (yield to block) |
260 | */ | 251 | */ |
261 | int | 252 | int |
262 | GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh); | 253 | GNUNET_SCHEDULER_do_work(struct GNUNET_SCHEDULER_Handle *sh); |
263 | 254 | ||
264 | 255 | ||
265 | /** | 256 | /** |
266 | * API an external event loop has to implement for | 257 | * API an external event loop has to implement for |
267 | * #GNUNET_SCHEDULER_driver_init. | 258 | * #GNUNET_SCHEDULER_driver_init. |
268 | */ | 259 | */ |
269 | struct GNUNET_SCHEDULER_Driver | 260 | struct GNUNET_SCHEDULER_Driver { |
270 | { | ||
271 | |||
272 | /** | 261 | /** |
273 | * Closure to pass to the functions in this struct. | 262 | * Closure to pass to the functions in this struct. |
274 | */ | 263 | */ |
275 | void *cls; | 264 | void *cls; |
276 | 265 | ||
277 | /** | 266 | /** |
278 | * Add a @a task to be run if the conditions specified in the | 267 | * Add a @a task to be run if the conditions specified in the |
279 | * et field of the given @a fdi are satisfied. The et field will | 268 | * et field of the given @a fdi are satisfied. The et field will |
280 | * be cleared after this call and the driver is expected to set | 269 | * be cleared after this call and the driver is expected to set |
281 | * the type of the actual event before passing @a fdi to | 270 | * the type of the actual event before passing @a fdi to |
@@ -289,7 +278,7 @@ struct GNUNET_SCHEDULER_Driver | |||
289 | */ | 278 | */ |
290 | int | 279 | int |
291 | (*add)(void *cls, | 280 | (*add)(void *cls, |
292 | struct GNUNET_SCHEDULER_Task *task, | 281 | struct GNUNET_SCHEDULER_Task *task, |
293 | struct GNUNET_SCHEDULER_FdInfo *fdi); | 282 | struct GNUNET_SCHEDULER_FdInfo *fdi); |
294 | 283 | ||
295 | /** | 284 | /** |
@@ -304,7 +293,7 @@ struct GNUNET_SCHEDULER_Driver | |||
304 | */ | 293 | */ |
305 | int | 294 | int |
306 | (*del)(void *cls, | 295 | (*del)(void *cls, |
307 | struct GNUNET_SCHEDULER_Task *task); | 296 | struct GNUNET_SCHEDULER_Task *task); |
308 | 297 | ||
309 | /** | 298 | /** |
310 | * Set time at which we definitively want to get a wakeup call. | 299 | * Set time at which we definitively want to get a wakeup call. |
@@ -314,8 +303,7 @@ struct GNUNET_SCHEDULER_Driver | |||
314 | */ | 303 | */ |
315 | void | 304 | void |
316 | (*set_wakeup)(void *cls, | 305 | (*set_wakeup)(void *cls, |
317 | struct GNUNET_TIME_Absolute dt); | 306 | struct GNUNET_TIME_Absolute dt); |
318 | |||
319 | }; | 307 | }; |
320 | 308 | ||
321 | 309 | ||
@@ -332,7 +320,7 @@ typedef void | |||
332 | * Function called by external event loop implementations to initialize | 320 | * Function called by external event loop implementations to initialize |
333 | * the scheduler. An external implementation has to provide @a driver | 321 | * the scheduler. An external implementation has to provide @a driver |
334 | * which contains callbacks for the scheduler (see definition of struct | 322 | * which contains callbacks for the scheduler (see definition of struct |
335 | * #GNUNET_SCHEDULER_Driver). The callbacks are used to instruct the | 323 | * #GNUNET_SCHEDULER_Driver). The callbacks are used to instruct the |
336 | * external implementation to watch for events. If it detects any of | 324 | * external implementation to watch for events. If it detects any of |
337 | * those events it is expected to call #GNUNET_SCHEDULER_do_work to let | 325 | * those events it is expected to call #GNUNET_SCHEDULER_do_work to let |
338 | * the scheduler handle it. If an event is related to a specific task | 326 | * the scheduler handle it. If an event is related to a specific task |
@@ -341,11 +329,11 @@ typedef void | |||
341 | * before by calling #GNUNET_SCHEDULER_task_ready. | 329 | * before by calling #GNUNET_SCHEDULER_task_ready. |
342 | * | 330 | * |
343 | * This function has to be called before any tasks are scheduled and | 331 | * This function has to be called before any tasks are scheduled and |
344 | * before GNUNET_SCHEDULER_do_work is called for the first time. It | 332 | * before GNUNET_SCHEDULER_do_work is called for the first time. It |
345 | * allocates resources that have to be freed again by calling | 333 | * allocates resources that have to be freed again by calling |
346 | * #GNUNET_SCHEDULER_driver_done. | 334 | * #GNUNET_SCHEDULER_driver_done. |
347 | * | 335 | * |
348 | * This function installs the same signal handlers as | 336 | * This function installs the same signal handlers as |
349 | * #GNUNET_SCHEDULER_run. This means SIGTERM (and other similar signals) | 337 | * #GNUNET_SCHEDULER_run. This means SIGTERM (and other similar signals) |
350 | * will induce a call to #GNUNET_SCHEDULER_shutdown during the next | 338 | * will induce a call to #GNUNET_SCHEDULER_shutdown during the next |
351 | * call to #GNUNET_SCHEDULER_do_work. As a result, SIGTERM causes all | 339 | * call to #GNUNET_SCHEDULER_do_work. As a result, SIGTERM causes all |
@@ -360,7 +348,7 @@ typedef void | |||
360 | * #GNUNET_SCHEDULER_driver_done | 348 | * #GNUNET_SCHEDULER_driver_done |
361 | */ | 349 | */ |
362 | struct GNUNET_SCHEDULER_Handle * | 350 | struct GNUNET_SCHEDULER_Handle * |
363 | GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | 351 | GNUNET_SCHEDULER_driver_init(const struct GNUNET_SCHEDULER_Driver *driver); |
364 | 352 | ||
365 | 353 | ||
366 | /** | 354 | /** |
@@ -368,7 +356,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | |||
368 | * by external event loop implementations after the scheduler has | 356 | * by external event loop implementations after the scheduler has |
369 | * shut down. This is the case if both of the following conditions | 357 | * shut down. This is the case if both of the following conditions |
370 | * are met: | 358 | * are met: |
371 | * | 359 | * |
372 | * - all tasks the scheduler has added through the driver's add | 360 | * - all tasks the scheduler has added through the driver's add |
373 | * callback have been removed again through the driver's del | 361 | * callback have been removed again through the driver's del |
374 | * callback | 362 | * callback |
@@ -378,7 +366,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | |||
378 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init | 366 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init |
379 | */ | 367 | */ |
380 | void | 368 | void |
381 | GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh); | 369 | GNUNET_SCHEDULER_driver_done(struct GNUNET_SCHEDULER_Handle *sh); |
382 | 370 | ||
383 | 371 | ||
384 | /** | 372 | /** |
@@ -387,7 +375,7 @@ GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh); | |||
387 | * @return NULL on error | 375 | * @return NULL on error |
388 | */ | 376 | */ |
389 | struct GNUNET_SCHEDULER_Driver * | 377 | struct GNUNET_SCHEDULER_Driver * |
390 | GNUNET_SCHEDULER_driver_select (void); | 378 | GNUNET_SCHEDULER_driver_select(void); |
391 | 379 | ||
392 | 380 | ||
393 | /** | 381 | /** |
@@ -424,8 +412,8 @@ typedef int | |||
424 | * @param task_cls closure of @a task | 412 | * @param task_cls closure of @a task |
425 | */ | 413 | */ |
426 | void | 414 | void |
427 | GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, | 415 | GNUNET_SCHEDULER_run(GNUNET_SCHEDULER_TaskCallback task, |
428 | void *task_cls); | 416 | void *task_cls); |
429 | 417 | ||
430 | /** | 418 | /** |
431 | * Initialize and run scheduler. This function will return when all | 419 | * Initialize and run scheduler. This function will return when all |
@@ -439,9 +427,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, | |||
439 | * @param task_cls closure of @a task | 427 | * @param task_cls closure of @a task |
440 | */ | 428 | */ |
441 | void | 429 | void |
442 | GNUNET_SCHEDULER_run_with_optional_signals (int install_signals, | 430 | GNUNET_SCHEDULER_run_with_optional_signals(int install_signals, |
443 | GNUNET_SCHEDULER_TaskCallback task, | 431 | GNUNET_SCHEDULER_TaskCallback task, |
444 | void *task_cls); | 432 | void *task_cls); |
445 | 433 | ||
446 | 434 | ||
447 | /** | 435 | /** |
@@ -451,7 +439,7 @@ GNUNET_SCHEDULER_run_with_optional_signals (int install_signals, | |||
451 | * will be delayed until the next shutdown signal. | 439 | * will be delayed until the next shutdown signal. |
452 | */ | 440 | */ |
453 | void | 441 | void |
454 | GNUNET_SCHEDULER_shutdown (void); | 442 | GNUNET_SCHEDULER_shutdown(void); |
455 | 443 | ||
456 | 444 | ||
457 | /** | 445 | /** |
@@ -466,7 +454,7 @@ GNUNET_SCHEDULER_shutdown (void); | |||
466 | * @return number of tasks pending right now | 454 | * @return number of tasks pending right now |
467 | */ | 455 | */ |
468 | unsigned int | 456 | unsigned int |
469 | GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | 457 | GNUNET_SCHEDULER_get_load(enum GNUNET_SCHEDULER_Priority p); |
470 | 458 | ||
471 | 459 | ||
472 | /** | 460 | /** |
@@ -476,7 +464,7 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | |||
476 | * @return task context with information why the current task is run | 464 | * @return task context with information why the current task is run |
477 | */ | 465 | */ |
478 | const struct GNUNET_SCHEDULER_TaskContext * | 466 | const struct GNUNET_SCHEDULER_TaskContext * |
479 | GNUNET_SCHEDULER_get_task_context (void); | 467 | GNUNET_SCHEDULER_get_task_context(void); |
480 | 468 | ||
481 | 469 | ||
482 | /** | 470 | /** |
@@ -492,7 +480,7 @@ GNUNET_SCHEDULER_get_task_context (void); | |||
492 | * @return original closure of the task | 480 | * @return original closure of the task |
493 | */ | 481 | */ |
494 | void * | 482 | void * |
495 | GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task); | 483 | GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task); |
496 | 484 | ||
497 | 485 | ||
498 | /** | 486 | /** |
@@ -506,10 +494,10 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task); | |||
506 | * @param priority priority to use for the task | 494 | * @param priority priority to use for the task |
507 | */ | 495 | */ |
508 | void | 496 | void |
509 | GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback task, | 497 | GNUNET_SCHEDULER_add_with_reason_and_priority(GNUNET_SCHEDULER_TaskCallback task, |
510 | void *task_cls, | 498 | void *task_cls, |
511 | enum GNUNET_SCHEDULER_Reason reason, | 499 | enum GNUNET_SCHEDULER_Reason reason, |
512 | enum GNUNET_SCHEDULER_Priority priority); | 500 | enum GNUNET_SCHEDULER_Priority priority); |
513 | 501 | ||
514 | 502 | ||
515 | /** | 503 | /** |
@@ -522,9 +510,9 @@ GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback tas | |||
522 | * only valid until @a task is started! | 510 | * only valid until @a task is started! |
523 | */ | 511 | */ |
524 | struct GNUNET_SCHEDULER_Task * | 512 | struct GNUNET_SCHEDULER_Task * |
525 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | 513 | GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, |
526 | GNUNET_SCHEDULER_TaskCallback task, | 514 | GNUNET_SCHEDULER_TaskCallback task, |
527 | void *task_cls); | 515 | void *task_cls); |
528 | 516 | ||
529 | 517 | ||
530 | /** | 518 | /** |
@@ -543,8 +531,8 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | |||
543 | * only valid until @a task is started! | 531 | * only valid until @a task is started! |
544 | */ | 532 | */ |
545 | struct GNUNET_SCHEDULER_Task * | 533 | struct GNUNET_SCHEDULER_Task * |
546 | GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task, | 534 | GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, |
547 | void *task_cls); | 535 | void *task_cls); |
548 | 536 | ||
549 | 537 | ||
550 | /** | 538 | /** |
@@ -558,8 +546,8 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task, | |||
558 | * only valid until @a task is started! | 546 | * only valid until @a task is started! |
559 | */ | 547 | */ |
560 | struct GNUNET_SCHEDULER_Task * | 548 | struct GNUNET_SCHEDULER_Task * |
561 | GNUNET_SCHEDULER_add_shutdown (GNUNET_SCHEDULER_TaskCallback task, | 549 | GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, |
562 | void *task_cls); | 550 | void *task_cls); |
563 | 551 | ||
564 | 552 | ||
565 | /** | 553 | /** |
@@ -577,9 +565,9 @@ GNUNET_SCHEDULER_add_shutdown (GNUNET_SCHEDULER_TaskCallback task, | |||
577 | * only valid until @a task is started! | 565 | * only valid until @a task is started! |
578 | */ | 566 | */ |
579 | struct GNUNET_SCHEDULER_Task * | 567 | struct GNUNET_SCHEDULER_Task * |
580 | GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | 568 | GNUNET_SCHEDULER_add_now_with_lifeness(int lifeness, |
581 | GNUNET_SCHEDULER_TaskCallback task, | 569 | GNUNET_SCHEDULER_TaskCallback task, |
582 | void *task_cls); | 570 | void *task_cls); |
583 | 571 | ||
584 | 572 | ||
585 | /** | 573 | /** |
@@ -594,9 +582,9 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | |||
594 | * only valid until @a task is started! | 582 | * only valid until @a task is started! |
595 | */ | 583 | */ |
596 | struct GNUNET_SCHEDULER_Task * | 584 | struct GNUNET_SCHEDULER_Task * |
597 | GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | 585 | GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, |
598 | GNUNET_SCHEDULER_TaskCallback task, | 586 | GNUNET_SCHEDULER_TaskCallback task, |
599 | void *task_cls); | 587 | void *task_cls); |
600 | 588 | ||
601 | 589 | ||
602 | /** | 590 | /** |
@@ -611,9 +599,9 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | |||
611 | * only valid until @a task is started! | 599 | * only valid until @a task is started! |
612 | */ | 600 | */ |
613 | struct GNUNET_SCHEDULER_Task * | 601 | struct GNUNET_SCHEDULER_Task * |
614 | GNUNET_SCHEDULER_add_at (struct GNUNET_TIME_Absolute at, | 602 | GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, |
615 | GNUNET_SCHEDULER_TaskCallback task, | 603 | GNUNET_SCHEDULER_TaskCallback task, |
616 | void *task_cls); | 604 | void *task_cls); |
617 | 605 | ||
618 | 606 | ||
619 | /** | 607 | /** |
@@ -628,10 +616,10 @@ GNUNET_SCHEDULER_add_at (struct GNUNET_TIME_Absolute at, | |||
628 | * only valid until @a task is started! | 616 | * only valid until @a task is started! |
629 | */ | 617 | */ |
630 | struct GNUNET_SCHEDULER_Task * | 618 | struct GNUNET_SCHEDULER_Task * |
631 | GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, | 619 | GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, |
632 | enum GNUNET_SCHEDULER_Priority priority, | 620 | enum GNUNET_SCHEDULER_Priority priority, |
633 | GNUNET_SCHEDULER_TaskCallback task, | 621 | GNUNET_SCHEDULER_TaskCallback task, |
634 | void *task_cls); | 622 | void *task_cls); |
635 | 623 | ||
636 | 624 | ||
637 | /** | 625 | /** |
@@ -646,10 +634,10 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, | |||
646 | * only valid until @a task is started! | 634 | * only valid until @a task is started! |
647 | */ | 635 | */ |
648 | struct GNUNET_SCHEDULER_Task * | 636 | struct GNUNET_SCHEDULER_Task * |
649 | GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | 637 | GNUNET_SCHEDULER_add_at_with_priority(struct GNUNET_TIME_Absolute at, |
650 | enum GNUNET_SCHEDULER_Priority priority, | 638 | enum GNUNET_SCHEDULER_Priority priority, |
651 | GNUNET_SCHEDULER_TaskCallback task, | 639 | GNUNET_SCHEDULER_TaskCallback task, |
652 | void *task_cls); | 640 | void *task_cls); |
653 | 641 | ||
654 | 642 | ||
655 | /** | 643 | /** |
@@ -673,10 +661,10 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | |||
673 | * only valid until @a task is started! | 661 | * only valid until @a task is started! |
674 | */ | 662 | */ |
675 | struct GNUNET_SCHEDULER_Task * | 663 | struct GNUNET_SCHEDULER_Task * |
676 | GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | 664 | GNUNET_SCHEDULER_add_read_net(struct GNUNET_TIME_Relative delay, |
677 | struct GNUNET_NETWORK_Handle *rfd, | 665 | struct GNUNET_NETWORK_Handle *rfd, |
678 | GNUNET_SCHEDULER_TaskCallback task, | 666 | GNUNET_SCHEDULER_TaskCallback task, |
679 | void *task_cls); | 667 | void *task_cls); |
680 | 668 | ||
681 | 669 | ||
682 | /** | 670 | /** |
@@ -702,11 +690,11 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | |||
702 | * only valid until @a task is started! | 690 | * only valid until @a task is started! |
703 | */ | 691 | */ |
704 | struct GNUNET_SCHEDULER_Task * | 692 | struct GNUNET_SCHEDULER_Task * |
705 | GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, | 693 | GNUNET_SCHEDULER_add_read_net_with_priority(struct GNUNET_TIME_Relative delay, |
706 | enum GNUNET_SCHEDULER_Priority priority, | 694 | enum GNUNET_SCHEDULER_Priority priority, |
707 | struct GNUNET_NETWORK_Handle *rfd, | 695 | struct GNUNET_NETWORK_Handle *rfd, |
708 | GNUNET_SCHEDULER_TaskCallback task, | 696 | GNUNET_SCHEDULER_TaskCallback task, |
709 | void *task_cls); | 697 | void *task_cls); |
710 | 698 | ||
711 | 699 | ||
712 | /** | 700 | /** |
@@ -731,10 +719,10 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, | |||
731 | * only valid until @a task is started! | 719 | * only valid until @a task is started! |
732 | */ | 720 | */ |
733 | struct GNUNET_SCHEDULER_Task * | 721 | struct GNUNET_SCHEDULER_Task * |
734 | GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | 722 | GNUNET_SCHEDULER_add_write_net(struct GNUNET_TIME_Relative delay, |
735 | struct GNUNET_NETWORK_Handle *wfd, | 723 | struct GNUNET_NETWORK_Handle *wfd, |
736 | GNUNET_SCHEDULER_TaskCallback task, | 724 | GNUNET_SCHEDULER_TaskCallback task, |
737 | void *task_cls); | 725 | void *task_cls); |
738 | 726 | ||
739 | 727 | ||
740 | /** | 728 | /** |
@@ -761,13 +749,13 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | |||
761 | * only valid until "task" is started! | 749 | * only valid until "task" is started! |
762 | */ | 750 | */ |
763 | struct GNUNET_SCHEDULER_Task * | 751 | struct GNUNET_SCHEDULER_Task * |
764 | GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, | 752 | GNUNET_SCHEDULER_add_net_with_priority(struct GNUNET_TIME_Relative delay, |
765 | enum GNUNET_SCHEDULER_Priority priority, | 753 | enum GNUNET_SCHEDULER_Priority priority, |
766 | struct GNUNET_NETWORK_Handle *fd, | 754 | struct GNUNET_NETWORK_Handle *fd, |
767 | int on_read, | 755 | int on_read, |
768 | int on_write, | 756 | int on_write, |
769 | GNUNET_SCHEDULER_TaskCallback task, | 757 | GNUNET_SCHEDULER_TaskCallback task, |
770 | void *task_cls); | 758 | void *task_cls); |
771 | 759 | ||
772 | 760 | ||
773 | /** | 761 | /** |
@@ -791,10 +779,10 @@ GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, | |||
791 | * only valid until @a task is started! | 779 | * only valid until @a task is started! |
792 | */ | 780 | */ |
793 | struct GNUNET_SCHEDULER_Task * | 781 | struct GNUNET_SCHEDULER_Task * |
794 | GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | 782 | GNUNET_SCHEDULER_add_read_file(struct GNUNET_TIME_Relative delay, |
795 | const struct GNUNET_DISK_FileHandle *rfd, | 783 | const struct GNUNET_DISK_FileHandle *rfd, |
796 | GNUNET_SCHEDULER_TaskCallback task, | 784 | GNUNET_SCHEDULER_TaskCallback task, |
797 | void *task_cls); | 785 | void *task_cls); |
798 | 786 | ||
799 | 787 | ||
800 | /** | 788 | /** |
@@ -818,10 +806,10 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | |||
818 | * only valid until @a task is started! | 806 | * only valid until @a task is started! |
819 | */ | 807 | */ |
820 | struct GNUNET_SCHEDULER_Task * | 808 | struct GNUNET_SCHEDULER_Task * |
821 | GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | 809 | GNUNET_SCHEDULER_add_write_file(struct GNUNET_TIME_Relative delay, |
822 | const struct GNUNET_DISK_FileHandle *wfd, | 810 | const struct GNUNET_DISK_FileHandle *wfd, |
823 | GNUNET_SCHEDULER_TaskCallback task, | 811 | GNUNET_SCHEDULER_TaskCallback task, |
824 | void *task_cls); | 812 | void *task_cls); |
825 | 813 | ||
826 | 814 | ||
827 | /** | 815 | /** |
@@ -848,12 +836,12 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | |||
848 | * only valid until @a task is started! | 836 | * only valid until @a task is started! |
849 | */ | 837 | */ |
850 | struct GNUNET_SCHEDULER_Task * | 838 | struct GNUNET_SCHEDULER_Task * |
851 | GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, | 839 | GNUNET_SCHEDULER_add_file_with_priority(struct GNUNET_TIME_Relative delay, |
852 | enum GNUNET_SCHEDULER_Priority priority, | 840 | enum GNUNET_SCHEDULER_Priority priority, |
853 | const struct GNUNET_DISK_FileHandle *fd, | 841 | const struct GNUNET_DISK_FileHandle *fd, |
854 | int on_read, int on_write, | 842 | int on_read, int on_write, |
855 | GNUNET_SCHEDULER_TaskCallback task, | 843 | GNUNET_SCHEDULER_TaskCallback task, |
856 | void *task_cls); | 844 | void *task_cls); |
857 | 845 | ||
858 | 846 | ||
859 | /** | 847 | /** |
@@ -888,12 +876,12 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, | |||
888 | * only valid until @a task is started! | 876 | * only valid until @a task is started! |
889 | */ | 877 | */ |
890 | struct GNUNET_SCHEDULER_Task * | 878 | struct GNUNET_SCHEDULER_Task * |
891 | GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | 879 | GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, |
892 | struct GNUNET_TIME_Relative delay, | 880 | struct GNUNET_TIME_Relative delay, |
893 | const struct GNUNET_NETWORK_FDSet *rs, | 881 | const struct GNUNET_NETWORK_FDSet *rs, |
894 | const struct GNUNET_NETWORK_FDSet *ws, | 882 | const struct GNUNET_NETWORK_FDSet *ws, |
895 | GNUNET_SCHEDULER_TaskCallback task, | 883 | GNUNET_SCHEDULER_TaskCallback task, |
896 | void *task_cls); | 884 | void *task_cls); |
897 | 885 | ||
898 | /** | 886 | /** |
899 | * Sets the select function to use in the scheduler (scheduler_select). | 887 | * Sets the select function to use in the scheduler (scheduler_select). |
@@ -902,8 +890,8 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
902 | * @param new_select_cls closure for @a new_select | 890 | * @param new_select_cls closure for @a new_select |
903 | */ | 891 | */ |
904 | void | 892 | void |
905 | GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | 893 | GNUNET_SCHEDULER_set_select(GNUNET_SCHEDULER_select new_select, |
906 | void *new_select_cls); | 894 | void *new_select_cls); |
907 | 895 | ||
908 | 896 | ||
909 | 897 | ||
@@ -920,7 +908,7 @@ GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | |||
920 | * @param aid the asynchronous scope id to enter | 908 | * @param aid the asynchronous scope id to enter |
921 | */ | 909 | */ |
922 | void | 910 | void |
923 | GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid); | 911 | GNUNET_SCHEDULER_begin_async_scope(struct GNUNET_AsyncScopeId *aid); |
924 | 912 | ||
925 | 913 | ||
926 | 914 | ||
diff --git a/src/include/gnunet_secretsharing_service.h b/src/include/gnunet_secretsharing_service.h index 69cfa4514..40c98b857 100644 --- a/src/include/gnunet_secretsharing_service.h +++ b/src/include/gnunet_secretsharing_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -60,39 +60,39 @@ extern "C" | |||
60 | * The q-parameter for ElGamal encryption, a 1024-bit safe prime. | 60 | * The q-parameter for ElGamal encryption, a 1024-bit safe prime. |
61 | */ | 61 | */ |
62 | #define GNUNET_SECRETSHARING_ELGAMAL_P_HEX \ | 62 | #define GNUNET_SECRETSHARING_ELGAMAL_P_HEX \ |
63 | "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca" \ | 63 | "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca" \ |
64 | "6f4269a0814e158a34312964d946b3ef22882317" \ | 64 | "6f4269a0814e158a34312964d946b3ef22882317" \ |
65 | "2bcf30fc08f772774cb404f9bc002a6f66b09a79" \ | 65 | "2bcf30fc08f772774cb404f9bc002a6f66b09a79" \ |
66 | "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71" \ | 66 | "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71" \ |
67 | "6c7d2b002da880e269438d5a776e6b5f253c8df5" \ | 67 | "6c7d2b002da880e269438d5a776e6b5f253c8df5" \ |
68 | "6a16b1c7ce58def07c03db48238aadfc52a354a2" \ | 68 | "6a16b1c7ce58def07c03db48238aadfc52a354a2" \ |
69 | "7ed285b0c1675cad3f3" | 69 | "7ed285b0c1675cad3f3" |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * The q-parameter for ElGamal encryption, | 72 | * The q-parameter for ElGamal encryption, |
73 | * a 1023-bit Sophie Germain prime, q = (p-1)/2 | 73 | * a 1023-bit Sophie Germain prime, q = (p-1)/2 |
74 | */ | 74 | */ |
75 | #define GNUNET_SECRETSHARING_ELGAMAL_Q_HEX \ | 75 | #define GNUNET_SECRETSHARING_ELGAMAL_Q_HEX \ |
76 | "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65" \ | 76 | "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65" \ |
77 | "37a134d040a70ac51a1894b26ca359f79144118b" \ | 77 | "37a134d040a70ac51a1894b26ca359f79144118b" \ |
78 | "95e7987e047bb93ba65a027cde001537b3584d3c" \ | 78 | "95e7987e047bb93ba65a027cde001537b3584d3c" \ |
79 | "ec086b3e27c659df6e303071e477c3a58db26fb8" \ | 79 | "ec086b3e27c659df6e303071e477c3a58db26fb8" \ |
80 | "b63e958016d4407134a1c6ad3bb735af929e46fa" \ | 80 | "b63e958016d4407134a1c6ad3bb735af929e46fa" \ |
81 | "b50b58e3e72c6f783e01eda411c556fe2951aa51" \ | 81 | "b50b58e3e72c6f783e01eda411c556fe2951aa51" \ |
82 | "3f6942d860b3ae569f9" | 82 | "3f6942d860b3ae569f9" |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * The g-parameter for ElGamal encryption, | 85 | * The g-parameter for ElGamal encryption, |
86 | * a generator of the unique size q subgroup of Z_p^* | 86 | * a generator of the unique size q subgroup of Z_p^* |
87 | */ | 87 | */ |
88 | #define GNUNET_SECRETSHARING_ELGAMAL_G_HEX \ | 88 | #define GNUNET_SECRETSHARING_ELGAMAL_G_HEX \ |
89 | "0x05c00c36d2e822950087ef09d8252994adc4e4" \ | 89 | "0x05c00c36d2e822950087ef09d8252994adc4e4" \ |
90 | "8fe3ec70269f035b46063aff0c99b633fd64df43" \ | 90 | "8fe3ec70269f035b46063aff0c99b633fd64df43" \ |
91 | "02442e1914c829a41505a275438871f365e91c12" \ | 91 | "02442e1914c829a41505a275438871f365e91c12" \ |
92 | "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634" \ | 92 | "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634" \ |
93 | "9cfd9f953674fab5d511e1c078fc72d72b34086f" \ | 93 | "9cfd9f953674fab5d511e1c078fc72d72b34086f" \ |
94 | "c82b4b951989eb85325cb203ff98df76bc366bba" \ | 94 | "c82b4b951989eb85325cb203ff98df76bc366bba" \ |
95 | "1d7024c3650f60d0da" | 95 | "1d7024c3650f60d0da" |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
@@ -119,19 +119,17 @@ struct GNUNET_SECRETSHARING_DecryptionHandle; | |||
119 | /** | 119 | /** |
120 | * Public key of a group sharing a secret. | 120 | * Public key of a group sharing a secret. |
121 | */ | 121 | */ |
122 | struct GNUNET_SECRETSHARING_PublicKey | 122 | struct GNUNET_SECRETSHARING_PublicKey { |
123 | { | 123 | uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; |
124 | uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)]; | ||
125 | }; | 124 | }; |
126 | 125 | ||
127 | 126 | ||
128 | /** | 127 | /** |
129 | * Encrypted field element. | 128 | * Encrypted field element. |
130 | */ | 129 | */ |
131 | struct GNUNET_SECRETSHARING_Ciphertext | 130 | struct GNUNET_SECRETSHARING_Ciphertext { |
132 | { | 131 | uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; |
133 | uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)]; | 132 | uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; |
134 | uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)]; | ||
135 | }; | 133 | }; |
136 | 134 | ||
137 | 135 | ||
@@ -141,12 +139,11 @@ struct GNUNET_SECRETSHARING_Ciphertext | |||
141 | * Note that we are not operating in GF(2^n), thus not every | 139 | * Note that we are not operating in GF(2^n), thus not every |
142 | * bit pattern is a valid plain text. | 140 | * bit pattern is a valid plain text. |
143 | */ | 141 | */ |
144 | struct GNUNET_SECRETSHARING_Plaintext | 142 | struct GNUNET_SECRETSHARING_Plaintext { |
145 | { | ||
146 | /** | 143 | /** |
147 | * Value of the message. | 144 | * Value of the message. |
148 | */ | 145 | */ |
149 | uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)]; | 146 | uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; |
150 | }; | 147 | }; |
151 | 148 | ||
152 | 149 | ||
@@ -205,15 +202,15 @@ typedef void | |||
205 | * @param cls closure for @a cb | 202 | * @param cls closure for @a cb |
206 | */ | 203 | */ |
207 | struct GNUNET_SECRETSHARING_Session * | 204 | struct GNUNET_SECRETSHARING_Session * |
208 | GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *cfg, | 205 | GNUNET_SECRETSHARING_create_session(const struct GNUNET_CONFIGURATION_Handle *cfg, |
209 | unsigned int num_peers, | 206 | unsigned int num_peers, |
210 | const struct GNUNET_PeerIdentity *peers, | 207 | const struct GNUNET_PeerIdentity *peers, |
211 | const struct GNUNET_HashCode *session_id, | 208 | const struct GNUNET_HashCode *session_id, |
212 | struct GNUNET_TIME_Absolute start, | 209 | struct GNUNET_TIME_Absolute start, |
213 | struct GNUNET_TIME_Absolute deadline, | 210 | struct GNUNET_TIME_Absolute deadline, |
214 | unsigned int threshold, | 211 | unsigned int threshold, |
215 | GNUNET_SECRETSHARING_SecretReadyCallback cb, | 212 | GNUNET_SECRETSHARING_SecretReadyCallback cb, |
216 | void *cls); | 213 | void *cls); |
217 | 214 | ||
218 | 215 | ||
219 | /** | 216 | /** |
@@ -223,7 +220,7 @@ GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *c | |||
223 | * @param s session to destroy | 220 | * @param s session to destroy |
224 | */ | 221 | */ |
225 | void | 222 | void |
226 | GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s); | 223 | GNUNET_SECRETSHARING_session_destroy(struct GNUNET_SECRETSHARING_Session *s); |
227 | 224 | ||
228 | 225 | ||
229 | /** | 226 | /** |
@@ -240,9 +237,9 @@ GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s); | |||
240 | * @return #GNUNET_YES on succes, #GNUNET_SYSERR if the message is invalid (invalid range) | 237 | * @return #GNUNET_YES on succes, #GNUNET_SYSERR if the message is invalid (invalid range) |
241 | */ | 238 | */ |
242 | int | 239 | int |
243 | GNUNET_SECRETSHARING_encrypt (const struct GNUNET_SECRETSHARING_PublicKey *public_key, | 240 | GNUNET_SECRETSHARING_encrypt(const struct GNUNET_SECRETSHARING_PublicKey *public_key, |
244 | const struct GNUNET_SECRETSHARING_Plaintext *plaintext, | 241 | const struct GNUNET_SECRETSHARING_Plaintext *plaintext, |
245 | struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext); | 242 | struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext); |
246 | 243 | ||
247 | 244 | ||
248 | /** | 245 | /** |
@@ -262,13 +259,13 @@ GNUNET_SECRETSHARING_encrypt (const struct GNUNET_SECRETSHARING_PublicKey *publi | |||
262 | * @return handle to cancel the operation | 259 | * @return handle to cancel the operation |
263 | */ | 260 | */ |
264 | struct GNUNET_SECRETSHARING_DecryptionHandle * | 261 | struct GNUNET_SECRETSHARING_DecryptionHandle * |
265 | GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg, | 262 | GNUNET_SECRETSHARING_decrypt(const struct GNUNET_CONFIGURATION_Handle *cfg, |
266 | struct GNUNET_SECRETSHARING_Share *share, | 263 | struct GNUNET_SECRETSHARING_Share *share, |
267 | const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext, | 264 | const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext, |
268 | struct GNUNET_TIME_Absolute start, | 265 | struct GNUNET_TIME_Absolute start, |
269 | struct GNUNET_TIME_Absolute deadline, | 266 | struct GNUNET_TIME_Absolute deadline, |
270 | GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, | 267 | GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, |
271 | void *decrypt_cb_cls); | 268 | void *decrypt_cb_cls); |
272 | 269 | ||
273 | 270 | ||
274 | /** | 271 | /** |
@@ -280,7 +277,7 @@ GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
280 | * @param dh to cancel | 277 | * @param dh to cancel |
281 | */ | 278 | */ |
282 | void | 279 | void |
283 | GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandle *dh); | 280 | GNUNET_SECRETSHARING_decrypt_cancel(struct GNUNET_SECRETSHARING_DecryptionHandle *dh); |
284 | 281 | ||
285 | 282 | ||
286 | /** | 283 | /** |
@@ -293,7 +290,7 @@ GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandl | |||
293 | * @return The share, or NULL on error. | 290 | * @return The share, or NULL on error. |
294 | */ | 291 | */ |
295 | struct GNUNET_SECRETSHARING_Share * | 292 | struct GNUNET_SECRETSHARING_Share * |
296 | GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen); | 293 | GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen); |
297 | 294 | ||
298 | 295 | ||
299 | /** | 296 | /** |
@@ -308,21 +305,21 @@ GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen); | |||
308 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure. | 305 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure. |
309 | */ | 306 | */ |
310 | int | 307 | int |
311 | GNUNET_SECRETSHARING_share_write (const struct GNUNET_SECRETSHARING_Share *share, | 308 | GNUNET_SECRETSHARING_share_write(const struct GNUNET_SECRETSHARING_Share *share, |
312 | void *buf, size_t buflen, size_t *writelen); | 309 | void *buf, size_t buflen, size_t *writelen); |
313 | 310 | ||
314 | 311 | ||
315 | void | 312 | void |
316 | GNUNET_SECRETSHARING_share_destroy (struct GNUNET_SECRETSHARING_Share *share); | 313 | GNUNET_SECRETSHARING_share_destroy(struct GNUNET_SECRETSHARING_Share *share); |
317 | 314 | ||
318 | 315 | ||
319 | int | 316 | int |
320 | GNUNET_SECRETSHARING_plaintext_generate (struct GNUNET_SECRETSHARING_Plaintext *plaintext, | 317 | GNUNET_SECRETSHARING_plaintext_generate(struct GNUNET_SECRETSHARING_Plaintext *plaintext, |
321 | gcry_mpi_t exponent); | 318 | gcry_mpi_t exponent); |
322 | 319 | ||
323 | int | 320 | int |
324 | GNUNET_SECRETSHARING_plaintext_generate_i (struct GNUNET_SECRETSHARING_Plaintext *plaintext, | 321 | GNUNET_SECRETSHARING_plaintext_generate_i(struct GNUNET_SECRETSHARING_Plaintext *plaintext, |
325 | int64_t exponent); | 322 | int64_t exponent); |
326 | 323 | ||
327 | 324 | ||
328 | #if 0 /* keep Emacsens' auto-indent happy */ | 325 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index fce912277..9cdf4d459 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -50,8 +50,7 @@ extern "C" | |||
50 | /** | 50 | /** |
51 | * Options for the service (bitmask). | 51 | * Options for the service (bitmask). |
52 | */ | 52 | */ |
53 | enum GNUNET_SERVICE_Options | 53 | enum GNUNET_SERVICE_Options { |
54 | { | ||
55 | /** | 54 | /** |
56 | * Use defaults. Terminates all client connections and the listen | 55 | * Use defaults. Terminates all client connections and the listen |
57 | * sockets immediately upon receiving the shutdown signal. | 56 | * sockets immediately upon receiving the shutdown signal. |
@@ -165,12 +164,12 @@ typedef void | |||
165 | * @return NULL on error | 164 | * @return NULL on error |
166 | */ | 165 | */ |
167 | struct GNUNET_SERVICE_Handle * | 166 | struct GNUNET_SERVICE_Handle * |
168 | GNUNET_SERVICE_start (const char *service_name, | 167 | GNUNET_SERVICE_start(const char *service_name, |
169 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 168 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
170 | GNUNET_SERVICE_ConnectHandler connect_cb, | 169 | GNUNET_SERVICE_ConnectHandler connect_cb, |
171 | GNUNET_SERVICE_DisconnectHandler disconnect_cb, | 170 | GNUNET_SERVICE_DisconnectHandler disconnect_cb, |
172 | void *cls, | 171 | void *cls, |
173 | const struct GNUNET_MQ_MessageHandler *handlers); | 172 | const struct GNUNET_MQ_MessageHandler *handlers); |
174 | 173 | ||
175 | 174 | ||
176 | /** | 175 | /** |
@@ -179,7 +178,7 @@ GNUNET_SERVICE_start (const char *service_name, | |||
179 | * @param srv service to stop | 178 | * @param srv service to stop |
180 | */ | 179 | */ |
181 | void | 180 | void |
182 | GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv); | 181 | GNUNET_SERVICE_stop(struct GNUNET_SERVICE_Handle *srv); |
183 | 182 | ||
184 | 183 | ||
185 | /** | 184 | /** |
@@ -224,15 +223,15 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv); | |||
224 | * @return 0 on success, non-zero on error | 223 | * @return 0 on success, non-zero on error |
225 | */ | 224 | */ |
226 | int | 225 | int |
227 | GNUNET_SERVICE_run_ (int argc, | 226 | GNUNET_SERVICE_run_(int argc, |
228 | char *const *argv, | 227 | char *const *argv, |
229 | const char *service_name, | 228 | const char *service_name, |
230 | enum GNUNET_SERVICE_Options options, | 229 | enum GNUNET_SERVICE_Options options, |
231 | GNUNET_SERVICE_InitCallback service_init_cb, | 230 | GNUNET_SERVICE_InitCallback service_init_cb, |
232 | GNUNET_SERVICE_ConnectHandler connect_cb, | 231 | GNUNET_SERVICE_ConnectHandler connect_cb, |
233 | GNUNET_SERVICE_DisconnectHandler disconnect_cb, | 232 | GNUNET_SERVICE_DisconnectHandler disconnect_cb, |
234 | void *cls, | 233 | void *cls, |
235 | const struct GNUNET_MQ_MessageHandler *handlers); | 234 | const struct GNUNET_MQ_MessageHandler *handlers); |
236 | 235 | ||
237 | 236 | ||
238 | /** | 237 | /** |
@@ -286,29 +285,29 @@ GNUNET_SERVICE_run_ (int argc, | |||
286 | * &disconnect_cb, | 285 | * &disconnect_cb, |
287 | * closure_for_cb, | 286 | * closure_for_cb, |
288 | * GNUNET_MQ_hd_var_size (get, | 287 | * GNUNET_MQ_hd_var_size (get, |
289 | * GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, | 288 | * GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, |
290 | * struct GNUNET_RESOLVER_GetMessage, | 289 | * struct GNUNET_RESOLVER_GetMessage, |
291 | * NULL), | 290 | * NULL), |
292 | * GNUNET_MQ_handler_end ()); | 291 | * GNUNET_MQ_handler_end ()); |
293 | * </code> | 292 | * </code> |
294 | */ | 293 | */ |
295 | #define GNUNET_SERVICE_MAIN(service_name,service_options,init_cb,connect_cb,disconnect_cb,cls,...) \ | 294 | #define GNUNET_SERVICE_MAIN(service_name, service_options, init_cb, connect_cb, disconnect_cb, cls, ...) \ |
296 | int \ | 295 | int \ |
297 | main (int argc,\ | 296 | main(int argc, \ |
298 | char *const *argv)\ | 297 | char *const *argv) \ |
299 | { \ | 298 | { \ |
300 | struct GNUNET_MQ_MessageHandler mh[] = { \ | 299 | struct GNUNET_MQ_MessageHandler mh[] = { \ |
301 | __VA_ARGS__ \ | 300 | __VA_ARGS__ \ |
302 | }; \ | 301 | }; \ |
303 | return GNUNET_SERVICE_run_ (argc, \ | 302 | return GNUNET_SERVICE_run_(argc, \ |
304 | argv, \ | 303 | argv, \ |
305 | service_name, \ | 304 | service_name, \ |
306 | service_options, \ | 305 | service_options, \ |
307 | init_cb, \ | 306 | init_cb, \ |
308 | connect_cb, \ | 307 | connect_cb, \ |
309 | disconnect_cb, \ | 308 | disconnect_cb, \ |
310 | cls, \ | 309 | cls, \ |
311 | mh); \ | 310 | mh); \ |
312 | } | 311 | } |
313 | 312 | ||
314 | 313 | ||
@@ -319,7 +318,7 @@ GNUNET_SERVICE_run_ (int argc, | |||
319 | * @param sh service to stop accepting connections. | 318 | * @param sh service to stop accepting connections. |
320 | */ | 319 | */ |
321 | void | 320 | void |
322 | GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh); | 321 | GNUNET_SERVICE_suspend(struct GNUNET_SERVICE_Handle *sh); |
323 | 322 | ||
324 | 323 | ||
325 | /** | 324 | /** |
@@ -328,7 +327,7 @@ GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh); | |||
328 | * @param sh service to resume accepting connections. | 327 | * @param sh service to resume accepting connections. |
329 | */ | 328 | */ |
330 | void | 329 | void |
331 | GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh); | 330 | GNUNET_SERVICE_resume(struct GNUNET_SERVICE_Handle *sh); |
332 | 331 | ||
333 | 332 | ||
334 | /** | 333 | /** |
@@ -338,7 +337,7 @@ GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh); | |||
338 | * @param c the client to continue receiving from | 337 | * @param c the client to continue receiving from |
339 | */ | 338 | */ |
340 | void | 339 | void |
341 | GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c); | 340 | GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c); |
342 | 341 | ||
343 | 342 | ||
344 | /** | 343 | /** |
@@ -348,7 +347,7 @@ GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c); | |||
348 | * @return the message queue of @a c | 347 | * @return the message queue of @a c |
349 | */ | 348 | */ |
350 | struct GNUNET_MQ_Handle * | 349 | struct GNUNET_MQ_Handle * |
351 | GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c); | 350 | GNUNET_SERVICE_client_get_mq(struct GNUNET_SERVICE_Client *c); |
352 | 351 | ||
353 | 352 | ||
354 | /** | 353 | /** |
@@ -360,7 +359,7 @@ GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c); | |||
360 | * @param c client for which to disable the warning | 359 | * @param c client for which to disable the warning |
361 | */ | 360 | */ |
362 | void | 361 | void |
363 | GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c); | 362 | GNUNET_SERVICE_client_disable_continue_warning(struct GNUNET_SERVICE_Client *c); |
364 | 363 | ||
365 | 364 | ||
366 | /** | 365 | /** |
@@ -379,7 +378,7 @@ GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c) | |||
379 | * @param c client to disconnect now | 378 | * @param c client to disconnect now |
380 | */ | 379 | */ |
381 | void | 380 | void |
382 | GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c); | 381 | GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c); |
383 | 382 | ||
384 | 383 | ||
385 | /** | 384 | /** |
@@ -388,7 +387,7 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c); | |||
388 | * @param sh server to shutdown | 387 | * @param sh server to shutdown |
389 | */ | 388 | */ |
390 | void | 389 | void |
391 | GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh); | 390 | GNUNET_SERVICE_shutdown(struct GNUNET_SERVICE_Handle *sh); |
392 | 391 | ||
393 | 392 | ||
394 | /** | 393 | /** |
@@ -404,7 +403,7 @@ GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh); | |||
404 | * @param c client to mark as a monitor | 403 | * @param c client to mark as a monitor |
405 | */ | 404 | */ |
406 | void | 405 | void |
407 | GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c); | 406 | GNUNET_SERVICE_client_mark_monitor(struct GNUNET_SERVICE_Client *c); |
408 | 407 | ||
409 | 408 | ||
410 | /** | 409 | /** |
@@ -415,7 +414,7 @@ GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c); | |||
415 | * @param c client to persist the socket (never to be closed) | 414 | * @param c client to persist the socket (never to be closed) |
416 | */ | 415 | */ |
417 | void | 416 | void |
418 | GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c); | 417 | GNUNET_SERVICE_client_persist(struct GNUNET_SERVICE_Client *c); |
419 | 418 | ||
420 | 419 | ||
421 | #if 0 /* keep Emacsens' auto-indent happy */ | 420 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index ac54153e1..4016fc362 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -52,7 +52,7 @@ extern "C" | |||
52 | /** | 52 | /** |
53 | * Maximum size of a context message for set operation requests. | 53 | * Maximum size of a context message for set operation requests. |
54 | */ | 54 | */ |
55 | #define GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE ((1<<16) - 1024) | 55 | #define GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE ((1 << 16) - 1024) |
56 | 56 | ||
57 | 57 | ||
58 | /** | 58 | /** |
@@ -79,8 +79,7 @@ struct GNUNET_SET_OperationHandle; | |||
79 | /** | 79 | /** |
80 | * The operation that a set set supports. | 80 | * The operation that a set set supports. |
81 | */ | 81 | */ |
82 | enum GNUNET_SET_OperationType | 82 | enum GNUNET_SET_OperationType { |
83 | { | ||
84 | /** | 83 | /** |
85 | * A purely local set that does not support any operation. | 84 | * A purely local set that does not support any operation. |
86 | */ | 85 | */ |
@@ -101,8 +100,7 @@ enum GNUNET_SET_OperationType | |||
101 | /** | 100 | /** |
102 | * Status for the result callback | 101 | * Status for the result callback |
103 | */ | 102 | */ |
104 | enum GNUNET_SET_Status | 103 | enum GNUNET_SET_Status { |
105 | { | ||
106 | /** | 104 | /** |
107 | * Everything went ok, we are transmitting an element of the | 105 | * Everything went ok, we are transmitting an element of the |
108 | * result (in set, or to be removed from set, depending on | 106 | * result (in set, or to be removed from set, depending on |
@@ -157,8 +155,7 @@ enum GNUNET_SET_Status | |||
157 | /** | 155 | /** |
158 | * The way results are given to the client. | 156 | * The way results are given to the client. |
159 | */ | 157 | */ |
160 | enum GNUNET_SET_ResultMode | 158 | enum GNUNET_SET_ResultMode { |
161 | { | ||
162 | /** | 159 | /** |
163 | * Client gets every element in the resulting set. | 160 | * Client gets every element in the resulting set. |
164 | * | 161 | * |
@@ -193,8 +190,7 @@ enum GNUNET_SET_ResultMode | |||
193 | /** | 190 | /** |
194 | * Element stored in a set. | 191 | * Element stored in a set. |
195 | */ | 192 | */ |
196 | struct GNUNET_SET_Element | 193 | struct GNUNET_SET_Element { |
197 | { | ||
198 | /** | 194 | /** |
199 | * Number of bytes in the buffer pointed to by data. | 195 | * Number of bytes in the buffer pointed to by data. |
200 | */ | 196 | */ |
@@ -217,8 +213,7 @@ struct GNUNET_SET_Element | |||
217 | * | 213 | * |
218 | * Used as tag for struct #GNUNET_SET_Option. | 214 | * Used as tag for struct #GNUNET_SET_Option. |
219 | */ | 215 | */ |
220 | enum GNUNET_SET_OptionType | 216 | enum GNUNET_SET_OptionType { |
221 | { | ||
222 | /** | 217 | /** |
223 | * List terminator. | 218 | * List terminator. |
224 | */ | 219 | */ |
@@ -248,8 +243,7 @@ enum GNUNET_SET_OptionType | |||
248 | /** | 243 | /** |
249 | * Option for set operations. | 244 | * Option for set operations. |
250 | */ | 245 | */ |
251 | struct GNUNET_SET_Option | 246 | struct GNUNET_SET_Option { |
252 | { | ||
253 | /** | 247 | /** |
254 | * Type of the option. | 248 | * Type of the option. |
255 | */ | 249 | */ |
@@ -341,8 +335,8 @@ typedef void | |||
341 | * @return a handle to the set | 335 | * @return a handle to the set |
342 | */ | 336 | */ |
343 | struct GNUNET_SET_Handle * | 337 | struct GNUNET_SET_Handle * |
344 | GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 338 | GNUNET_SET_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
345 | enum GNUNET_SET_OperationType op); | 339 | enum GNUNET_SET_OperationType op); |
346 | 340 | ||
347 | 341 | ||
348 | /** | 342 | /** |
@@ -359,10 +353,10 @@ GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
359 | * set is invalid (e.g. the set service crashed) | 353 | * set is invalid (e.g. the set service crashed) |
360 | */ | 354 | */ |
361 | int | 355 | int |
362 | GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, | 356 | GNUNET_SET_add_element(struct GNUNET_SET_Handle *set, |
363 | const struct GNUNET_SET_Element *element, | 357 | const struct GNUNET_SET_Element *element, |
364 | GNUNET_SET_Continuation cont, | 358 | GNUNET_SET_Continuation cont, |
365 | void *cont_cls); | 359 | void *cont_cls); |
366 | 360 | ||
367 | 361 | ||
368 | /** | 362 | /** |
@@ -379,16 +373,16 @@ GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, | |||
379 | * set is invalid (e.g. the set service crashed) | 373 | * set is invalid (e.g. the set service crashed) |
380 | */ | 374 | */ |
381 | int | 375 | int |
382 | GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set, | 376 | GNUNET_SET_remove_element(struct GNUNET_SET_Handle *set, |
383 | const struct GNUNET_SET_Element *element, | 377 | const struct GNUNET_SET_Element *element, |
384 | GNUNET_SET_Continuation cont, | 378 | GNUNET_SET_Continuation cont, |
385 | void *cont_cls); | 379 | void *cont_cls); |
386 | 380 | ||
387 | 381 | ||
388 | void | 382 | void |
389 | GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, | 383 | GNUNET_SET_copy_lazy(struct GNUNET_SET_Handle *set, |
390 | GNUNET_SET_CopyReadyCallback cb, | 384 | GNUNET_SET_CopyReadyCallback cb, |
391 | void *cls); | 385 | void *cls); |
392 | 386 | ||
393 | 387 | ||
394 | /** | 388 | /** |
@@ -400,7 +394,7 @@ GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, | |||
400 | * @param set set to destroy | 394 | * @param set set to destroy |
401 | */ | 395 | */ |
402 | void | 396 | void |
403 | GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); | 397 | GNUNET_SET_destroy(struct GNUNET_SET_Handle *set); |
404 | 398 | ||
405 | 399 | ||
406 | /** | 400 | /** |
@@ -418,13 +412,13 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); | |||
418 | * @return a handle to cancel the operation | 412 | * @return a handle to cancel the operation |
419 | */ | 413 | */ |
420 | struct GNUNET_SET_OperationHandle * | 414 | struct GNUNET_SET_OperationHandle * |
421 | GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, | 415 | GNUNET_SET_prepare(const struct GNUNET_PeerIdentity *other_peer, |
422 | const struct GNUNET_HashCode *app_id, | 416 | const struct GNUNET_HashCode *app_id, |
423 | const struct GNUNET_MessageHeader *context_msg, | 417 | const struct GNUNET_MessageHeader *context_msg, |
424 | enum GNUNET_SET_ResultMode result_mode, | 418 | enum GNUNET_SET_ResultMode result_mode, |
425 | struct GNUNET_SET_Option options[], | 419 | struct GNUNET_SET_Option options[], |
426 | GNUNET_SET_ResultIterator result_cb, | 420 | GNUNET_SET_ResultIterator result_cb, |
427 | void *result_cls); | 421 | void *result_cls); |
428 | 422 | ||
429 | 423 | ||
430 | /** | 424 | /** |
@@ -442,11 +436,11 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, | |||
442 | * @return a handle that can be used to cancel the listen operation | 436 | * @return a handle that can be used to cancel the listen operation |
443 | */ | 437 | */ |
444 | struct GNUNET_SET_ListenHandle * | 438 | struct GNUNET_SET_ListenHandle * |
445 | GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | 439 | GNUNET_SET_listen(const struct GNUNET_CONFIGURATION_Handle *cfg, |
446 | enum GNUNET_SET_OperationType op_type, | 440 | enum GNUNET_SET_OperationType op_type, |
447 | const struct GNUNET_HashCode *app_id, | 441 | const struct GNUNET_HashCode *app_id, |
448 | GNUNET_SET_ListenCallback listen_cb, | 442 | GNUNET_SET_ListenCallback listen_cb, |
449 | void *listen_cls); | 443 | void *listen_cls); |
450 | 444 | ||
451 | 445 | ||
452 | /** | 446 | /** |
@@ -458,7 +452,7 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
458 | * @param lh handle for the listen operation | 452 | * @param lh handle for the listen operation |
459 | */ | 453 | */ |
460 | void | 454 | void |
461 | GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh); | 455 | GNUNET_SET_listen_cancel(struct GNUNET_SET_ListenHandle *lh); |
462 | 456 | ||
463 | 457 | ||
464 | /** | 458 | /** |
@@ -476,11 +470,11 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh); | |||
476 | * @return a handle to cancel the operation | 470 | * @return a handle to cancel the operation |
477 | */ | 471 | */ |
478 | struct GNUNET_SET_OperationHandle * | 472 | struct GNUNET_SET_OperationHandle * |
479 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, | 473 | GNUNET_SET_accept(struct GNUNET_SET_Request *request, |
480 | enum GNUNET_SET_ResultMode result_mode, | 474 | enum GNUNET_SET_ResultMode result_mode, |
481 | struct GNUNET_SET_Option options[], | 475 | struct GNUNET_SET_Option options[], |
482 | GNUNET_SET_ResultIterator result_cb, | 476 | GNUNET_SET_ResultIterator result_cb, |
483 | void *result_cls); | 477 | void *result_cls); |
484 | 478 | ||
485 | 479 | ||
486 | /** | 480 | /** |
@@ -497,8 +491,8 @@ GNUNET_SET_accept (struct GNUNET_SET_Request *request, | |||
497 | * set is invalid (e.g. the set service crashed) | 491 | * set is invalid (e.g. the set service crashed) |
498 | */ | 492 | */ |
499 | int | 493 | int |
500 | GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, | 494 | GNUNET_SET_commit(struct GNUNET_SET_OperationHandle *oh, |
501 | struct GNUNET_SET_Handle *set); | 495 | struct GNUNET_SET_Handle *set); |
502 | 496 | ||
503 | 497 | ||
504 | /** | 498 | /** |
@@ -509,7 +503,7 @@ GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, | |||
509 | * @param oh set operation to cancel | 503 | * @param oh set operation to cancel |
510 | */ | 504 | */ |
511 | void | 505 | void |
512 | GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh); | 506 | GNUNET_SET_operation_cancel(struct GNUNET_SET_OperationHandle *oh); |
513 | 507 | ||
514 | 508 | ||
515 | /** | 509 | /** |
@@ -526,9 +520,9 @@ GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh); | |||
526 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) | 520 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) |
527 | */ | 521 | */ |
528 | int | 522 | int |
529 | GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, | 523 | GNUNET_SET_iterate(struct GNUNET_SET_Handle *set, |
530 | GNUNET_SET_ElementIterator iter, | 524 | GNUNET_SET_ElementIterator iter, |
531 | void *iter_cls); | 525 | void *iter_cls); |
532 | 526 | ||
533 | 527 | ||
534 | /** | 528 | /** |
@@ -539,7 +533,7 @@ GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, | |||
539 | * @param set the set to stop iterating over | 533 | * @param set the set to stop iterating over |
540 | */ | 534 | */ |
541 | void | 535 | void |
542 | GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); | 536 | GNUNET_SET_iterate_cancel(struct GNUNET_SET_Handle *set); |
543 | 537 | ||
544 | 538 | ||
545 | /** | 539 | /** |
@@ -550,7 +544,7 @@ GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); | |||
550 | * @return the copied element | 544 | * @return the copied element |
551 | */ | 545 | */ |
552 | struct GNUNET_SET_Element * | 546 | struct GNUNET_SET_Element * |
553 | GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element); | 547 | GNUNET_SET_element_dup(const struct GNUNET_SET_Element *element); |
554 | 548 | ||
555 | 549 | ||
556 | /** | 550 | /** |
@@ -561,8 +555,8 @@ GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element); | |||
561 | * should be stored | 555 | * should be stored |
562 | */ | 556 | */ |
563 | void | 557 | void |
564 | GNUNET_SET_element_hash (const struct GNUNET_SET_Element *element, | 558 | GNUNET_SET_element_hash(const struct GNUNET_SET_Element *element, |
565 | struct GNUNET_HashCode *ret_hash); | 559 | struct GNUNET_HashCode *ret_hash); |
566 | 560 | ||
567 | 561 | ||
568 | #if 0 /* keep Emacsens' auto-indent happy */ | 562 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h index 167da160a..5d6e861a9 100644 --- a/src/include/gnunet_signal_lib.h +++ b/src/include/gnunet_signal_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -68,8 +68,8 @@ typedef void | |||
68 | * @return context that can be used to restore, NULL on error | 68 | * @return context that can be used to restore, NULL on error |
69 | */ | 69 | */ |
70 | struct GNUNET_SIGNAL_Context * | 70 | struct GNUNET_SIGNAL_Context * |
71 | GNUNET_SIGNAL_handler_install (int signal, | 71 | GNUNET_SIGNAL_handler_install(int signal, |
72 | GNUNET_SIGNAL_Handler handler); | 72 | GNUNET_SIGNAL_Handler handler); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -79,7 +79,7 @@ GNUNET_SIGNAL_handler_install (int signal, | |||
79 | * signal handler was installed | 79 | * signal handler was installed |
80 | */ | 80 | */ |
81 | void | 81 | void |
82 | GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | 82 | GNUNET_SIGNAL_handler_uninstall(struct GNUNET_SIGNAL_Context *ctx); |
83 | 83 | ||
84 | 84 | ||
85 | /** | 85 | /** |
@@ -90,7 +90,7 @@ GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | |||
90 | * @param sig the signal to raise | 90 | * @param sig the signal to raise |
91 | */ | 91 | */ |
92 | void | 92 | void |
93 | GNUNET_SIGNAL_raise (const int sig); | 93 | GNUNET_SIGNAL_raise(const int sig); |
94 | 94 | ||
95 | 95 | ||
96 | #if 0 /* keep Emacsens' auto-indent happy */ | 96 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h index 30a4bb761..6801c641e 100644 --- a/src/include/gnunet_signatures.h +++ b/src/include/gnunet_signatures.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
diff --git a/src/include/gnunet_socks.h b/src/include/gnunet_socks.h index b82fc2afb..68a4677dd 100644 --- a/src/include/gnunet_socks.h +++ b/src/include/gnunet_socks.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Jeffrey Burdges | 22 | * @author Jeffrey Burdges |
@@ -52,8 +52,8 @@ extern "C" | |||
52 | * @return GNUNET_YES if so, GNUNET_NO if not | 52 | * @return GNUNET_YES if so, GNUNET_NO if not |
53 | */ | 53 | */ |
54 | int | 54 | int |
55 | GNUNET_SOCKS_check_service (const char *service_name, | 55 | GNUNET_SOCKS_check_service(const char *service_name, |
56 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 56 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
57 | 57 | ||
58 | 58 | ||
59 | /** | 59 | /** |
@@ -65,8 +65,8 @@ GNUNET_SOCKS_check_service (const char *service_name, | |||
65 | * NULL if SOCKS not configured or not configured properly | 65 | * NULL if SOCKS not configured or not configured properly |
66 | */ | 66 | */ |
67 | struct GNUNET_CONNECTION_Handle * | 67 | struct GNUNET_CONNECTION_Handle * |
68 | GNUNET_SOCKS_do_connect (const char *service_name, | 68 | GNUNET_SOCKS_do_connect(const char *service_name, |
69 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 69 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
70 | 70 | ||
71 | 71 | ||
72 | #if 0 /* keep Emacsens' auto-indent happy */ | 72 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_speaker_lib.h b/src/include/gnunet_speaker_lib.h index 71f643791..261ea5981 100644 --- a/src/include/gnunet_speaker_lib.h +++ b/src/include/gnunet_speaker_lib.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -36,7 +36,7 @@ | |||
36 | #ifdef __cplusplus | 36 | #ifdef __cplusplus |
37 | extern "C" | 37 | extern "C" |
38 | { | 38 | { |
39 | #if 0 /* keep Emacsens' auto-indent happy */ | 39 | #if 0 /* keep Emacsens' auto-indent happy */ |
40 | } | 40 | } |
41 | #endif | 41 | #endif |
42 | #endif | 42 | #endif |
@@ -74,16 +74,14 @@ typedef void (*GNUNET_SPEAKER_DestroyCallback)(void *cls); | |||
74 | * opaque to the API but should be OPUS. | 74 | * opaque to the API but should be OPUS. |
75 | */ | 75 | */ |
76 | typedef void (*GNUNET_SPEAKER_PlayCallback)(void *cls, | 76 | typedef void (*GNUNET_SPEAKER_PlayCallback)(void *cls, |
77 | size_t data_size, | 77 | size_t data_size, |
78 | const void *data); | 78 | const void *data); |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * A speaker is a device that can play or record audio data. | 82 | * A speaker is a device that can play or record audio data. |
83 | */ | 83 | */ |
84 | struct GNUNET_SPEAKER_Handle | 84 | struct GNUNET_SPEAKER_Handle { |
85 | { | ||
86 | |||
87 | /** | 85 | /** |
88 | * Turn on the speaker. | 86 | * Turn on the speaker. |
89 | */ | 87 | */ |
@@ -108,7 +106,6 @@ struct GNUNET_SPEAKER_Handle | |||
108 | * Closure for the callbacks. | 106 | * Closure for the callbacks. |
109 | */ | 107 | */ |
110 | void *cls; | 108 | void *cls; |
111 | |||
112 | }; | 109 | }; |
113 | 110 | ||
114 | 111 | ||
@@ -120,7 +117,7 @@ struct GNUNET_SPEAKER_Handle | |||
120 | * @return NULL on error | 117 | * @return NULL on error |
121 | */ | 118 | */ |
122 | struct GNUNET_SPEAKER_Handle * | 119 | struct GNUNET_SPEAKER_Handle * |
123 | GNUNET_SPEAKER_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle *cfg); | 120 | GNUNET_SPEAKER_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cfg); |
124 | 121 | ||
125 | 122 | ||
126 | /** | 123 | /** |
@@ -129,10 +126,10 @@ GNUNET_SPEAKER_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle *c | |||
129 | * @param speaker speaker to destroy | 126 | * @param speaker speaker to destroy |
130 | */ | 127 | */ |
131 | void | 128 | void |
132 | GNUNET_SPEAKER_destroy (struct GNUNET_SPEAKER_Handle *speaker); | 129 | GNUNET_SPEAKER_destroy(struct GNUNET_SPEAKER_Handle *speaker); |
133 | 130 | ||
134 | 131 | ||
135 | #if 0 /* keep Emacsens' auto-indent happy */ | 132 | #if 0 /* keep Emacsens' auto-indent happy */ |
136 | { | 133 | { |
137 | #endif | 134 | #endif |
138 | #ifdef __cplusplus | 135 | #ifdef __cplusplus |
diff --git a/src/include/gnunet_sq_lib.h b/src/include/gnunet_sq_lib.h index ebc79d098..31ac0675c 100644 --- a/src/include/gnunet_sq_lib.h +++ b/src/include/gnunet_sq_lib.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2017 GNUnet e.V. | 3 | Copyright (C) 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file include/gnunet_sq_lib.h | 21 | * @file include/gnunet_sq_lib.h |
22 | * @brief helper functions for Sqlite3 DB interactions | 22 | * @brief helper functions for Sqlite3 DB interactions |
@@ -42,18 +42,16 @@ | |||
42 | */ | 42 | */ |
43 | typedef int | 43 | typedef int |
44 | (*GNUNET_SQ_QueryConverter)(void *cls, | 44 | (*GNUNET_SQ_QueryConverter)(void *cls, |
45 | const void *data, | 45 | const void *data, |
46 | size_t data_len, | 46 | size_t data_len, |
47 | sqlite3_stmt *stmt, | 47 | sqlite3_stmt *stmt, |
48 | unsigned int off); | 48 | unsigned int off); |
49 | 49 | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * @brief Description of a DB query parameter. | 52 | * @brief Description of a DB query parameter. |
53 | */ | 53 | */ |
54 | struct GNUNET_SQ_QueryParam | 54 | struct GNUNET_SQ_QueryParam { |
55 | { | ||
56 | |||
57 | /** | 55 | /** |
58 | * Function for how to handle this type of entry. | 56 | * Function for how to handle this type of entry. |
59 | */ | 57 | */ |
@@ -95,8 +93,8 @@ struct GNUNET_SQ_QueryParam | |||
95 | * @oaran ptr_size number of bytes in @a ptr | 93 | * @oaran ptr_size number of bytes in @a ptr |
96 | */ | 94 | */ |
97 | struct GNUNET_SQ_QueryParam | 95 | struct GNUNET_SQ_QueryParam |
98 | GNUNET_SQ_query_param_fixed_size (const void *ptr, | 96 | GNUNET_SQ_query_param_fixed_size(const void *ptr, |
99 | size_t ptr_size); | 97 | size_t ptr_size); |
100 | 98 | ||
101 | 99 | ||
102 | 100 | ||
@@ -106,7 +104,7 @@ GNUNET_SQ_query_param_fixed_size (const void *ptr, | |||
106 | * @param ptr pointer to the string query parameter to pass | 104 | * @param ptr pointer to the string query parameter to pass |
107 | */ | 105 | */ |
108 | struct GNUNET_SQ_QueryParam | 106 | struct GNUNET_SQ_QueryParam |
109 | GNUNET_SQ_query_param_string (const char *ptr); | 107 | GNUNET_SQ_query_param_string(const char *ptr); |
110 | 108 | ||
111 | 109 | ||
112 | /** | 110 | /** |
@@ -115,7 +113,7 @@ GNUNET_SQ_query_param_string (const char *ptr); | |||
115 | * | 113 | * |
116 | * @param x pointer to the query parameter to pass. | 114 | * @param x pointer to the query parameter to pass. |
117 | */ | 115 | */ |
118 | #define GNUNET_SQ_query_param_auto_from_type(x) GNUNET_SQ_query_param_fixed_size ((x), sizeof (*(x))) | 116 | #define GNUNET_SQ_query_param_auto_from_type(x) GNUNET_SQ_query_param_fixed_size((x), sizeof(*(x))) |
119 | 117 | ||
120 | 118 | ||
121 | /** | 119 | /** |
@@ -125,7 +123,7 @@ GNUNET_SQ_query_param_string (const char *ptr); | |||
125 | * @param x the query parameter to pass. | 123 | * @param x the query parameter to pass. |
126 | */ | 124 | */ |
127 | struct GNUNET_SQ_QueryParam | 125 | struct GNUNET_SQ_QueryParam |
128 | GNUNET_SQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x); | 126 | GNUNET_SQ_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x); |
129 | 127 | ||
130 | 128 | ||
131 | /** | 129 | /** |
@@ -135,7 +133,7 @@ GNUNET_SQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x | |||
135 | * @param x the query parameter to pass | 133 | * @param x the query parameter to pass |
136 | */ | 134 | */ |
137 | struct GNUNET_SQ_QueryParam | 135 | struct GNUNET_SQ_QueryParam |
138 | GNUNET_SQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x); | 136 | GNUNET_SQ_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); |
139 | 137 | ||
140 | 138 | ||
141 | /** | 139 | /** |
@@ -145,7 +143,7 @@ GNUNET_SQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) | |||
145 | * @param x pointer to the query parameter to pass | 143 | * @param x pointer to the query parameter to pass |
146 | */ | 144 | */ |
147 | struct GNUNET_SQ_QueryParam | 145 | struct GNUNET_SQ_QueryParam |
148 | GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | 146 | GNUNET_SQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); |
149 | 147 | ||
150 | 148 | ||
151 | /** | 149 | /** |
@@ -155,7 +153,7 @@ GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | |||
155 | * @param x pointer to the query parameter to pass | 153 | * @param x pointer to the query parameter to pass |
156 | */ | 154 | */ |
157 | struct GNUNET_SQ_QueryParam | 155 | struct GNUNET_SQ_QueryParam |
158 | GNUNET_SQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x); | 156 | GNUNET_SQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x); |
159 | 157 | ||
160 | 158 | ||
161 | /** | 159 | /** |
@@ -164,7 +162,7 @@ GNUNET_SQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x | |||
164 | * @param x pointer to the query parameter to pass | 162 | * @param x pointer to the query parameter to pass |
165 | */ | 163 | */ |
166 | struct GNUNET_SQ_QueryParam | 164 | struct GNUNET_SQ_QueryParam |
167 | GNUNET_SQ_query_param_uint16 (const uint16_t *x); | 165 | GNUNET_SQ_query_param_uint16(const uint16_t *x); |
168 | 166 | ||
169 | 167 | ||
170 | /** | 168 | /** |
@@ -173,7 +171,7 @@ GNUNET_SQ_query_param_uint16 (const uint16_t *x); | |||
173 | * @param x pointer to the query parameter to pass | 171 | * @param x pointer to the query parameter to pass |
174 | */ | 172 | */ |
175 | struct GNUNET_SQ_QueryParam | 173 | struct GNUNET_SQ_QueryParam |
176 | GNUNET_SQ_query_param_uint32 (const uint32_t *x); | 174 | GNUNET_SQ_query_param_uint32(const uint32_t *x); |
177 | 175 | ||
178 | 176 | ||
179 | /** | 177 | /** |
@@ -182,7 +180,7 @@ GNUNET_SQ_query_param_uint32 (const uint32_t *x); | |||
182 | * @param x pointer to the query parameter to pass | 180 | * @param x pointer to the query parameter to pass |
183 | */ | 181 | */ |
184 | struct GNUNET_SQ_QueryParam | 182 | struct GNUNET_SQ_QueryParam |
185 | GNUNET_SQ_query_param_uint64 (const uint64_t *x); | 183 | GNUNET_SQ_query_param_uint64(const uint64_t *x); |
186 | 184 | ||
187 | 185 | ||
188 | /** | 186 | /** |
@@ -193,8 +191,8 @@ GNUNET_SQ_query_param_uint64 (const uint64_t *x); | |||
193 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 191 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
194 | */ | 192 | */ |
195 | int | 193 | int |
196 | GNUNET_SQ_bind (sqlite3_stmt *stmt, | 194 | GNUNET_SQ_bind(sqlite3_stmt *stmt, |
197 | const struct GNUNET_SQ_QueryParam *params); | 195 | const struct GNUNET_SQ_QueryParam *params); |
198 | 196 | ||
199 | 197 | ||
200 | /** | 198 | /** |
@@ -204,8 +202,8 @@ GNUNET_SQ_bind (sqlite3_stmt *stmt, | |||
204 | * @param stmt statement to reset | 202 | * @param stmt statement to reset |
205 | */ | 203 | */ |
206 | void | 204 | void |
207 | GNUNET_SQ_reset (sqlite3 *dbh, | 205 | GNUNET_SQ_reset(sqlite3 *dbh, |
208 | sqlite3_stmt *stmt); | 206 | sqlite3_stmt *stmt); |
209 | 207 | ||
210 | 208 | ||
211 | /** | 209 | /** |
@@ -222,10 +220,10 @@ GNUNET_SQ_reset (sqlite3 *dbh, | |||
222 | */ | 220 | */ |
223 | typedef int | 221 | typedef int |
224 | (*GNUNET_SQ_ResultConverter)(void *cls, | 222 | (*GNUNET_SQ_ResultConverter)(void *cls, |
225 | sqlite3_stmt *result, | 223 | sqlite3_stmt *result, |
226 | unsigned int column, | 224 | unsigned int column, |
227 | size_t *dst_size, | 225 | size_t *dst_size, |
228 | void *dst); | 226 | void *dst); |
229 | 227 | ||
230 | 228 | ||
231 | /** | 229 | /** |
@@ -247,9 +245,7 @@ typedef void | |||
247 | /** | 245 | /** |
248 | * @brief Description of a DB result cell. | 246 | * @brief Description of a DB result cell. |
249 | */ | 247 | */ |
250 | struct GNUNET_SQ_ResultSpec | 248 | struct GNUNET_SQ_ResultSpec { |
251 | { | ||
252 | |||
253 | /** | 249 | /** |
254 | * What is the format of the result? | 250 | * What is the format of the result? |
255 | */ | 251 | */ |
@@ -289,7 +285,6 @@ struct GNUNET_SQ_ResultSpec | |||
289 | * Number of parameters (columns) eaten by this operation. | 285 | * Number of parameters (columns) eaten by this operation. |
290 | */ | 286 | */ |
291 | unsigned int num_params; | 287 | unsigned int num_params; |
292 | |||
293 | }; | 288 | }; |
294 | 289 | ||
295 | 290 | ||
@@ -309,8 +304,8 @@ struct GNUNET_SQ_ResultSpec | |||
309 | * @return array entry for the result specification to use | 304 | * @return array entry for the result specification to use |
310 | */ | 305 | */ |
311 | struct GNUNET_SQ_ResultSpec | 306 | struct GNUNET_SQ_ResultSpec |
312 | GNUNET_SQ_result_spec_variable_size (void **dst, | 307 | GNUNET_SQ_result_spec_variable_size(void **dst, |
313 | size_t *sptr); | 308 | size_t *sptr); |
314 | 309 | ||
315 | 310 | ||
316 | /** | 311 | /** |
@@ -321,8 +316,8 @@ GNUNET_SQ_result_spec_variable_size (void **dst, | |||
321 | * @return array entry for the result specification to use | 316 | * @return array entry for the result specification to use |
322 | */ | 317 | */ |
323 | struct GNUNET_SQ_ResultSpec | 318 | struct GNUNET_SQ_ResultSpec |
324 | GNUNET_SQ_result_spec_fixed_size (void *dst, | 319 | GNUNET_SQ_result_spec_fixed_size(void *dst, |
325 | size_t dst_size); | 320 | size_t dst_size); |
326 | 321 | ||
327 | 322 | ||
328 | /** | 323 | /** |
@@ -331,7 +326,7 @@ GNUNET_SQ_result_spec_fixed_size (void *dst, | |||
331 | * @param dst point to where to store the result, type fits expected result size | 326 | * @param dst point to where to store the result, type fits expected result size |
332 | * @return array entry for the result specification to use | 327 | * @return array entry for the result specification to use |
333 | */ | 328 | */ |
334 | #define GNUNET_SQ_result_spec_auto_from_type(dst) GNUNET_SQ_result_spec_fixed_size ((dst), sizeof (*(dst))) | 329 | #define GNUNET_SQ_result_spec_auto_from_type(dst) GNUNET_SQ_result_spec_fixed_size((dst), sizeof(*(dst))) |
335 | 330 | ||
336 | 331 | ||
337 | /** | 332 | /** |
@@ -342,8 +337,8 @@ GNUNET_SQ_result_spec_fixed_size (void *dst, | |||
342 | * @return array entry for the result specification to use | 337 | * @return array entry for the result specification to use |
343 | */ | 338 | */ |
344 | struct GNUNET_SQ_ResultSpec | 339 | struct GNUNET_SQ_ResultSpec |
345 | GNUNET_SQ_result_spec_variable_size (void **dst, | 340 | GNUNET_SQ_result_spec_variable_size(void **dst, |
346 | size_t *sptr); | 341 | size_t *sptr); |
347 | 342 | ||
348 | 343 | ||
349 | /** | 344 | /** |
@@ -353,7 +348,7 @@ GNUNET_SQ_result_spec_variable_size (void **dst, | |||
353 | * @return array entry for the result specification to use | 348 | * @return array entry for the result specification to use |
354 | */ | 349 | */ |
355 | struct GNUNET_SQ_ResultSpec | 350 | struct GNUNET_SQ_ResultSpec |
356 | GNUNET_SQ_result_spec_string (char **dst); | 351 | GNUNET_SQ_result_spec_string(char **dst); |
357 | 352 | ||
358 | 353 | ||
359 | /** | 354 | /** |
@@ -363,7 +358,7 @@ GNUNET_SQ_result_spec_string (char **dst); | |||
363 | * @return array entry for the result specification to use | 358 | * @return array entry for the result specification to use |
364 | */ | 359 | */ |
365 | struct GNUNET_SQ_ResultSpec | 360 | struct GNUNET_SQ_ResultSpec |
366 | GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); | 361 | GNUNET_SQ_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); |
367 | 362 | ||
368 | 363 | ||
369 | /** | 364 | /** |
@@ -373,7 +368,7 @@ GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); | |||
373 | * @return array entry for the result specification to use | 368 | * @return array entry for the result specification to use |
374 | */ | 369 | */ |
375 | struct GNUNET_SQ_ResultSpec | 370 | struct GNUNET_SQ_ResultSpec |
376 | GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig); | 371 | GNUNET_SQ_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); |
377 | 372 | ||
378 | 373 | ||
379 | /** | 374 | /** |
@@ -383,7 +378,7 @@ GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig); | |||
383 | * @return array entry for the result specification to use | 378 | * @return array entry for the result specification to use |
384 | */ | 379 | */ |
385 | struct GNUNET_SQ_ResultSpec | 380 | struct GNUNET_SQ_ResultSpec |
386 | GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at); | 381 | GNUNET_SQ_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); |
387 | 382 | ||
388 | 383 | ||
389 | /** | 384 | /** |
@@ -393,7 +388,7 @@ GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at); | |||
393 | * @return array entry for the result specification to use | 388 | * @return array entry for the result specification to use |
394 | */ | 389 | */ |
395 | struct GNUNET_SQ_ResultSpec | 390 | struct GNUNET_SQ_ResultSpec |
396 | GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at); | 391 | GNUNET_SQ_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); |
397 | 392 | ||
398 | 393 | ||
399 | /** | 394 | /** |
@@ -403,7 +398,7 @@ GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at); | |||
403 | * @return array entry for the result specification to use | 398 | * @return array entry for the result specification to use |
404 | */ | 399 | */ |
405 | struct GNUNET_SQ_ResultSpec | 400 | struct GNUNET_SQ_ResultSpec |
406 | GNUNET_SQ_result_spec_uint16 (uint16_t *u16); | 401 | GNUNET_SQ_result_spec_uint16(uint16_t *u16); |
407 | 402 | ||
408 | 403 | ||
409 | /** | 404 | /** |
@@ -413,7 +408,7 @@ GNUNET_SQ_result_spec_uint16 (uint16_t *u16); | |||
413 | * @return array entry for the result specification to use | 408 | * @return array entry for the result specification to use |
414 | */ | 409 | */ |
415 | struct GNUNET_SQ_ResultSpec | 410 | struct GNUNET_SQ_ResultSpec |
416 | GNUNET_SQ_result_spec_uint32 (uint32_t *u32); | 411 | GNUNET_SQ_result_spec_uint32(uint32_t *u32); |
417 | 412 | ||
418 | 413 | ||
419 | /** | 414 | /** |
@@ -423,7 +418,7 @@ GNUNET_SQ_result_spec_uint32 (uint32_t *u32); | |||
423 | * @return array entry for the result specification to use | 418 | * @return array entry for the result specification to use |
424 | */ | 419 | */ |
425 | struct GNUNET_SQ_ResultSpec | 420 | struct GNUNET_SQ_ResultSpec |
426 | GNUNET_SQ_result_spec_uint64 (uint64_t *u64); | 421 | GNUNET_SQ_result_spec_uint64(uint64_t *u64); |
427 | 422 | ||
428 | 423 | ||
429 | /** | 424 | /** |
@@ -436,8 +431,8 @@ GNUNET_SQ_result_spec_uint64 (uint64_t *u64); | |||
436 | * #GNUNET_SYSERR if a result was invalid (non-existing field) | 431 | * #GNUNET_SYSERR if a result was invalid (non-existing field) |
437 | */ | 432 | */ |
438 | int | 433 | int |
439 | GNUNET_SQ_extract_result (sqlite3_stmt *result, | 434 | GNUNET_SQ_extract_result(sqlite3_stmt *result, |
440 | struct GNUNET_SQ_ResultSpec *rs); | 435 | struct GNUNET_SQ_ResultSpec *rs); |
441 | 436 | ||
442 | 437 | ||
443 | /** | 438 | /** |
@@ -447,7 +442,7 @@ GNUNET_SQ_extract_result (sqlite3_stmt *result, | |||
447 | * @param rs reult specification to clean up | 442 | * @param rs reult specification to clean up |
448 | */ | 443 | */ |
449 | void | 444 | void |
450 | GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs); | 445 | GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs); |
451 | 446 | ||
452 | 447 | ||
453 | 448 | ||
@@ -459,7 +454,6 @@ GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs); | |||
459 | * #GNUNET_SQ_exec_statements(). | 454 | * #GNUNET_SQ_exec_statements(). |
460 | */ | 455 | */ |
461 | struct GNUNET_SQ_PrepareStatement { | 456 | struct GNUNET_SQ_PrepareStatement { |
462 | |||
463 | /** | 457 | /** |
464 | * Actual SQL statement. | 458 | * Actual SQL statement. |
465 | */ | 459 | */ |
@@ -469,7 +463,6 @@ struct GNUNET_SQ_PrepareStatement { | |||
469 | * Where to store handle? | 463 | * Where to store handle? |
470 | */ | 464 | */ |
471 | sqlite3_stmt **pstmt; | 465 | sqlite3_stmt **pstmt; |
472 | |||
473 | }; | 466 | }; |
474 | 467 | ||
475 | 468 | ||
@@ -487,8 +480,8 @@ struct GNUNET_SQ_PrepareStatement { | |||
487 | * @return initialized struct | 480 | * @return initialized struct |
488 | */ | 481 | */ |
489 | struct GNUNET_SQ_PrepareStatement | 482 | struct GNUNET_SQ_PrepareStatement |
490 | GNUNET_SQ_make_prepare (const char *sql, | 483 | GNUNET_SQ_make_prepare(const char *sql, |
491 | sqlite3_stmt **pstmt); | 484 | sqlite3_stmt **pstmt); |
492 | 485 | ||
493 | 486 | ||
494 | 487 | ||
@@ -501,8 +494,8 @@ GNUNET_SQ_make_prepare (const char *sql, | |||
501 | * @return #GNUNET_OK on success | 494 | * @return #GNUNET_OK on success |
502 | */ | 495 | */ |
503 | int | 496 | int |
504 | GNUNET_SQ_prepare (sqlite3 *dbh, | 497 | GNUNET_SQ_prepare(sqlite3 *dbh, |
505 | const struct GNUNET_SQ_PrepareStatement *ps); | 498 | const struct GNUNET_SQ_PrepareStatement *ps); |
506 | 499 | ||
507 | 500 | ||
508 | /* ******************** sq_exec.c functions ************** */ | 501 | /* ******************** sq_exec.c functions ************** */ |
@@ -513,7 +506,6 @@ GNUNET_SQ_prepare (sqlite3 *dbh, | |||
513 | * #GNUNET_SQ_exec_statements(). | 506 | * #GNUNET_SQ_exec_statements(). |
514 | */ | 507 | */ |
515 | struct GNUNET_SQ_ExecuteStatement { | 508 | struct GNUNET_SQ_ExecuteStatement { |
516 | |||
517 | /** | 509 | /** |
518 | * Actual SQL statement. | 510 | * Actual SQL statement. |
519 | */ | 511 | */ |
@@ -523,7 +515,6 @@ struct GNUNET_SQ_ExecuteStatement { | |||
523 | * Should we ignore errors? | 515 | * Should we ignore errors? |
524 | */ | 516 | */ |
525 | int ignore_errors; | 517 | int ignore_errors; |
526 | |||
527 | }; | 518 | }; |
528 | 519 | ||
529 | 520 | ||
@@ -540,7 +531,7 @@ struct GNUNET_SQ_ExecuteStatement { | |||
540 | * @return initialized struct | 531 | * @return initialized struct |
541 | */ | 532 | */ |
542 | struct GNUNET_SQ_ExecuteStatement | 533 | struct GNUNET_SQ_ExecuteStatement |
543 | GNUNET_SQ_make_execute (const char *sql); | 534 | GNUNET_SQ_make_execute(const char *sql); |
544 | 535 | ||
545 | 536 | ||
546 | /** | 537 | /** |
@@ -551,7 +542,7 @@ GNUNET_SQ_make_execute (const char *sql); | |||
551 | * @return initialized struct | 542 | * @return initialized struct |
552 | */ | 543 | */ |
553 | struct GNUNET_SQ_ExecuteStatement | 544 | struct GNUNET_SQ_ExecuteStatement |
554 | GNUNET_SQ_make_try_execute (const char *sql); | 545 | GNUNET_SQ_make_try_execute(const char *sql); |
555 | 546 | ||
556 | 547 | ||
557 | /** | 548 | /** |
@@ -564,8 +555,8 @@ GNUNET_SQ_make_try_execute (const char *sql); | |||
564 | * #GNUNET_SYSERR on error | 555 | * #GNUNET_SYSERR on error |
565 | */ | 556 | */ |
566 | int | 557 | int |
567 | GNUNET_SQ_exec_statements (sqlite3 *dbh, | 558 | GNUNET_SQ_exec_statements(sqlite3 *dbh, |
568 | const struct GNUNET_SQ_ExecuteStatement *es); | 559 | const struct GNUNET_SQ_ExecuteStatement *es); |
569 | 560 | ||
570 | 561 | ||
571 | 562 | ||
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 94fa49358..3dd6e9ce1 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -85,8 +85,8 @@ typedef int | |||
85 | * @return handle to use | 85 | * @return handle to use |
86 | */ | 86 | */ |
87 | struct GNUNET_STATISTICS_Handle * | 87 | struct GNUNET_STATISTICS_Handle * |
88 | GNUNET_STATISTICS_create (const char *subsystem, | 88 | GNUNET_STATISTICS_create(const char *subsystem, |
89 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 89 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
@@ -97,8 +97,8 @@ GNUNET_STATISTICS_create (const char *subsystem, | |||
97 | * be completed | 97 | * be completed |
98 | */ | 98 | */ |
99 | void | 99 | void |
100 | GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | 100 | GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, |
101 | int sync_first); | 101 | int sync_first); |
102 | 102 | ||
103 | 103 | ||
104 | /** | 104 | /** |
@@ -112,11 +112,11 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
112 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 112 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
113 | */ | 113 | */ |
114 | int | 114 | int |
115 | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | 115 | GNUNET_STATISTICS_watch(struct GNUNET_STATISTICS_Handle *handle, |
116 | const char *subsystem, | 116 | const char *subsystem, |
117 | const char *name, | 117 | const char *name, |
118 | GNUNET_STATISTICS_Iterator proc, | 118 | GNUNET_STATISTICS_Iterator proc, |
119 | void *proc_cls); | 119 | void *proc_cls); |
120 | 120 | ||
121 | 121 | ||
122 | /** | 122 | /** |
@@ -130,11 +130,11 @@ GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | |||
130 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error (no such watch) | 130 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error (no such watch) |
131 | */ | 131 | */ |
132 | int | 132 | int |
133 | GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle, | 133 | GNUNET_STATISTICS_watch_cancel(struct GNUNET_STATISTICS_Handle *handle, |
134 | const char *subsystem, | 134 | const char *subsystem, |
135 | const char *name, | 135 | const char *name, |
136 | GNUNET_STATISTICS_Iterator proc, | 136 | GNUNET_STATISTICS_Iterator proc, |
137 | void *proc_cls); | 137 | void *proc_cls); |
138 | 138 | ||
139 | 139 | ||
140 | /** | 140 | /** |
@@ -168,12 +168,12 @@ struct GNUNET_STATISTICS_GetHandle; | |||
168 | * @return NULL on error | 168 | * @return NULL on error |
169 | */ | 169 | */ |
170 | struct GNUNET_STATISTICS_GetHandle * | 170 | struct GNUNET_STATISTICS_GetHandle * |
171 | GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, | 171 | GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle, |
172 | const char *subsystem, | 172 | const char *subsystem, |
173 | const char *name, | 173 | const char *name, |
174 | GNUNET_STATISTICS_Callback cont, | 174 | GNUNET_STATISTICS_Callback cont, |
175 | GNUNET_STATISTICS_Iterator proc, | 175 | GNUNET_STATISTICS_Iterator proc, |
176 | void *cls); | 176 | void *cls); |
177 | 177 | ||
178 | 178 | ||
179 | /** | 179 | /** |
@@ -183,7 +183,7 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, | |||
183 | * @param gh handle of the request to cancel | 183 | * @param gh handle of the request to cancel |
184 | */ | 184 | */ |
185 | void | 185 | void |
186 | GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | 186 | GNUNET_STATISTICS_get_cancel(struct GNUNET_STATISTICS_GetHandle *gh); |
187 | 187 | ||
188 | 188 | ||
189 | /** | 189 | /** |
@@ -196,10 +196,10 @@ GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | |||
196 | * @param make_persistent should the value be kept across restarts? | 196 | * @param make_persistent should the value be kept across restarts? |
197 | */ | 197 | */ |
198 | void | 198 | void |
199 | GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | 199 | GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, |
200 | const char *name, | 200 | const char *name, |
201 | uint64_t value, | 201 | uint64_t value, |
202 | int make_persistent); | 202 | int make_persistent); |
203 | 203 | ||
204 | 204 | ||
205 | /** | 205 | /** |
@@ -212,10 +212,10 @@ GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | |||
212 | * @param make_persistent should the value be kept across restarts? | 212 | * @param make_persistent should the value be kept across restarts? |
213 | */ | 213 | */ |
214 | void | 214 | void |
215 | GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, | 215 | GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, |
216 | const char *name, | 216 | const char *name, |
217 | int64_t delta, | 217 | int64_t delta, |
218 | int make_persistent); | 218 | int make_persistent); |
219 | 219 | ||
220 | 220 | ||
221 | 221 | ||
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index db657f54e..25dfada42 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -61,8 +61,8 @@ extern "C" | |||
61 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 61 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
62 | */ | 62 | */ |
63 | int | 63 | int |
64 | GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, | 64 | GNUNET_STRINGS_fancy_size_to_bytes(const char *fancy_size, |
65 | unsigned long long *size); | 65 | unsigned long long *size); |
66 | 66 | ||
67 | 67 | ||
68 | /** | 68 | /** |
@@ -74,8 +74,8 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, | |||
74 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 74 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
75 | */ | 75 | */ |
76 | int | 76 | int |
77 | GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time, | 77 | GNUNET_STRINGS_fancy_time_to_relative(const char *fancy_time, |
78 | struct GNUNET_TIME_Relative *rtime); | 78 | struct GNUNET_TIME_Relative *rtime); |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -89,8 +89,8 @@ GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time, | |||
89 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 89 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
90 | */ | 90 | */ |
91 | int | 91 | int |
92 | GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time, | 92 | GNUNET_STRINGS_fancy_time_to_absolute(const char *fancy_time, |
93 | struct GNUNET_TIME_Absolute *atime); | 93 | struct GNUNET_TIME_Absolute *atime); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -100,7 +100,7 @@ GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time, | |||
100 | * @return fancy representation of the size (possibly rounded) for humans | 100 | * @return fancy representation of the size (possibly rounded) for humans |
101 | */ | 101 | */ |
102 | char * | 102 | char * |
103 | GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | 103 | GNUNET_STRINGS_byte_size_fancy(unsigned long long size); |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
@@ -117,9 +117,9 @@ GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
117 | * string is returned. | 117 | * string is returned. |
118 | */ | 118 | */ |
119 | char * | 119 | char * |
120 | GNUNET_STRINGS_conv (const char *input, size_t len, | 120 | GNUNET_STRINGS_conv(const char *input, size_t len, |
121 | const char *input_charset, | 121 | const char *input_charset, |
122 | const char *output_charset); | 122 | const char *output_charset); |
123 | 123 | ||
124 | 124 | ||
125 | /** | 125 | /** |
@@ -133,9 +133,9 @@ GNUNET_STRINGS_conv (const char *input, size_t len, | |||
133 | * @return the converted string (0-terminated) | 133 | * @return the converted string (0-terminated) |
134 | */ | 134 | */ |
135 | char * | 135 | char * |
136 | GNUNET_STRINGS_to_utf8 (const char *input, | 136 | GNUNET_STRINGS_to_utf8(const char *input, |
137 | size_t len, | 137 | size_t len, |
138 | const char *charset); | 138 | const char *charset); |
139 | 139 | ||
140 | 140 | ||
141 | /** | 141 | /** |
@@ -150,9 +150,9 @@ GNUNET_STRINGS_to_utf8 (const char *input, | |||
150 | * string is returned. | 150 | * string is returned. |
151 | */ | 151 | */ |
152 | char * | 152 | char * |
153 | GNUNET_STRINGS_from_utf8 (const char *input, | 153 | GNUNET_STRINGS_from_utf8(const char *input, |
154 | size_t len, | 154 | size_t len, |
155 | const char *charset); | 155 | const char *charset); |
156 | 156 | ||
157 | 157 | ||
158 | /** | 158 | /** |
@@ -163,8 +163,8 @@ GNUNET_STRINGS_from_utf8 (const char *input, | |||
163 | * @param output output buffer | 163 | * @param output output buffer |
164 | */ | 164 | */ |
165 | void | 165 | void |
166 | GNUNET_STRINGS_utf8_tolower (const char *input, | 166 | GNUNET_STRINGS_utf8_tolower(const char *input, |
167 | char *output); | 167 | char *output); |
168 | 168 | ||
169 | 169 | ||
170 | /** | 170 | /** |
@@ -175,8 +175,8 @@ GNUNET_STRINGS_utf8_tolower (const char *input, | |||
175 | * @param output output buffer | 175 | * @param output output buffer |
176 | */ | 176 | */ |
177 | void | 177 | void |
178 | GNUNET_STRINGS_utf8_toupper (const char *input, | 178 | GNUNET_STRINGS_utf8_toupper(const char *input, |
179 | char *output); | 179 | char *output); |
180 | 180 | ||
181 | 181 | ||
182 | /** | 182 | /** |
@@ -188,7 +188,7 @@ GNUNET_STRINGS_utf8_toupper (const char *input, | |||
188 | * NULL is returned on error | 188 | * NULL is returned on error |
189 | */ | 189 | */ |
190 | char * | 190 | char * |
191 | GNUNET_STRINGS_filename_expand (const char *fil); | 191 | GNUNET_STRINGS_filename_expand(const char *fil); |
192 | 192 | ||
193 | 193 | ||
194 | /** | 194 | /** |
@@ -211,10 +211,10 @@ GNUNET_STRINGS_filename_expand (const char *fil); | |||
211 | * (or number of bytes that would have been written) | 211 | * (or number of bytes that would have been written) |
212 | */ | 212 | */ |
213 | size_t | 213 | size_t |
214 | GNUNET_STRINGS_buffer_fill (char *buffer, | 214 | GNUNET_STRINGS_buffer_fill(char *buffer, |
215 | size_t size, | 215 | size_t size, |
216 | unsigned int count, | 216 | unsigned int count, |
217 | ...); | 217 | ...); |
218 | 218 | ||
219 | 219 | ||
220 | /** | 220 | /** |
@@ -230,9 +230,9 @@ GNUNET_STRINGS_buffer_fill (char *buffer, | |||
230 | * in the buffer, or 0 on error. | 230 | * in the buffer, or 0 on error. |
231 | */ | 231 | */ |
232 | unsigned int | 232 | unsigned int |
233 | GNUNET_STRINGS_buffer_tokenize (const char *buffer, | 233 | GNUNET_STRINGS_buffer_tokenize(const char *buffer, |
234 | size_t size, | 234 | size_t size, |
235 | unsigned int count, ...); | 235 | unsigned int count, ...); |
236 | 236 | ||
237 | 237 | ||
238 | 238 | ||
@@ -247,7 +247,7 @@ GNUNET_STRINGS_buffer_tokenize (const char *buffer, | |||
247 | * @return timestamp in human-readable form in local time | 247 | * @return timestamp in human-readable form in local time |
248 | */ | 248 | */ |
249 | const char * | 249 | const char * |
250 | GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | 250 | GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t); |
251 | 251 | ||
252 | 252 | ||
253 | /** | 253 | /** |
@@ -261,8 +261,8 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | |||
261 | * @return string in human-readable form | 261 | * @return string in human-readable form |
262 | */ | 262 | */ |
263 | const char * | 263 | const char * |
264 | GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta, | 264 | GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, |
265 | int do_round); | 265 | int do_round); |
266 | 266 | ||
267 | 267 | ||
268 | /** | 268 | /** |
@@ -277,7 +277,7 @@ GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta, | |||
277 | * itself. | 277 | * itself. |
278 | */ | 278 | */ |
279 | const char * | 279 | const char * |
280 | GNUNET_STRINGS_get_short_name (const char *filename); | 280 | GNUNET_STRINGS_get_short_name(const char *filename); |
281 | 281 | ||
282 | 282 | ||
283 | /** | 283 | /** |
@@ -293,10 +293,10 @@ GNUNET_STRINGS_get_short_name (const char *filename); | |||
293 | * @return pointer to the next byte in 'out' or NULL on error. | 293 | * @return pointer to the next byte in 'out' or NULL on error. |
294 | */ | 294 | */ |
295 | char * | 295 | char * |
296 | GNUNET_STRINGS_data_to_string (const void *data, | 296 | GNUNET_STRINGS_data_to_string(const void *data, |
297 | size_t size, | 297 | size_t size, |
298 | char *out, | 298 | char *out, |
299 | size_t out_size); | 299 | size_t out_size); |
300 | 300 | ||
301 | 301 | ||
302 | /** | 302 | /** |
@@ -310,8 +310,8 @@ GNUNET_STRINGS_data_to_string (const void *data, | |||
310 | * @return freshly allocated, null-terminated string | 310 | * @return freshly allocated, null-terminated string |
311 | */ | 311 | */ |
312 | char * | 312 | char * |
313 | GNUNET_STRINGS_data_to_string_alloc (const void *buf, | 313 | GNUNET_STRINGS_data_to_string_alloc(const void *buf, |
314 | size_t size); | 314 | size_t size); |
315 | 315 | ||
316 | 316 | ||
317 | /** | 317 | /** |
@@ -325,10 +325,10 @@ GNUNET_STRINGS_data_to_string_alloc (const void *buf, | |||
325 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding | 325 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding |
326 | */ | 326 | */ |
327 | int | 327 | int |
328 | GNUNET_STRINGS_string_to_data (const char *enc, | 328 | GNUNET_STRINGS_string_to_data(const char *enc, |
329 | size_t enclen, | 329 | size_t enclen, |
330 | void *out, | 330 | void *out, |
331 | size_t out_size); | 331 | size_t out_size); |
332 | 332 | ||
333 | 333 | ||
334 | /** | 334 | /** |
@@ -341,9 +341,9 @@ GNUNET_STRINGS_string_to_data (const char *enc, | |||
341 | * @return the size of the output | 341 | * @return the size of the output |
342 | */ | 342 | */ |
343 | size_t | 343 | size_t |
344 | GNUNET_STRINGS_base64_encode (const void *in, | 344 | GNUNET_STRINGS_base64_encode(const void *in, |
345 | size_t len, | 345 | size_t len, |
346 | char **output); | 346 | char **output); |
347 | 347 | ||
348 | 348 | ||
349 | /** | 349 | /** |
@@ -356,9 +356,9 @@ GNUNET_STRINGS_base64_encode (const void *in, | |||
356 | * @return the size of the output | 356 | * @return the size of the output |
357 | */ | 357 | */ |
358 | size_t | 358 | size_t |
359 | GNUNET_STRINGS_base64_decode (const char *data, | 359 | GNUNET_STRINGS_base64_decode(const char *data, |
360 | size_t len, | 360 | size_t len, |
361 | void **output); | 361 | void **output); |
362 | 362 | ||
363 | 363 | ||
364 | /** | 364 | /** |
@@ -369,8 +369,8 @@ GNUNET_STRINGS_base64_decode (const char *data, | |||
369 | * @return string representing the array of @a pids | 369 | * @return string representing the array of @a pids |
370 | */ | 370 | */ |
371 | char * | 371 | char * |
372 | GNUNET_STRINGS_pp2s (const struct GNUNET_PeerIdentity *pids, | 372 | GNUNET_STRINGS_pp2s(const struct GNUNET_PeerIdentity *pids, |
373 | unsigned int num_pids); | 373 | unsigned int num_pids); |
374 | 374 | ||
375 | 375 | ||
376 | /** | 376 | /** |
@@ -390,9 +390,9 @@ GNUNET_STRINGS_pp2s (const struct GNUNET_PeerIdentity *pids, | |||
390 | * (if they weren't NULL). | 390 | * (if they weren't NULL). |
391 | */ | 391 | */ |
392 | int | 392 | int |
393 | GNUNET_STRINGS_parse_uri (const char *path, | 393 | GNUNET_STRINGS_parse_uri(const char *path, |
394 | char **scheme_part, | 394 | char **scheme_part, |
395 | const char **path_part); | 395 | const char **path_part); |
396 | 396 | ||
397 | 397 | ||
398 | /** | 398 | /** |
@@ -410,17 +410,16 @@ GNUNET_STRINGS_parse_uri (const char *path, | |||
410 | * @return #GNUNET_YES if 'filename' is absolute, #GNUNET_NO otherwise. | 410 | * @return #GNUNET_YES if 'filename' is absolute, #GNUNET_NO otherwise. |
411 | */ | 411 | */ |
412 | int | 412 | int |
413 | GNUNET_STRINGS_path_is_absolute (const char *filename, | 413 | GNUNET_STRINGS_path_is_absolute(const char *filename, |
414 | int can_be_uri, | 414 | int can_be_uri, |
415 | int *r_is_uri, | 415 | int *r_is_uri, |
416 | char **r_uri_scheme); | 416 | char **r_uri_scheme); |
417 | 417 | ||
418 | 418 | ||
419 | /** | 419 | /** |
420 | * Flags for what we should check a file for. | 420 | * Flags for what we should check a file for. |
421 | */ | 421 | */ |
422 | enum GNUNET_STRINGS_FilenameCheck | 422 | enum GNUNET_STRINGS_FilenameCheck { |
423 | { | ||
424 | /** | 423 | /** |
425 | * Check that it exists. | 424 | * Check that it exists. |
426 | */ | 425 | */ |
@@ -453,8 +452,8 @@ enum GNUNET_STRINGS_FilenameCheck | |||
453 | * fails, #GNUNET_SYSERR when a check can't be performed | 452 | * fails, #GNUNET_SYSERR when a check can't be performed |
454 | */ | 453 | */ |
455 | int | 454 | int |
456 | GNUNET_STRINGS_check_filename (const char *filename, | 455 | GNUNET_STRINGS_check_filename(const char *filename, |
457 | enum GNUNET_STRINGS_FilenameCheck checks); | 456 | enum GNUNET_STRINGS_FilenameCheck checks); |
458 | 457 | ||
459 | 458 | ||
460 | /** | 459 | /** |
@@ -469,9 +468,9 @@ GNUNET_STRINGS_check_filename (const char *filename, | |||
469 | * case the contents of r_buf are undefined. | 468 | * case the contents of r_buf are undefined. |
470 | */ | 469 | */ |
471 | int | 470 | int |
472 | GNUNET_STRINGS_to_address_ipv6 (const char *zt_addr, | 471 | GNUNET_STRINGS_to_address_ipv6(const char *zt_addr, |
473 | uint16_t addrlen, | 472 | uint16_t addrlen, |
474 | struct sockaddr_in6 *r_buf); | 473 | struct sockaddr_in6 *r_buf); |
475 | 474 | ||
476 | 475 | ||
477 | /** | 476 | /** |
@@ -485,9 +484,9 @@ GNUNET_STRINGS_to_address_ipv6 (const char *zt_addr, | |||
485 | * the contents of r_buf are undefined. | 484 | * the contents of r_buf are undefined. |
486 | */ | 485 | */ |
487 | int | 486 | int |
488 | GNUNET_STRINGS_to_address_ipv4 (const char *zt_addr, | 487 | GNUNET_STRINGS_to_address_ipv4(const char *zt_addr, |
489 | uint16_t addrlen, | 488 | uint16_t addrlen, |
490 | struct sockaddr_in *r_buf); | 489 | struct sockaddr_in *r_buf); |
491 | 490 | ||
492 | 491 | ||
493 | /** | 492 | /** |
@@ -500,9 +499,9 @@ GNUNET_STRINGS_to_address_ipv4 (const char *zt_addr, | |||
500 | * @return 0 on error, otherwise number of bytes in @a sa | 499 | * @return 0 on error, otherwise number of bytes in @a sa |
501 | */ | 500 | */ |
502 | size_t | 501 | size_t |
503 | GNUNET_STRINGS_parse_socket_addr (const char *addr, | 502 | GNUNET_STRINGS_parse_socket_addr(const char *addr, |
504 | uint8_t *af, | 503 | uint8_t *af, |
505 | struct sockaddr **sa); | 504 | struct sockaddr **sa); |
506 | 505 | ||
507 | 506 | ||
508 | /** | 507 | /** |
@@ -517,9 +516,9 @@ GNUNET_STRINGS_parse_socket_addr (const char *addr, | |||
517 | * case the contents of r_buf are undefined. | 516 | * case the contents of r_buf are undefined. |
518 | */ | 517 | */ |
519 | int | 518 | int |
520 | GNUNET_STRINGS_to_address_ip (const char *addr, | 519 | GNUNET_STRINGS_to_address_ip(const char *addr, |
521 | uint16_t addrlen, | 520 | uint16_t addrlen, |
522 | struct sockaddr_storage *r_buf); | 521 | struct sockaddr_storage *r_buf); |
523 | 522 | ||
524 | 523 | ||
525 | /** | 524 | /** |
@@ -535,10 +534,10 @@ GNUNET_STRINGS_to_address_ip (const char *addr, | |||
535 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 534 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
536 | */ | 535 | */ |
537 | int | 536 | int |
538 | GNUNET_STRINGS_get_utf8_args (int argc, | 537 | GNUNET_STRINGS_get_utf8_args(int argc, |
539 | char *const *argv, | 538 | char *const *argv, |
540 | int *u8argc, | 539 | int *u8argc, |
541 | char *const **u8argv); | 540 | char *const **u8argv); |
542 | 541 | ||
543 | 542 | ||
544 | /** | 543 | /** |
@@ -554,7 +553,7 @@ GNUNET_STRINGS_get_utf8_args (int argc, | |||
554 | * @param n the length of the string to copy, including its terminating null | 553 | * @param n the length of the string to copy, including its terminating null |
555 | * byte | 554 | * byte |
556 | * @return the length of the string that was copied, excluding the terminating | 555 | * @return the length of the string that was copied, excluding the terminating |
557 | * null byte | 556 | * null byte |
558 | */ | 557 | */ |
559 | size_t | 558 | size_t |
560 | GNUNET_strlcpy(char *dst, const char *src, size_t n); | 559 | GNUNET_strlcpy(char *dst, const char *src, size_t n); |
@@ -562,9 +561,7 @@ GNUNET_strlcpy(char *dst, const char *src, size_t n); | |||
562 | 561 | ||
563 | /* ***************** IPv4/IPv6 parsing ****************** */ | 562 | /* ***************** IPv4/IPv6 parsing ****************** */ |
564 | 563 | ||
565 | struct GNUNET_STRINGS_PortPolicy | 564 | struct GNUNET_STRINGS_PortPolicy { |
566 | { | ||
567 | |||
568 | /** | 565 | /** |
569 | * Starting port range (0 if none given). | 566 | * Starting port range (0 if none given). |
570 | */ | 567 | */ |
@@ -580,15 +577,13 @@ struct GNUNET_STRINGS_PortPolicy | |||
580 | * ("!" in policy). | 577 | * ("!" in policy). |
581 | */ | 578 | */ |
582 | int negate_portrange; | 579 | int negate_portrange; |
583 | |||
584 | }; | 580 | }; |
585 | 581 | ||
586 | 582 | ||
587 | /** | 583 | /** |
588 | * @brief IPV4 network in CIDR notation. | 584 | * @brief IPV4 network in CIDR notation. |
589 | */ | 585 | */ |
590 | struct GNUNET_STRINGS_IPv4NetworkPolicy | 586 | struct GNUNET_STRINGS_IPv4NetworkPolicy { |
591 | { | ||
592 | /** | 587 | /** |
593 | * IPv4 address. | 588 | * IPv4 address. |
594 | */ | 589 | */ |
@@ -603,15 +598,13 @@ struct GNUNET_STRINGS_IPv4NetworkPolicy | |||
603 | * Policy for port access. | 598 | * Policy for port access. |
604 | */ | 599 | */ |
605 | struct GNUNET_STRINGS_PortPolicy pp; | 600 | struct GNUNET_STRINGS_PortPolicy pp; |
606 | |||
607 | }; | 601 | }; |
608 | 602 | ||
609 | 603 | ||
610 | /** | 604 | /** |
611 | * @brief network in CIDR notation for IPV6. | 605 | * @brief network in CIDR notation for IPV6. |
612 | */ | 606 | */ |
613 | struct GNUNET_STRINGS_IPv6NetworkPolicy | 607 | struct GNUNET_STRINGS_IPv6NetworkPolicy { |
614 | { | ||
615 | /** | 608 | /** |
616 | * IPv6 address. | 609 | * IPv6 address. |
617 | */ | 610 | */ |
@@ -626,7 +619,6 @@ struct GNUNET_STRINGS_IPv6NetworkPolicy | |||
626 | * Policy for port access. | 619 | * Policy for port access. |
627 | */ | 620 | */ |
628 | struct GNUNET_STRINGS_PortPolicy pp; | 621 | struct GNUNET_STRINGS_PortPolicy pp; |
629 | |||
630 | }; | 622 | }; |
631 | 623 | ||
632 | 624 | ||
@@ -642,7 +634,7 @@ struct GNUNET_STRINGS_IPv6NetworkPolicy | |||
642 | * NULL if the synatx is flawed | 634 | * NULL if the synatx is flawed |
643 | */ | 635 | */ |
644 | struct GNUNET_STRINGS_IPv4NetworkPolicy * | 636 | struct GNUNET_STRINGS_IPv4NetworkPolicy * |
645 | GNUNET_STRINGS_parse_ipv4_policy (const char *routeListX); | 637 | GNUNET_STRINGS_parse_ipv4_policy(const char *routeListX); |
646 | 638 | ||
647 | 639 | ||
648 | /** | 640 | /** |
@@ -657,7 +649,7 @@ GNUNET_STRINGS_parse_ipv4_policy (const char *routeListX); | |||
657 | * @return the converted list, 0-terminated, NULL if the synatx is flawed | 649 | * @return the converted list, 0-terminated, NULL if the synatx is flawed |
658 | */ | 650 | */ |
659 | struct GNUNET_STRINGS_IPv6NetworkPolicy * | 651 | struct GNUNET_STRINGS_IPv6NetworkPolicy * |
660 | GNUNET_STRINGS_parse_ipv6_policy (const char *routeListX); | 652 | GNUNET_STRINGS_parse_ipv6_policy(const char *routeListX); |
661 | 653 | ||
662 | 654 | ||
663 | #if 0 /* keep Emacsens' auto-indent happy */ | 655 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_testbed_logger_service.h b/src/include/gnunet_testbed_logger_service.h index 6dece2915..5d820e20b 100644 --- a/src/include/gnunet_testbed_logger_service.h +++ b/src/include/gnunet_testbed_logger_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -56,7 +56,7 @@ struct GNUNET_TESTBED_LOGGER_Handle; | |||
56 | * upon any error | 56 | * upon any error |
57 | */ | 57 | */ |
58 | struct GNUNET_TESTBED_LOGGER_Handle * | 58 | struct GNUNET_TESTBED_LOGGER_Handle * |
59 | GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 59 | GNUNET_TESTBED_LOGGER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
60 | 60 | ||
61 | 61 | ||
62 | /** | 62 | /** |
@@ -65,7 +65,7 @@ GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
65 | * @param h the logger handle | 65 | * @param h the logger handle |
66 | */ | 66 | */ |
67 | void | 67 | void |
68 | GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h); | 68 | GNUNET_TESTBED_LOGGER_disconnect(struct GNUNET_TESTBED_LOGGER_Handle *h); |
69 | 69 | ||
70 | 70 | ||
71 | /** | 71 | /** |
@@ -90,9 +90,9 @@ typedef void | |||
90 | * @param size how many bytes of @a data to send | 90 | * @param size how many bytes of @a data to send |
91 | */ | 91 | */ |
92 | void | 92 | void |
93 | GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h, | 93 | GNUNET_TESTBED_LOGGER_write(struct GNUNET_TESTBED_LOGGER_Handle *h, |
94 | const void *data, | 94 | const void *data, |
95 | size_t size); | 95 | size_t size); |
96 | 96 | ||
97 | 97 | ||
98 | /** | 98 | /** |
@@ -103,9 +103,9 @@ GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h, | |||
103 | * @param cb_cls the closure for @a cb | 103 | * @param cb_cls the closure for @a cb |
104 | */ | 104 | */ |
105 | void | 105 | void |
106 | GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h, | 106 | GNUNET_TESTBED_LOGGER_flush(struct GNUNET_TESTBED_LOGGER_Handle *h, |
107 | GNUNET_TESTBED_LOGGER_FlushCompletion cb, | 107 | GNUNET_TESTBED_LOGGER_FlushCompletion cb, |
108 | void *cb_cls); | 108 | void *cb_cls); |
109 | 109 | ||
110 | 110 | ||
111 | /** | 111 | /** |
@@ -116,7 +116,7 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h, | |||
116 | * @param h the logger handle | 116 | * @param h the logger handle |
117 | */ | 117 | */ |
118 | void | 118 | void |
119 | GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h); | 119 | GNUNET_TESTBED_LOGGER_flush_cancel(struct GNUNET_TESTBED_LOGGER_Handle *h); |
120 | 120 | ||
121 | 121 | ||
122 | #if 0 /* keep Emacsens' auto-indent happy */ | 122 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index db626df0e..5acf885dc 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -89,10 +89,10 @@ struct GNUNET_TESTBED_Controller; | |||
89 | * @return handle to the host, NULL on error | 89 | * @return handle to the host, NULL on error |
90 | */ | 90 | */ |
91 | struct GNUNET_TESTBED_Host * | 91 | struct GNUNET_TESTBED_Host * |
92 | GNUNET_TESTBED_host_create (const char *hostname, | 92 | GNUNET_TESTBED_host_create(const char *hostname, |
93 | const char *username, | 93 | const char *username, |
94 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 94 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
95 | uint16_t port); | 95 | uint16_t port); |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
@@ -112,12 +112,12 @@ GNUNET_TESTBED_host_create (const char *hostname, | |||
112 | * @return handle to the host, NULL on error | 112 | * @return handle to the host, NULL on error |
113 | */ | 113 | */ |
114 | struct GNUNET_TESTBED_Host * | 114 | struct GNUNET_TESTBED_Host * |
115 | GNUNET_TESTBED_host_create_with_id (uint32_t id, | 115 | GNUNET_TESTBED_host_create_with_id(uint32_t id, |
116 | const char *hostname, | 116 | const char *hostname, |
117 | const char *username, | 117 | const char *username, |
118 | const struct GNUNET_CONFIGURATION_Handle | 118 | const struct GNUNET_CONFIGURATION_Handle |
119 | *cfg, | 119 | *cfg, |
120 | uint16_t port); | 120 | uint16_t port); |
121 | 121 | ||
122 | 122 | ||
123 | /** | 123 | /** |
@@ -133,10 +133,10 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id, | |||
133 | * @return number of hosts returned in 'hosts', 0 on error | 133 | * @return number of hosts returned in 'hosts', 0 on error |
134 | */ | 134 | */ |
135 | unsigned int | 135 | unsigned int |
136 | GNUNET_TESTBED_hosts_load_from_file (const char *filename, | 136 | GNUNET_TESTBED_hosts_load_from_file(const char *filename, |
137 | const struct GNUNET_CONFIGURATION_Handle | 137 | const struct GNUNET_CONFIGURATION_Handle |
138 | *cfg, | 138 | *cfg, |
139 | struct GNUNET_TESTBED_Host ***hosts); | 139 | struct GNUNET_TESTBED_Host ***hosts); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -152,10 +152,10 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
152 | * @return number of hosts returned in 'hosts', 0 on error | 152 | * @return number of hosts returned in 'hosts', 0 on error |
153 | */ | 153 | */ |
154 | unsigned int | 154 | unsigned int |
155 | GNUNET_TESTBED_hosts_load_from_loadleveler (const struct | 155 | GNUNET_TESTBED_hosts_load_from_loadleveler(const struct |
156 | GNUNET_CONFIGURATION_Handle *cfg, | 156 | GNUNET_CONFIGURATION_Handle *cfg, |
157 | struct GNUNET_TESTBED_Host | 157 | struct GNUNET_TESTBED_Host |
158 | ***hosts); | 158 | ***hosts); |
159 | 159 | ||
160 | /** | 160 | /** |
161 | * Destroy a host handle. Must only be called once everything | 161 | * Destroy a host handle. Must only be called once everything |
@@ -164,7 +164,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct | |||
164 | * @param host handle to destroy | 164 | * @param host handle to destroy |
165 | */ | 165 | */ |
166 | void | 166 | void |
167 | GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host); | 167 | GNUNET_TESTBED_host_destroy(struct GNUNET_TESTBED_Host *host); |
168 | 168 | ||
169 | 169 | ||
170 | /** | 170 | /** |
@@ -201,11 +201,11 @@ typedef void | |||
201 | * GNUNET_TESTBED_is_host_habitable_cancel() | 201 | * GNUNET_TESTBED_is_host_habitable_cancel() |
202 | */ | 202 | */ |
203 | struct GNUNET_TESTBED_HostHabitableCheckHandle * | 203 | struct GNUNET_TESTBED_HostHabitableCheckHandle * |
204 | GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | 204 | GNUNET_TESTBED_is_host_habitable(const struct GNUNET_TESTBED_Host *host, |
205 | const struct GNUNET_CONFIGURATION_Handle | 205 | const struct GNUNET_CONFIGURATION_Handle |
206 | *config, | 206 | *config, |
207 | GNUNET_TESTBED_HostHabitableCallback cb, | 207 | GNUNET_TESTBED_HostHabitableCallback cb, |
208 | void *cb_cls); | 208 | void *cb_cls); |
209 | 209 | ||
210 | 210 | ||
211 | /** | 211 | /** |
@@ -214,9 +214,9 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
214 | * @param handle the habitability check handle | 214 | * @param handle the habitability check handle |
215 | */ | 215 | */ |
216 | void | 216 | void |
217 | GNUNET_TESTBED_is_host_habitable_cancel (struct | 217 | GNUNET_TESTBED_is_host_habitable_cancel(struct |
218 | GNUNET_TESTBED_HostHabitableCheckHandle | 218 | GNUNET_TESTBED_HostHabitableCheckHandle |
219 | *handle); | 219 | *handle); |
220 | 220 | ||
221 | /** | 221 | /** |
222 | * Obtain the host's hostname. | 222 | * Obtain the host's hostname. |
@@ -225,15 +225,14 @@ GNUNET_TESTBED_is_host_habitable_cancel (struct | |||
225 | * @return hostname of the host | 225 | * @return hostname of the host |
226 | */ | 226 | */ |
227 | const char * | 227 | const char * |
228 | GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host); | 228 | GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host); |
229 | 229 | ||
230 | 230 | ||
231 | /** | 231 | /** |
232 | * Enumeration with (at most 64) possible event types that | 232 | * Enumeration with (at most 64) possible event types that |
233 | * can be monitored using the testbed framework. | 233 | * can be monitored using the testbed framework. |
234 | */ | 234 | */ |
235 | enum GNUNET_TESTBED_EventType | 235 | enum GNUNET_TESTBED_EventType { |
236 | { | ||
237 | /** | 236 | /** |
238 | * A peer has been started. | 237 | * A peer has been started. |
239 | */ | 238 | */ |
@@ -258,16 +257,13 @@ enum GNUNET_TESTBED_EventType | |||
258 | * A requested testbed operation has been completed. | 257 | * A requested testbed operation has been completed. |
259 | */ | 258 | */ |
260 | GNUNET_TESTBED_ET_OPERATION_FINISHED = 4, | 259 | GNUNET_TESTBED_ET_OPERATION_FINISHED = 4, |
261 | |||
262 | }; | 260 | }; |
263 | 261 | ||
264 | 262 | ||
265 | /** | 263 | /** |
266 | * Types of information that can be requested about a peer. | 264 | * Types of information that can be requested about a peer. |
267 | */ | 265 | */ |
268 | enum GNUNET_TESTBED_PeerInformationType | 266 | enum GNUNET_TESTBED_PeerInformationType { |
269 | { | ||
270 | |||
271 | /** | 267 | /** |
272 | * Special value (not valid for requesting information) | 268 | * Special value (not valid for requesting information) |
273 | * that is used in the event struct if a 'generic' pointer | 269 | * that is used in the event struct if a 'generic' pointer |
@@ -291,7 +287,6 @@ enum GNUNET_TESTBED_PeerInformationType | |||
291 | * 'GNUNET_TESTNIG_operation_done' is called. | 287 | * 'GNUNET_TESTNIG_operation_done' is called. |
292 | */ | 288 | */ |
293 | GNUNET_TESTBED_PIT_IDENTITY | 289 | GNUNET_TESTBED_PIT_IDENTITY |
294 | |||
295 | }; | 290 | }; |
296 | 291 | ||
297 | 292 | ||
@@ -299,9 +294,7 @@ enum GNUNET_TESTBED_PeerInformationType | |||
299 | * Argument to GNUNET_TESTBED_ControllerCallback with details about | 294 | * Argument to GNUNET_TESTBED_ControllerCallback with details about |
300 | * the event. | 295 | * the event. |
301 | */ | 296 | */ |
302 | struct GNUNET_TESTBED_EventInformation | 297 | struct GNUNET_TESTBED_EventInformation { |
303 | { | ||
304 | |||
305 | /** | 298 | /** |
306 | * Type of the event. | 299 | * Type of the event. |
307 | */ | 300 | */ |
@@ -320,14 +313,11 @@ struct GNUNET_TESTBED_EventInformation | |||
320 | /** | 313 | /** |
321 | * Details about the event. | 314 | * Details about the event. |
322 | */ | 315 | */ |
323 | union | 316 | union { |
324 | { | ||
325 | |||
326 | /** | 317 | /** |
327 | * Details about peer start event. | 318 | * Details about peer start event. |
328 | */ | 319 | */ |
329 | struct | 320 | struct { |
330 | { | ||
331 | /** | 321 | /** |
332 | * Handle for the host where the peer | 322 | * Handle for the host where the peer |
333 | * was started. | 323 | * was started. |
@@ -338,27 +328,22 @@ struct GNUNET_TESTBED_EventInformation | |||
338 | * Handle for the peer that was started. | 328 | * Handle for the peer that was started. |
339 | */ | 329 | */ |
340 | struct GNUNET_TESTBED_Peer *peer; | 330 | struct GNUNET_TESTBED_Peer *peer; |
341 | |||
342 | } peer_start; | 331 | } peer_start; |
343 | 332 | ||
344 | /** | 333 | /** |
345 | * Details about peer stop event. | 334 | * Details about peer stop event. |
346 | */ | 335 | */ |
347 | struct | 336 | struct { |
348 | { | ||
349 | |||
350 | /** | 337 | /** |
351 | * Handle for the peer that was started. | 338 | * Handle for the peer that was started. |
352 | */ | 339 | */ |
353 | struct GNUNET_TESTBED_Peer *peer; | 340 | struct GNUNET_TESTBED_Peer *peer; |
354 | |||
355 | } peer_stop; | 341 | } peer_stop; |
356 | 342 | ||
357 | /** | 343 | /** |
358 | * Details about connect event. | 344 | * Details about connect event. |
359 | */ | 345 | */ |
360 | struct | 346 | struct { |
361 | { | ||
362 | /** | 347 | /** |
363 | * Handle for one of the connected peers. | 348 | * Handle for one of the connected peers. |
364 | */ | 349 | */ |
@@ -368,14 +353,12 @@ struct GNUNET_TESTBED_EventInformation | |||
368 | * Handle for one of the connected peers. | 353 | * Handle for one of the connected peers. |
369 | */ | 354 | */ |
370 | struct GNUNET_TESTBED_Peer *peer2; | 355 | struct GNUNET_TESTBED_Peer *peer2; |
371 | |||
372 | } peer_connect; | 356 | } peer_connect; |
373 | 357 | ||
374 | /** | 358 | /** |
375 | * Details about disconnect event. | 359 | * Details about disconnect event. |
376 | */ | 360 | */ |
377 | struct | 361 | struct { |
378 | { | ||
379 | /** | 362 | /** |
380 | * Handle for one of the disconnected peers. | 363 | * Handle for one of the disconnected peers. |
381 | */ | 364 | */ |
@@ -385,14 +368,12 @@ struct GNUNET_TESTBED_EventInformation | |||
385 | * Handle for one of the disconnected peers. | 368 | * Handle for one of the disconnected peers. |
386 | */ | 369 | */ |
387 | struct GNUNET_TESTBED_Peer *peer2; | 370 | struct GNUNET_TESTBED_Peer *peer2; |
388 | |||
389 | } peer_disconnect; | 371 | } peer_disconnect; |
390 | 372 | ||
391 | /** | 373 | /** |
392 | * Details about an operation finished event. | 374 | * Details about an operation finished event. |
393 | */ | 375 | */ |
394 | struct | 376 | struct { |
395 | { | ||
396 | /** | 377 | /** |
397 | * Error message for the operation, NULL on success. | 378 | * Error message for the operation, NULL on success. |
398 | */ | 379 | */ |
@@ -403,11 +384,8 @@ struct GNUNET_TESTBED_EventInformation | |||
403 | * (whatever the GNUNET_TESTBED_ConnectAdapter returned). | 384 | * (whatever the GNUNET_TESTBED_ConnectAdapter returned). |
404 | */ | 385 | */ |
405 | void *generic; | 386 | void *generic; |
406 | |||
407 | } operation_finished; | 387 | } operation_finished; |
408 | |||
409 | } details; | 388 | } details; |
410 | |||
411 | }; | 389 | }; |
412 | 390 | ||
413 | 391 | ||
@@ -468,10 +446,10 @@ typedef void | |||
468 | * @return the controller process handle, NULL on errors | 446 | * @return the controller process handle, NULL on errors |
469 | */ | 447 | */ |
470 | struct GNUNET_TESTBED_ControllerProc * | 448 | struct GNUNET_TESTBED_ControllerProc * |
471 | GNUNET_TESTBED_controller_start (const char *trusted_ip, | 449 | GNUNET_TESTBED_controller_start(const char *trusted_ip, |
472 | struct GNUNET_TESTBED_Host *host, | 450 | struct GNUNET_TESTBED_Host *host, |
473 | GNUNET_TESTBED_ControllerStatusCallback cb, | 451 | GNUNET_TESTBED_ControllerStatusCallback cb, |
474 | void *cls); | 452 | void *cls); |
475 | 453 | ||
476 | 454 | ||
477 | /** | 455 | /** |
@@ -483,7 +461,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip, | |||
483 | * @param cproc the controller process handle | 461 | * @param cproc the controller process handle |
484 | */ | 462 | */ |
485 | void | 463 | void |
486 | GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); | 464 | GNUNET_TESTBED_controller_stop(struct GNUNET_TESTBED_ControllerProc *cproc); |
487 | 465 | ||
488 | 466 | ||
489 | /** | 467 | /** |
@@ -503,10 +481,10 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); | |||
503 | * @return handle to the controller | 481 | * @return handle to the controller |
504 | */ | 482 | */ |
505 | struct GNUNET_TESTBED_Controller * | 483 | struct GNUNET_TESTBED_Controller * |
506 | GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, | 484 | GNUNET_TESTBED_controller_connect(struct GNUNET_TESTBED_Host *host, |
507 | uint64_t event_mask, | 485 | uint64_t event_mask, |
508 | GNUNET_TESTBED_ControllerCallback cc, | 486 | GNUNET_TESTBED_ControllerCallback cc, |
509 | void *cc_cls); | 487 | void *cc_cls); |
510 | 488 | ||
511 | 489 | ||
512 | /** | 490 | /** |
@@ -517,7 +495,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, | |||
517 | * @param c handle to controller to stop | 495 | * @param c handle to controller to stop |
518 | */ | 496 | */ |
519 | void | 497 | void |
520 | GNUNET_TESTBED_controller_disconnect (struct GNUNET_TESTBED_Controller *c); | 498 | GNUNET_TESTBED_controller_disconnect(struct GNUNET_TESTBED_Controller *c); |
521 | 499 | ||
522 | 500 | ||
523 | /** | 501 | /** |
@@ -553,10 +531,10 @@ typedef void | |||
553 | * is not cancelled | 531 | * is not cancelled |
554 | */ | 532 | */ |
555 | struct GNUNET_TESTBED_HostRegistrationHandle * | 533 | struct GNUNET_TESTBED_HostRegistrationHandle * |
556 | GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller, | 534 | GNUNET_TESTBED_register_host(struct GNUNET_TESTBED_Controller *controller, |
557 | struct GNUNET_TESTBED_Host *host, | 535 | struct GNUNET_TESTBED_Host *host, |
558 | GNUNET_TESTBED_HostRegistrationCompletion cc, | 536 | GNUNET_TESTBED_HostRegistrationCompletion cc, |
559 | void *cc_cls); | 537 | void *cc_cls); |
560 | 538 | ||
561 | 539 | ||
562 | /** | 540 | /** |
@@ -569,8 +547,8 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller, | |||
569 | * @param handle the registration handle to cancel | 547 | * @param handle the registration handle to cancel |
570 | */ | 548 | */ |
571 | void | 549 | void |
572 | GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle | 550 | GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle |
573 | *handle); | 551 | *handle); |
574 | 552 | ||
575 | 553 | ||
576 | /** | 554 | /** |
@@ -616,11 +594,11 @@ typedef void | |||
616 | * @return the operation handle | 594 | * @return the operation handle |
617 | */ | 595 | */ |
618 | struct GNUNET_TESTBED_Operation * | 596 | struct GNUNET_TESTBED_Operation * |
619 | GNUNET_TESTBED_controller_link (void *op_cls, | 597 | GNUNET_TESTBED_controller_link(void *op_cls, |
620 | struct GNUNET_TESTBED_Controller *master, | 598 | struct GNUNET_TESTBED_Controller *master, |
621 | struct GNUNET_TESTBED_Host *delegated_host, | 599 | struct GNUNET_TESTBED_Host *delegated_host, |
622 | struct GNUNET_TESTBED_Host *slave_host, | 600 | struct GNUNET_TESTBED_Host *slave_host, |
623 | int is_subordinate); | 601 | int is_subordinate); |
624 | 602 | ||
625 | 603 | ||
626 | /** | 604 | /** |
@@ -639,9 +617,9 @@ GNUNET_TESTBED_controller_link (void *op_cls, | |||
639 | * master | 617 | * master |
640 | */ | 618 | */ |
641 | struct GNUNET_TESTBED_Operation * | 619 | struct GNUNET_TESTBED_Operation * |
642 | GNUNET_TESTBED_get_slave_config (void *op_cls, | 620 | GNUNET_TESTBED_get_slave_config(void *op_cls, |
643 | struct GNUNET_TESTBED_Controller *master, | 621 | struct GNUNET_TESTBED_Controller *master, |
644 | struct GNUNET_TESTBED_Host *slave_host); | 622 | struct GNUNET_TESTBED_Host *slave_host); |
645 | 623 | ||
646 | 624 | ||
647 | /** | 625 | /** |
@@ -689,11 +667,11 @@ typedef void | |||
689 | * @return the operation handle | 667 | * @return the operation handle |
690 | */ | 668 | */ |
691 | struct GNUNET_TESTBED_Operation * | 669 | struct GNUNET_TESTBED_Operation * |
692 | GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, | 670 | GNUNET_TESTBED_peer_create(struct GNUNET_TESTBED_Controller *controller, |
693 | struct GNUNET_TESTBED_Host *host, | 671 | struct GNUNET_TESTBED_Host *host, |
694 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 672 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
695 | GNUNET_TESTBED_PeerCreateCallback cb, | 673 | GNUNET_TESTBED_PeerCreateCallback cb, |
696 | void *cls); | 674 | void *cls); |
697 | 675 | ||
698 | 676 | ||
699 | /** | 677 | /** |
@@ -719,10 +697,10 @@ typedef void | |||
719 | * @return handle to the operation | 697 | * @return handle to the operation |
720 | */ | 698 | */ |
721 | struct GNUNET_TESTBED_Operation * | 699 | struct GNUNET_TESTBED_Operation * |
722 | GNUNET_TESTBED_peer_start (void *op_cls, | 700 | GNUNET_TESTBED_peer_start(void *op_cls, |
723 | struct GNUNET_TESTBED_Peer *peer, | 701 | struct GNUNET_TESTBED_Peer *peer, |
724 | GNUNET_TESTBED_PeerChurnCallback pcc, | 702 | GNUNET_TESTBED_PeerChurnCallback pcc, |
725 | void *pcc_cls); | 703 | void *pcc_cls); |
726 | 704 | ||
727 | 705 | ||
728 | /** | 706 | /** |
@@ -738,17 +716,16 @@ GNUNET_TESTBED_peer_start (void *op_cls, | |||
738 | * @return handle to the operation | 716 | * @return handle to the operation |
739 | */ | 717 | */ |
740 | struct GNUNET_TESTBED_Operation * | 718 | struct GNUNET_TESTBED_Operation * |
741 | GNUNET_TESTBED_peer_stop (void *op_cls, | 719 | GNUNET_TESTBED_peer_stop(void *op_cls, |
742 | struct GNUNET_TESTBED_Peer *peer, | 720 | struct GNUNET_TESTBED_Peer *peer, |
743 | GNUNET_TESTBED_PeerChurnCallback pcc, | 721 | GNUNET_TESTBED_PeerChurnCallback pcc, |
744 | void *pcc_cls); | 722 | void *pcc_cls); |
745 | 723 | ||
746 | 724 | ||
747 | /** | 725 | /** |
748 | * Data returned from GNUNET_TESTBED_peer_get_information | 726 | * Data returned from GNUNET_TESTBED_peer_get_information |
749 | */ | 727 | */ |
750 | struct GNUNET_TESTBED_PeerInformation | 728 | struct GNUNET_TESTBED_PeerInformation { |
751 | { | ||
752 | /** | 729 | /** |
753 | * Peer information type; captures which of the types | 730 | * Peer information type; captures which of the types |
754 | * in the 'op_result' is actually in use. | 731 | * in the 'op_result' is actually in use. |
@@ -758,8 +735,7 @@ struct GNUNET_TESTBED_PeerInformation | |||
758 | /** | 735 | /** |
759 | * The result of the get information operation; Choose according to the pit | 736 | * The result of the get information operation; Choose according to the pit |
760 | */ | 737 | */ |
761 | union | 738 | union { |
762 | { | ||
763 | /** | 739 | /** |
764 | * The configuration of the peer | 740 | * The configuration of the peer |
765 | */ | 741 | */ |
@@ -805,11 +781,11 @@ typedef void | |||
805 | * @return handle to the operation | 781 | * @return handle to the operation |
806 | */ | 782 | */ |
807 | struct GNUNET_TESTBED_Operation * | 783 | struct GNUNET_TESTBED_Operation * |
808 | GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer, | 784 | GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer, |
809 | enum GNUNET_TESTBED_PeerInformationType | 785 | enum GNUNET_TESTBED_PeerInformationType |
810 | pit, | 786 | pit, |
811 | GNUNET_TESTBED_PeerInfoCallback cb, | 787 | GNUNET_TESTBED_PeerInfoCallback cb, |
812 | void *cb_cls); | 788 | void *cb_cls); |
813 | 789 | ||
814 | 790 | ||
815 | /** | 791 | /** |
@@ -821,8 +797,8 @@ GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer, | |||
821 | * @return handle to the operation | 797 | * @return handle to the operation |
822 | */ | 798 | */ |
823 | struct GNUNET_TESTBED_Operation * | 799 | struct GNUNET_TESTBED_Operation * |
824 | GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, | 800 | GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer, |
825 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 801 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
826 | 802 | ||
827 | 803 | ||
828 | /** | 804 | /** |
@@ -833,7 +809,7 @@ GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, | |||
833 | * @return handle to the operation | 809 | * @return handle to the operation |
834 | */ | 810 | */ |
835 | struct GNUNET_TESTBED_Operation * | 811 | struct GNUNET_TESTBED_Operation * |
836 | GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer); | 812 | GNUNET_TESTBED_peer_destroy(struct GNUNET_TESTBED_Peer *peer); |
837 | 813 | ||
838 | 814 | ||
839 | /** | 815 | /** |
@@ -852,12 +828,12 @@ GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer); | |||
852 | * @return an operation handle; NULL upon error (peer not running) | 828 | * @return an operation handle; NULL upon error (peer not running) |
853 | */ | 829 | */ |
854 | struct GNUNET_TESTBED_Operation * | 830 | struct GNUNET_TESTBED_Operation * |
855 | GNUNET_TESTBED_peer_manage_service (void *op_cls, | 831 | GNUNET_TESTBED_peer_manage_service(void *op_cls, |
856 | struct GNUNET_TESTBED_Peer *peer, | 832 | struct GNUNET_TESTBED_Peer *peer, |
857 | const char *service_name, | 833 | const char *service_name, |
858 | GNUNET_TESTBED_OperationCompletionCallback cb, | 834 | GNUNET_TESTBED_OperationCompletionCallback cb, |
859 | void *cb_cls, | 835 | void *cb_cls, |
860 | unsigned int start); | 836 | unsigned int start); |
861 | 837 | ||
862 | 838 | ||
863 | /** | 839 | /** |
@@ -876,18 +852,17 @@ GNUNET_TESTBED_peer_manage_service (void *op_cls, | |||
876 | * present | 852 | * present |
877 | */ | 853 | */ |
878 | struct GNUNET_TESTBED_Operation * | 854 | struct GNUNET_TESTBED_Operation * |
879 | GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c, | 855 | GNUNET_TESTBED_shutdown_peers(struct GNUNET_TESTBED_Controller *c, |
880 | void *op_cls, | 856 | void *op_cls, |
881 | GNUNET_TESTBED_OperationCompletionCallback cb, | 857 | GNUNET_TESTBED_OperationCompletionCallback cb, |
882 | void *cb_cls); | 858 | void *cb_cls); |
883 | 859 | ||
884 | 860 | ||
885 | 861 | ||
886 | /** | 862 | /** |
887 | * Options for peer connections. | 863 | * Options for peer connections. |
888 | */ | 864 | */ |
889 | enum GNUNET_TESTBED_ConnectOption | 865 | enum GNUNET_TESTBED_ConnectOption { |
890 | { | ||
891 | /** | 866 | /** |
892 | * No option (not valid as an argument). | 867 | * No option (not valid as an argument). |
893 | */ | 868 | */ |
@@ -907,7 +882,6 @@ enum GNUNET_TESTBED_ConnectOption | |||
907 | * particular transports, force simulation of particular latencies | 882 | * particular transports, force simulation of particular latencies |
908 | * or message loss rates, or set bandwidth limitations. | 883 | * or message loss rates, or set bandwidth limitations. |
909 | */ | 884 | */ |
910 | |||
911 | }; | 885 | }; |
912 | 886 | ||
913 | 887 | ||
@@ -924,11 +898,11 @@ enum GNUNET_TESTBED_ConnectOption | |||
924 | * time is not allowed | 898 | * time is not allowed |
925 | */ | 899 | */ |
926 | struct GNUNET_TESTBED_Operation * | 900 | struct GNUNET_TESTBED_Operation * |
927 | GNUNET_TESTBED_underlay_configure_link_va (void *op_cls, | 901 | GNUNET_TESTBED_underlay_configure_link_va(void *op_cls, |
928 | struct GNUNET_TESTBED_Peer *p1, | 902 | struct GNUNET_TESTBED_Peer *p1, |
929 | struct GNUNET_TESTBED_Peer *p2, | 903 | struct GNUNET_TESTBED_Peer *p2, |
930 | enum GNUNET_TESTBED_ConnectOption co, | 904 | enum GNUNET_TESTBED_ConnectOption co, |
931 | va_list ap); | 905 | va_list ap); |
932 | 906 | ||
933 | 907 | ||
934 | /** | 908 | /** |
@@ -944,10 +918,10 @@ GNUNET_TESTBED_underlay_configure_link_va (void *op_cls, | |||
944 | * time is not allowed | 918 | * time is not allowed |
945 | */ | 919 | */ |
946 | struct GNUNET_TESTBED_Operation * | 920 | struct GNUNET_TESTBED_Operation * |
947 | GNUNET_TESTBED_underlay_configure_link (void *op_cls, | 921 | GNUNET_TESTBED_underlay_configure_link(void *op_cls, |
948 | struct GNUNET_TESTBED_Peer *p1, | 922 | struct GNUNET_TESTBED_Peer *p1, |
949 | struct GNUNET_TESTBED_Peer *p2, | 923 | struct GNUNET_TESTBED_Peer *p2, |
950 | enum GNUNET_TESTBED_ConnectOption co, ...); | 924 | enum GNUNET_TESTBED_ConnectOption co, ...); |
951 | 925 | ||
952 | 926 | ||
953 | 927 | ||
@@ -955,8 +929,7 @@ GNUNET_TESTBED_underlay_configure_link (void *op_cls, | |||
955 | * Topologies and topology options supported for testbeds. Options should always | 929 | * Topologies and topology options supported for testbeds. Options should always |
956 | * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END | 930 | * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END |
957 | */ | 931 | */ |
958 | enum GNUNET_TESTBED_TopologyOption | 932 | enum GNUNET_TESTBED_TopologyOption { |
959 | { | ||
960 | /** | 933 | /** |
961 | * A clique (everyone connected to everyone else). No options. If there are N | 934 | * A clique (everyone connected to everyone else). No options. If there are N |
962 | * peers this topology results in (N * (N -1)) connections. | 935 | * peers this topology results in (N * (N -1)) connections. |
@@ -1063,11 +1036,11 @@ enum GNUNET_TESTBED_TopologyOption | |||
1063 | * is not allowed at this time | 1036 | * is not allowed at this time |
1064 | */ | 1037 | */ |
1065 | struct GNUNET_TESTBED_Operation * | 1038 | struct GNUNET_TESTBED_Operation * |
1066 | GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls, | 1039 | GNUNET_TESTBED_underlay_configure_topology_va(void *op_cls, |
1067 | unsigned int num_peers, | 1040 | unsigned int num_peers, |
1068 | struct GNUNET_TESTBED_Peer **peers, | 1041 | struct GNUNET_TESTBED_Peer **peers, |
1069 | enum GNUNET_TESTBED_TopologyOption topo, | 1042 | enum GNUNET_TESTBED_TopologyOption topo, |
1070 | va_list ap); | 1043 | va_list ap); |
1071 | 1044 | ||
1072 | 1045 | ||
1073 | /** | 1046 | /** |
@@ -1082,11 +1055,11 @@ GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls, | |||
1082 | * is not allowed at this time | 1055 | * is not allowed at this time |
1083 | */ | 1056 | */ |
1084 | struct GNUNET_TESTBED_Operation * | 1057 | struct GNUNET_TESTBED_Operation * |
1085 | GNUNET_TESTBED_underlay_configure_topology (void *op_cls, | 1058 | GNUNET_TESTBED_underlay_configure_topology(void *op_cls, |
1086 | unsigned int num_peers, | 1059 | unsigned int num_peers, |
1087 | struct GNUNET_TESTBED_Peer **peers, | 1060 | struct GNUNET_TESTBED_Peer **peers, |
1088 | enum GNUNET_TESTBED_TopologyOption topo, | 1061 | enum GNUNET_TESTBED_TopologyOption topo, |
1089 | ...); | 1062 | ...); |
1090 | 1063 | ||
1091 | 1064 | ||
1092 | /** | 1065 | /** |
@@ -1104,11 +1077,11 @@ GNUNET_TESTBED_underlay_configure_topology (void *op_cls, | |||
1104 | * not running or underlay disallows) | 1077 | * not running or underlay disallows) |
1105 | */ | 1078 | */ |
1106 | struct GNUNET_TESTBED_Operation * | 1079 | struct GNUNET_TESTBED_Operation * |
1107 | GNUNET_TESTBED_overlay_connect (void *op_cls, | 1080 | GNUNET_TESTBED_overlay_connect(void *op_cls, |
1108 | GNUNET_TESTBED_OperationCompletionCallback cb, | 1081 | GNUNET_TESTBED_OperationCompletionCallback cb, |
1109 | void *cb_cls, | 1082 | void *cb_cls, |
1110 | struct GNUNET_TESTBED_Peer *p1, | 1083 | struct GNUNET_TESTBED_Peer *p1, |
1111 | struct GNUNET_TESTBED_Peer *p2); | 1084 | struct GNUNET_TESTBED_Peer *p2); |
1112 | 1085 | ||
1113 | 1086 | ||
1114 | /** | 1087 | /** |
@@ -1121,8 +1094,8 @@ GNUNET_TESTBED_overlay_connect (void *op_cls, | |||
1121 | * @param nfailures the number of overlay connects which failed | 1094 | * @param nfailures the number of overlay connects which failed |
1122 | */ | 1095 | */ |
1123 | typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls, | 1096 | typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls, |
1124 | unsigned int nsuccess, | 1097 | unsigned int nsuccess, |
1125 | unsigned int nfailures); | 1098 | unsigned int nfailures); |
1126 | 1099 | ||
1127 | 1100 | ||
1128 | /** | 1101 | /** |
@@ -1146,15 +1119,15 @@ typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls, | |||
1146 | * not running or underlay disallows) or if num_peers is less than 2 | 1119 | * not running or underlay disallows) or if num_peers is less than 2 |
1147 | */ | 1120 | */ |
1148 | struct GNUNET_TESTBED_Operation * | 1121 | struct GNUNET_TESTBED_Operation * |
1149 | GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | 1122 | GNUNET_TESTBED_overlay_configure_topology_va(void *op_cls, |
1150 | unsigned int num_peers, | 1123 | unsigned int num_peers, |
1151 | struct GNUNET_TESTBED_Peer **peers, | 1124 | struct GNUNET_TESTBED_Peer **peers, |
1152 | unsigned int *max_connections, | 1125 | unsigned int *max_connections, |
1153 | GNUNET_TESTBED_TopologyCompletionCallback | 1126 | GNUNET_TESTBED_TopologyCompletionCallback |
1154 | comp_cb, | 1127 | comp_cb, |
1155 | void *comp_cb_cls, | 1128 | void *comp_cb_cls, |
1156 | enum GNUNET_TESTBED_TopologyOption topo, | 1129 | enum GNUNET_TESTBED_TopologyOption topo, |
1157 | va_list va); | 1130 | va_list va); |
1158 | 1131 | ||
1159 | 1132 | ||
1160 | /** | 1133 | /** |
@@ -1178,15 +1151,15 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
1178 | * not running or underlay disallows) or if num_peers is less than 2 | 1151 | * not running or underlay disallows) or if num_peers is less than 2 |
1179 | */ | 1152 | */ |
1180 | struct GNUNET_TESTBED_Operation * | 1153 | struct GNUNET_TESTBED_Operation * |
1181 | GNUNET_TESTBED_overlay_configure_topology (void *op_cls, | 1154 | GNUNET_TESTBED_overlay_configure_topology(void *op_cls, |
1182 | unsigned int num_peers, | 1155 | unsigned int num_peers, |
1183 | struct GNUNET_TESTBED_Peer **peers, | 1156 | struct GNUNET_TESTBED_Peer **peers, |
1184 | unsigned int *max_connections, | 1157 | unsigned int *max_connections, |
1185 | GNUNET_TESTBED_TopologyCompletionCallback | 1158 | GNUNET_TESTBED_TopologyCompletionCallback |
1186 | comp_cb, | 1159 | comp_cb, |
1187 | void *comp_cb_cls, | 1160 | void *comp_cb_cls, |
1188 | enum GNUNET_TESTBED_TopologyOption topo, | 1161 | enum GNUNET_TESTBED_TopologyOption topo, |
1189 | ...); | 1162 | ...); |
1190 | 1163 | ||
1191 | 1164 | ||
1192 | /** | 1165 | /** |
@@ -1200,8 +1173,8 @@ GNUNET_TESTBED_overlay_configure_topology (void *op_cls, | |||
1200 | * be written to. | 1173 | * be written to. |
1201 | */ | 1174 | */ |
1202 | void | 1175 | void |
1203 | GNUNET_TESTBED_overlay_write_topology_to_file (struct GNUNET_TESTBED_Controller *controller, | 1176 | GNUNET_TESTBED_overlay_write_topology_to_file(struct GNUNET_TESTBED_Controller *controller, |
1204 | const char *filename); | 1177 | const char *filename); |
1205 | 1178 | ||
1206 | 1179 | ||
1207 | /** | 1180 | /** |
@@ -1244,7 +1217,7 @@ typedef void | |||
1244 | (*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls, | 1217 | (*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls, |
1245 | struct GNUNET_TESTBED_Operation *op, | 1218 | struct GNUNET_TESTBED_Operation *op, |
1246 | void *ca_result, | 1219 | void *ca_result, |
1247 | const char *emsg ); | 1220 | const char *emsg); |
1248 | 1221 | ||
1249 | 1222 | ||
1250 | /** | 1223 | /** |
@@ -1270,14 +1243,14 @@ typedef void | |||
1270 | * @return handle for the operation | 1243 | * @return handle for the operation |
1271 | */ | 1244 | */ |
1272 | struct GNUNET_TESTBED_Operation * | 1245 | struct GNUNET_TESTBED_Operation * |
1273 | GNUNET_TESTBED_service_connect (void *op_cls, | 1246 | GNUNET_TESTBED_service_connect(void *op_cls, |
1274 | struct GNUNET_TESTBED_Peer *peer, | 1247 | struct GNUNET_TESTBED_Peer *peer, |
1275 | const char *service_name, | 1248 | const char *service_name, |
1276 | GNUNET_TESTBED_ServiceConnectCompletionCallback cb, | 1249 | GNUNET_TESTBED_ServiceConnectCompletionCallback cb, |
1277 | void *cb_cls, | 1250 | void *cb_cls, |
1278 | GNUNET_TESTBED_ConnectAdapter ca, | 1251 | GNUNET_TESTBED_ConnectAdapter ca, |
1279 | GNUNET_TESTBED_DisconnectAdapter da, | 1252 | GNUNET_TESTBED_DisconnectAdapter da, |
1280 | void *cada_cls); | 1253 | void *cada_cls); |
1281 | 1254 | ||
1282 | 1255 | ||
1283 | /** | 1256 | /** |
@@ -1302,7 +1275,7 @@ GNUNET_TESTBED_service_connect (void *op_cls, | |||
1302 | * @param operation operation to signal completion or cancellation | 1275 | * @param operation operation to signal completion or cancellation |
1303 | */ | 1276 | */ |
1304 | void | 1277 | void |
1305 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); | 1278 | GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation); |
1306 | 1279 | ||
1307 | 1280 | ||
1308 | /** | 1281 | /** |
@@ -1341,12 +1314,12 @@ typedef int | |||
1341 | * @return operation handle to cancel the operation | 1314 | * @return operation handle to cancel the operation |
1342 | */ | 1315 | */ |
1343 | struct GNUNET_TESTBED_Operation * | 1316 | struct GNUNET_TESTBED_Operation * |
1344 | GNUNET_TESTBED_get_statistics (unsigned int num_peers, | 1317 | GNUNET_TESTBED_get_statistics(unsigned int num_peers, |
1345 | struct GNUNET_TESTBED_Peer **peers, | 1318 | struct GNUNET_TESTBED_Peer **peers, |
1346 | const char *subsystem, const char *name, | 1319 | const char *subsystem, const char *name, |
1347 | GNUNET_TESTBED_StatisticsIterator proc, | 1320 | GNUNET_TESTBED_StatisticsIterator proc, |
1348 | GNUNET_TESTBED_OperationCompletionCallback cont, | 1321 | GNUNET_TESTBED_OperationCompletionCallback cont, |
1349 | void *cls); | 1322 | void *cls); |
1350 | 1323 | ||
1351 | 1324 | ||
1352 | /** | 1325 | /** |
@@ -1358,7 +1331,7 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
1358 | * @return The peer's unique ID. | 1331 | * @return The peer's unique ID. |
1359 | */ | 1332 | */ |
1360 | uint32_t | 1333 | uint32_t |
1361 | GNUNET_TESTBED_get_index (const struct GNUNET_TESTBED_Peer *peer); | 1334 | GNUNET_TESTBED_get_index(const struct GNUNET_TESTBED_Peer *peer); |
1362 | 1335 | ||
1363 | 1336 | ||
1364 | /** | 1337 | /** |
@@ -1424,14 +1397,14 @@ typedef void | |||
1424 | * @param test_master_cls closure for 'test_master'. | 1397 | * @param test_master_cls closure for 'test_master'. |
1425 | */ | 1398 | */ |
1426 | void | 1399 | void |
1427 | GNUNET_TESTBED_run (const char *host_filename, | 1400 | GNUNET_TESTBED_run(const char *host_filename, |
1428 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 1401 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
1429 | unsigned int num_peers, | 1402 | unsigned int num_peers, |
1430 | uint64_t event_mask, | 1403 | uint64_t event_mask, |
1431 | GNUNET_TESTBED_ControllerCallback cc, | 1404 | GNUNET_TESTBED_ControllerCallback cc, |
1432 | void *cc_cls, | 1405 | void *cc_cls, |
1433 | GNUNET_TESTBED_TestMaster test_master, | 1406 | GNUNET_TESTBED_TestMaster test_master, |
1434 | void *test_master_cls); | 1407 | void *test_master_cls); |
1435 | 1408 | ||
1436 | 1409 | ||
1437 | /** | 1410 | /** |
@@ -1473,14 +1446,14 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1473 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 1446 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
1474 | */ | 1447 | */ |
1475 | int | 1448 | int |
1476 | GNUNET_TESTBED_test_run (const char *testname, | 1449 | GNUNET_TESTBED_test_run(const char *testname, |
1477 | const char *cfg_filename, | 1450 | const char *cfg_filename, |
1478 | unsigned int num_peers, | 1451 | unsigned int num_peers, |
1479 | uint64_t event_mask, | 1452 | uint64_t event_mask, |
1480 | GNUNET_TESTBED_ControllerCallback cc, | 1453 | GNUNET_TESTBED_ControllerCallback cc, |
1481 | void *cc_cls, | 1454 | void *cc_cls, |
1482 | GNUNET_TESTBED_TestMaster test_master, | 1455 | GNUNET_TESTBED_TestMaster test_master, |
1483 | void *test_master_cls); | 1456 | void *test_master_cls); |
1484 | 1457 | ||
1485 | 1458 | ||
1486 | /** | 1459 | /** |
@@ -1491,7 +1464,7 @@ GNUNET_TESTBED_test_run (const char *testname, | |||
1491 | * @return handle to the master controller | 1464 | * @return handle to the master controller |
1492 | */ | 1465 | */ |
1493 | struct GNUNET_TESTBED_Controller * | 1466 | struct GNUNET_TESTBED_Controller * |
1494 | GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h); | 1467 | GNUNET_TESTBED_run_get_controller_handle(struct GNUNET_TESTBED_RunHandle *h); |
1495 | 1468 | ||
1496 | 1469 | ||
1497 | /** | 1470 | /** |
@@ -1503,8 +1476,7 @@ struct GNUNET_TESTBED_Barrier; | |||
1503 | /** | 1476 | /** |
1504 | * Status of a barrier | 1477 | * Status of a barrier |
1505 | */ | 1478 | */ |
1506 | enum GNUNET_TESTBED_BarrierStatus | 1479 | enum GNUNET_TESTBED_BarrierStatus { |
1507 | { | ||
1508 | /** | 1480 | /** |
1509 | * Barrier initialised successfully | 1481 | * Barrier initialised successfully |
1510 | */ | 1482 | */ |
@@ -1519,7 +1491,6 @@ enum GNUNET_TESTBED_BarrierStatus | |||
1519 | * Error status | 1491 | * Error status |
1520 | */ | 1492 | */ |
1521 | GNUNET_TESTBED_BARRIERSTATUS_ERROR, | 1493 | GNUNET_TESTBED_BARRIERSTATUS_ERROR, |
1522 | |||
1523 | }; | 1494 | }; |
1524 | 1495 | ||
1525 | 1496 | ||
@@ -1561,11 +1532,11 @@ typedef void | |||
1561 | * @return barrier handle | 1532 | * @return barrier handle |
1562 | */ | 1533 | */ |
1563 | struct GNUNET_TESTBED_Barrier * | 1534 | struct GNUNET_TESTBED_Barrier * |
1564 | GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller, | 1535 | GNUNET_TESTBED_barrier_init(struct GNUNET_TESTBED_Controller *controller, |
1565 | const char *name, | 1536 | const char *name, |
1566 | unsigned int quorum, | 1537 | unsigned int quorum, |
1567 | GNUNET_TESTBED_barrier_status_cb cb, | 1538 | GNUNET_TESTBED_barrier_status_cb cb, |
1568 | void *cb_cls); | 1539 | void *cb_cls); |
1569 | 1540 | ||
1570 | 1541 | ||
1571 | /** | 1542 | /** |
@@ -1574,7 +1545,7 @@ GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller, | |||
1574 | * @param barrier the barrier handle | 1545 | * @param barrier the barrier handle |
1575 | */ | 1546 | */ |
1576 | void | 1547 | void |
1577 | GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier); | 1548 | GNUNET_TESTBED_barrier_cancel(struct GNUNET_TESTBED_Barrier *barrier); |
1578 | 1549 | ||
1579 | 1550 | ||
1580 | /** | 1551 | /** |
@@ -1611,9 +1582,9 @@ typedef void | |||
1611 | * anytime before the callback is called. NULL upon error. | 1582 | * anytime before the callback is called. NULL upon error. |
1612 | */ | 1583 | */ |
1613 | struct GNUNET_TESTBED_BarrierWaitHandle * | 1584 | struct GNUNET_TESTBED_BarrierWaitHandle * |
1614 | GNUNET_TESTBED_barrier_wait (const char *name, | 1585 | GNUNET_TESTBED_barrier_wait(const char *name, |
1615 | GNUNET_TESTBED_barrier_wait_cb cb, | 1586 | GNUNET_TESTBED_barrier_wait_cb cb, |
1616 | void *cls); | 1587 | void *cls); |
1617 | 1588 | ||
1618 | 1589 | ||
1619 | /** | 1590 | /** |
@@ -1623,7 +1594,7 @@ GNUNET_TESTBED_barrier_wait (const char *name, | |||
1623 | * @param h the barrier wait handle | 1594 | * @param h the barrier wait handle |
1624 | */ | 1595 | */ |
1625 | void | 1596 | void |
1626 | GNUNET_TESTBED_barrier_wait_cancel (struct GNUNET_TESTBED_BarrierWaitHandle *h); | 1597 | GNUNET_TESTBED_barrier_wait_cancel(struct GNUNET_TESTBED_BarrierWaitHandle *h); |
1627 | 1598 | ||
1628 | 1599 | ||
1629 | /** | 1600 | /** |
@@ -1637,8 +1608,7 @@ struct GNUNET_TESTBED_UnderlayLinkModel; | |||
1637 | * The type of GNUNET_TESTBED_UnderlayLinkModel | 1608 | * The type of GNUNET_TESTBED_UnderlayLinkModel |
1638 | * @ingroup underlay | 1609 | * @ingroup underlay |
1639 | */ | 1610 | */ |
1640 | enum GNUNET_TESTBED_UnderlayLinkModelType | 1611 | enum GNUNET_TESTBED_UnderlayLinkModelType { |
1641 | { | ||
1642 | /** | 1612 | /** |
1643 | * The model is based on white listing of peers to which underlay connections | 1613 | * The model is based on white listing of peers to which underlay connections |
1644 | * are permitted. Underlay connections to all other peers will not be | 1614 | * are permitted. Underlay connections to all other peers will not be |
@@ -1665,8 +1635,8 @@ enum GNUNET_TESTBED_UnderlayLinkModelType | |||
1665 | * @return the model | 1635 | * @return the model |
1666 | */ | 1636 | */ |
1667 | struct GNUNET_TESTBED_UnderlayLinkModel * | 1637 | struct GNUNET_TESTBED_UnderlayLinkModel * |
1668 | GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer, | 1638 | GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer, |
1669 | enum GNUNET_TESTBED_UnderlayLinkModelType type); | 1639 | enum GNUNET_TESTBED_UnderlayLinkModelType type); |
1670 | 1640 | ||
1671 | 1641 | ||
1672 | /** | 1642 | /** |
@@ -1679,8 +1649,8 @@ GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer, | |||
1679 | * @param peer the peer to add | 1649 | * @param peer the peer to add |
1680 | */ | 1650 | */ |
1681 | void | 1651 | void |
1682 | GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkModel *model, | 1652 | GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model, |
1683 | struct GNUNET_TESTBED_Peer *peer); | 1653 | struct GNUNET_TESTBED_Peer *peer); |
1684 | 1654 | ||
1685 | 1655 | ||
1686 | /** | 1656 | /** |
@@ -1695,11 +1665,11 @@ GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkMod | |||
1695 | * @param bandwidth bandwidth of the link in kilobytes per second [kB/s] | 1665 | * @param bandwidth bandwidth of the link in kilobytes per second [kB/s] |
1696 | */ | 1666 | */ |
1697 | void | 1667 | void |
1698 | GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkModel *model, | 1668 | GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkModel *model, |
1699 | struct GNUNET_TESTBED_Peer *peer, | 1669 | struct GNUNET_TESTBED_Peer *peer, |
1700 | uint32_t latency, | 1670 | uint32_t latency, |
1701 | uint32_t loss, | 1671 | uint32_t loss, |
1702 | uint32_t bandwidth); | 1672 | uint32_t bandwidth); |
1703 | 1673 | ||
1704 | 1674 | ||
1705 | /** | 1675 | /** |
@@ -1709,7 +1679,7 @@ GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkMod | |||
1709 | * @param model the model to commit | 1679 | * @param model the model to commit |
1710 | */ | 1680 | */ |
1711 | void | 1681 | void |
1712 | GNUNET_TESTBED_underlaylinkmodel_commit (struct GNUNET_TESTBED_UnderlayLinkModel *model); | 1682 | GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model); |
1713 | 1683 | ||
1714 | 1684 | ||
1715 | /** | 1685 | /** |
@@ -1721,7 +1691,7 @@ GNUNET_TESTBED_underlaylinkmodel_commit (struct GNUNET_TESTBED_UnderlayLinkModel | |||
1721 | * @param model the model to unallocate | 1691 | * @param model the model to unallocate |
1722 | */ | 1692 | */ |
1723 | void | 1693 | void |
1724 | GNUNET_TESTBED_underlaylinkmodel_free (struct GNUNET_TESTBED_UnderlayLinkModel *model); | 1694 | GNUNET_TESTBED_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model); |
1725 | 1695 | ||
1726 | 1696 | ||
1727 | #if 0 /* keep Emacsens' auto-indent happy */ | 1697 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 0317b2007..370360eb1 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -56,7 +56,7 @@ extern "C" | |||
56 | /** | 56 | /** |
57 | * Size of each hostkey in the hostkey file (in BYTES). | 57 | * Size of each hostkey in the hostkey file (in BYTES). |
58 | */ | 58 | */ |
59 | #define GNUNET_TESTING_HOSTKEYFILESIZE sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey) | 59 | #define GNUNET_TESTING_HOSTKEYFILESIZE sizeof(struct GNUNET_CRYPTO_EddsaPrivateKey) |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * The environmental variable, if set, that dictates where testing should place | 62 | * The environmental variable, if set, that dictates where testing should place |
@@ -81,8 +81,7 @@ struct GNUNET_TESTING_Peer; | |||
81 | /** | 81 | /** |
82 | * Specification of a service that is to be shared among peers | 82 | * Specification of a service that is to be shared among peers |
83 | */ | 83 | */ |
84 | struct GNUNET_TESTING_SharedService | 84 | struct GNUNET_TESTING_SharedService { |
85 | { | ||
86 | /** | 85 | /** |
87 | * The name of the service. | 86 | * The name of the service. |
88 | */ | 87 | */ |
@@ -122,11 +121,11 @@ struct GNUNET_TESTING_SharedService | |||
122 | * @return handle to this system, NULL on error | 121 | * @return handle to this system, NULL on error |
123 | */ | 122 | */ |
124 | struct GNUNET_TESTING_System * | 123 | struct GNUNET_TESTING_System * |
125 | GNUNET_TESTING_system_create (const char *testdir, | 124 | GNUNET_TESTING_system_create(const char *testdir, |
126 | const char *trusted_ip, | 125 | const char *trusted_ip, |
127 | const char *hostname, | 126 | const char *hostname, |
128 | const struct GNUNET_TESTING_SharedService * | 127 | const struct GNUNET_TESTING_SharedService * |
129 | shared_services); | 128 | shared_services); |
130 | 129 | ||
131 | 130 | ||
132 | /** | 131 | /** |
@@ -154,12 +153,12 @@ GNUNET_TESTING_system_create (const char *testdir, | |||
154 | * @return handle to this system, NULL on error | 153 | * @return handle to this system, NULL on error |
155 | */ | 154 | */ |
156 | struct GNUNET_TESTING_System * | 155 | struct GNUNET_TESTING_System * |
157 | GNUNET_TESTING_system_create_with_portrange (const char *testdir, | 156 | GNUNET_TESTING_system_create_with_portrange(const char *testdir, |
158 | const char *trusted_ip, | 157 | const char *trusted_ip, |
159 | const char *hostname, | 158 | const char *hostname, |
160 | const struct GNUNET_TESTING_SharedService *shared_services, | 159 | const struct GNUNET_TESTING_SharedService *shared_services, |
161 | uint16_t lowport, | 160 | uint16_t lowport, |
162 | uint16_t highport); | 161 | uint16_t highport); |
163 | 162 | ||
164 | 163 | ||
165 | /** | 164 | /** |
@@ -170,8 +169,8 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir, | |||
170 | * be removed (clean up on shutdown)? | 169 | * be removed (clean up on shutdown)? |
171 | */ | 170 | */ |
172 | void | 171 | void |
173 | GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system, | 172 | GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system, |
174 | int remove_paths); | 173 | int remove_paths); |
175 | 174 | ||
176 | 175 | ||
177 | /** | 176 | /** |
@@ -192,9 +191,9 @@ GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system, | |||
192 | * @return NULL on error (not enough keys) | 191 | * @return NULL on error (not enough keys) |
193 | */ | 192 | */ |
194 | struct GNUNET_CRYPTO_EddsaPrivateKey * | 193 | struct GNUNET_CRYPTO_EddsaPrivateKey * |
195 | GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | 194 | GNUNET_TESTING_hostkey_get(const struct GNUNET_TESTING_System *system, |
196 | uint32_t key_number, | 195 | uint32_t key_number, |
197 | struct GNUNET_PeerIdentity *id); | 196 | struct GNUNET_PeerIdentity *id); |
198 | 197 | ||
199 | 198 | ||
200 | /** | 199 | /** |
@@ -204,7 +203,7 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | |||
204 | * @return 0 if no free port was available | 203 | * @return 0 if no free port was available |
205 | */ | 204 | */ |
206 | uint16_t | 205 | uint16_t |
207 | GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system); | 206 | GNUNET_TESTING_reserve_port(struct GNUNET_TESTING_System *system); |
208 | 207 | ||
209 | 208 | ||
210 | /** | 209 | /** |
@@ -215,8 +214,8 @@ GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system); | |||
215 | * @param port reserved port to release | 214 | * @param port reserved port to release |
216 | */ | 215 | */ |
217 | void | 216 | void |
218 | GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system, | 217 | GNUNET_TESTING_release_port(struct GNUNET_TESTING_System *system, |
219 | uint16_t port); | 218 | uint16_t port); |
220 | 219 | ||
221 | 220 | ||
222 | /** | 221 | /** |
@@ -237,8 +236,8 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system, | |||
237 | * be incomplete and should not be used there upon | 236 | * be incomplete and should not be used there upon |
238 | */ | 237 | */ |
239 | int | 238 | int |
240 | GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system, | 239 | GNUNET_TESTING_configuration_create(struct GNUNET_TESTING_System *system, |
241 | struct GNUNET_CONFIGURATION_Handle *cfg); | 240 | struct GNUNET_CONFIGURATION_Handle *cfg); |
242 | // FIXME: add dual to 'release' ports again... | 241 | // FIXME: add dual to 'release' ports again... |
243 | 242 | ||
244 | 243 | ||
@@ -256,11 +255,11 @@ GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system, | |||
256 | * @return handle to the peer, NULL on error | 255 | * @return handle to the peer, NULL on error |
257 | */ | 256 | */ |
258 | struct GNUNET_TESTING_Peer * | 257 | struct GNUNET_TESTING_Peer * |
259 | GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | 258 | GNUNET_TESTING_peer_configure(struct GNUNET_TESTING_System *system, |
260 | struct GNUNET_CONFIGURATION_Handle *cfg, | 259 | struct GNUNET_CONFIGURATION_Handle *cfg, |
261 | uint32_t key_number, | 260 | uint32_t key_number, |
262 | struct GNUNET_PeerIdentity *id, | 261 | struct GNUNET_PeerIdentity *id, |
263 | char **emsg); | 262 | char **emsg); |
264 | 263 | ||
265 | 264 | ||
266 | /** | 265 | /** |
@@ -270,8 +269,8 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | |||
270 | * @param id identifier for the daemon, will be set | 269 | * @param id identifier for the daemon, will be set |
271 | */ | 270 | */ |
272 | void | 271 | void |
273 | GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer, | 272 | GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer, |
274 | struct GNUNET_PeerIdentity *id); | 273 | struct GNUNET_PeerIdentity *id); |
275 | 274 | ||
276 | 275 | ||
277 | /** | 276 | /** |
@@ -282,7 +281,7 @@ GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer, | |||
282 | * #GNUNET_SYSERR on error (i.e. peer already running) | 281 | * #GNUNET_SYSERR on error (i.e. peer already running) |
283 | */ | 282 | */ |
284 | int | 283 | int |
285 | GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer); | 284 | GNUNET_TESTING_peer_start(struct GNUNET_TESTING_Peer *peer); |
286 | 285 | ||
287 | 286 | ||
288 | /** | 287 | /** |
@@ -295,7 +294,7 @@ GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer); | |||
295 | * #GNUNET_SYSERR on error (i.e. peer not running) | 294 | * #GNUNET_SYSERR on error (i.e. peer not running) |
296 | */ | 295 | */ |
297 | int | 296 | int |
298 | GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer); | 297 | GNUNET_TESTING_peer_stop(struct GNUNET_TESTING_Peer *peer); |
299 | 298 | ||
300 | 299 | ||
301 | /** | 300 | /** |
@@ -306,7 +305,7 @@ GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer); | |||
306 | * @param peer peer to destroy | 305 | * @param peer peer to destroy |
307 | */ | 306 | */ |
308 | void | 307 | void |
309 | GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer); | 308 | GNUNET_TESTING_peer_destroy(struct GNUNET_TESTING_Peer *peer); |
310 | 309 | ||
311 | 310 | ||
312 | /** | 311 | /** |
@@ -317,7 +316,7 @@ GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer); | |||
317 | * or upon any error while sending SIGTERM | 316 | * or upon any error while sending SIGTERM |
318 | */ | 317 | */ |
319 | int | 318 | int |
320 | GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer); | 319 | GNUNET_TESTING_peer_kill(struct GNUNET_TESTING_Peer *peer); |
321 | 320 | ||
322 | 321 | ||
323 | /** | 322 | /** |
@@ -328,7 +327,7 @@ GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer); | |||
328 | * or upon any error while waiting | 327 | * or upon any error while waiting |
329 | */ | 328 | */ |
330 | int | 329 | int |
331 | GNUNET_TESTING_peer_wait (struct GNUNET_TESTING_Peer *peer); | 330 | GNUNET_TESTING_peer_wait(struct GNUNET_TESTING_Peer *peer); |
332 | 331 | ||
333 | 332 | ||
334 | /** | 333 | /** |
@@ -357,9 +356,9 @@ typedef void | |||
357 | * upon any error. | 356 | * upon any error. |
358 | */ | 357 | */ |
359 | int | 358 | int |
360 | GNUNET_TESTING_peer_stop_async (struct GNUNET_TESTING_Peer *peer, | 359 | GNUNET_TESTING_peer_stop_async(struct GNUNET_TESTING_Peer *peer, |
361 | GNUNET_TESTING_PeerStopCallback cb, | 360 | GNUNET_TESTING_PeerStopCallback cb, |
362 | void *cb_cls); | 361 | void *cb_cls); |
363 | 362 | ||
364 | 363 | ||
365 | /** | 364 | /** |
@@ -372,7 +371,7 @@ GNUNET_TESTING_peer_stop_async (struct GNUNET_TESTING_Peer *peer, | |||
372 | * before. | 371 | * before. |
373 | */ | 372 | */ |
374 | void | 373 | void |
375 | GNUNET_TESTING_peer_stop_async_cancel (struct GNUNET_TESTING_Peer *peer); | 374 | GNUNET_TESTING_peer_stop_async_cancel(struct GNUNET_TESTING_Peer *peer); |
376 | 375 | ||
377 | 376 | ||
378 | /** | 377 | /** |
@@ -406,10 +405,10 @@ typedef void | |||
406 | * @return 0 on success, 1 on error | 405 | * @return 0 on success, 1 on error |
407 | */ | 406 | */ |
408 | int | 407 | int |
409 | GNUNET_TESTING_peer_run (const char *testdir, | 408 | GNUNET_TESTING_peer_run(const char *testdir, |
410 | const char *cfgfilename, | 409 | const char *cfgfilename, |
411 | GNUNET_TESTING_TestMain tm, | 410 | GNUNET_TESTING_TestMain tm, |
412 | void *tm_cls); | 411 | void *tm_cls); |
413 | 412 | ||
414 | 413 | ||
415 | /** | 414 | /** |
@@ -434,11 +433,11 @@ GNUNET_TESTING_peer_run (const char *testdir, | |||
434 | * @return 0 on success, 1 on error | 433 | * @return 0 on success, 1 on error |
435 | */ | 434 | */ |
436 | int | 435 | int |
437 | GNUNET_TESTING_service_run (const char *testdir, | 436 | GNUNET_TESTING_service_run(const char *testdir, |
438 | const char *service_name, | 437 | const char *service_name, |
439 | const char *cfgfilename, | 438 | const char *cfgfilename, |
440 | GNUNET_TESTING_TestMain tm, | 439 | GNUNET_TESTING_TestMain tm, |
441 | void *tm_cls); | 440 | void *tm_cls); |
442 | 441 | ||
443 | 442 | ||
444 | /** | 443 | /** |
@@ -455,7 +454,7 @@ GNUNET_TESTING_service_run (const char *testdir, | |||
455 | * NULL if argv0 has no '_' | 454 | * NULL if argv0 has no '_' |
456 | */ | 455 | */ |
457 | char * | 456 | char * |
458 | GNUNET_TESTING_get_testname_from_underscore (const char *argv0); | 457 | GNUNET_TESTING_get_testname_from_underscore(const char *argv0); |
459 | 458 | ||
460 | 459 | ||
461 | #if 0 /* keep Emacsens' auto-indent happy */ | 460 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index d0da267a9..28a76e3ef 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -45,8 +45,7 @@ extern "C" | |||
45 | /** | 45 | /** |
46 | * Time for absolute times used by GNUnet, in microseconds. | 46 | * Time for absolute times used by GNUnet, in microseconds. |
47 | */ | 47 | */ |
48 | struct GNUNET_TIME_Absolute | 48 | struct GNUNET_TIME_Absolute { |
49 | { | ||
50 | /** | 49 | /** |
51 | * The actual value. | 50 | * The actual value. |
52 | */ | 51 | */ |
@@ -57,8 +56,7 @@ struct GNUNET_TIME_Absolute | |||
57 | * Time for relative time used by GNUnet, in microseconds. | 56 | * Time for relative time used by GNUnet, in microseconds. |
58 | * Always positive, so we can only refer to future time. | 57 | * Always positive, so we can only refer to future time. |
59 | */ | 58 | */ |
60 | struct GNUNET_TIME_Relative | 59 | struct GNUNET_TIME_Relative { |
61 | { | ||
62 | /** | 60 | /** |
63 | * The actual value. | 61 | * The actual value. |
64 | */ | 62 | */ |
@@ -70,8 +68,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
70 | /** | 68 | /** |
71 | * Time for relative time used by GNUnet, in microseconds and in network byte order. | 69 | * Time for relative time used by GNUnet, in microseconds and in network byte order. |
72 | */ | 70 | */ |
73 | struct GNUNET_TIME_RelativeNBO | 71 | struct GNUNET_TIME_RelativeNBO { |
74 | { | ||
75 | /** | 72 | /** |
76 | * The actual value (in network byte order). | 73 | * The actual value (in network byte order). |
77 | */ | 74 | */ |
@@ -82,8 +79,7 @@ struct GNUNET_TIME_RelativeNBO | |||
82 | /** | 79 | /** |
83 | * Time for absolute time used by GNUnet, in microseconds and in network byte order. | 80 | * Time for absolute time used by GNUnet, in microseconds and in network byte order. |
84 | */ | 81 | */ |
85 | struct GNUNET_TIME_AbsoluteNBO | 82 | struct GNUNET_TIME_AbsoluteNBO { |
86 | { | ||
87 | /** | 83 | /** |
88 | * The actual value (in network byte order). | 84 | * The actual value (in network byte order). |
89 | */ | 85 | */ |
@@ -129,41 +125,41 @@ GNUNET_NETWORK_STRUCT_END | |||
129 | /** | 125 | /** |
130 | * One day. | 126 | * One day. |
131 | */ | 127 | */ |
132 | #define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) | 128 | #define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) |
133 | 129 | ||
134 | /** | 130 | /** |
135 | * One week. | 131 | * One week. |
136 | */ | 132 | */ |
137 | #define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 7) | 133 | #define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 7) |
138 | 134 | ||
139 | /** | 135 | /** |
140 | * One month (30 days). | 136 | * One month (30 days). |
141 | */ | 137 | */ |
142 | #define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 30) | 138 | #define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 30) |
143 | 139 | ||
144 | /** | 140 | /** |
145 | * One year (365 days). | 141 | * One year (365 days). |
146 | */ | 142 | */ |
147 | #define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 365) | 143 | #define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 365) |
148 | 144 | ||
149 | /** | 145 | /** |
150 | * Constant used to specify "forever". This constant | 146 | * Constant used to specify "forever". This constant |
151 | * will be treated specially in all time operations. | 147 | * will be treated specially in all time operations. |
152 | */ | 148 | */ |
153 | #define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_ () | 149 | #define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_() |
154 | 150 | ||
155 | /** | 151 | /** |
156 | * Constant used to specify "forever". This constant | 152 | * Constant used to specify "forever". This constant |
157 | * will be treated specially in all time operations. | 153 | * will be treated specially in all time operations. |
158 | */ | 154 | */ |
159 | #define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ () | 155 | #define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_() |
160 | 156 | ||
161 | 157 | ||
162 | 158 | ||
163 | /** | 159 | /** |
164 | * Threshold after which exponential backoff should not increase (15 m). | 160 | * Threshold after which exponential backoff should not increase (15 m). |
165 | */ | 161 | */ |
166 | #define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) | 162 | #define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 15) |
167 | 163 | ||
168 | 164 | ||
169 | /** | 165 | /** |
@@ -172,8 +168,8 @@ GNUNET_NETWORK_STRUCT_END | |||
172 | * | 168 | * |
173 | * @param r current backoff time, initially zero | 169 | * @param r current backoff time, initially zero |
174 | */ | 170 | */ |
175 | #define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min (GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \ | 171 | #define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min(GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \ |
176 | GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2)); | 172 | GNUNET_TIME_relative_multiply(GNUNET_TIME_relative_max(GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2)); |
177 | 173 | ||
178 | 174 | ||
179 | /** | 175 | /** |
@@ -191,10 +187,10 @@ GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIM | |||
191 | 187 | ||
192 | /** | 188 | /** |
193 | * Return a random time value between 0.5*r and 1.5*r. | 189 | * Return a random time value between 0.5*r and 1.5*r. |
194 | * | 190 | * |
195 | * @param r input time for scaling | 191 | * @param r input time for scaling |
196 | * @return randomized time | 192 | * @return randomized time |
197 | */ | 193 | */ |
198 | struct GNUNET_TIME_Relative | 194 | struct GNUNET_TIME_Relative |
199 | GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); | 195 | GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); |
200 | 196 | ||
@@ -203,63 +199,63 @@ GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); | |||
203 | * Return relative time of 0ms. | 199 | * Return relative time of 0ms. |
204 | */ | 200 | */ |
205 | struct GNUNET_TIME_Relative | 201 | struct GNUNET_TIME_Relative |
206 | GNUNET_TIME_relative_get_zero_ (void); | 202 | GNUNET_TIME_relative_get_zero_(void); |
207 | 203 | ||
208 | 204 | ||
209 | /** | 205 | /** |
210 | * Return absolute time of 0ms. | 206 | * Return absolute time of 0ms. |
211 | */ | 207 | */ |
212 | struct GNUNET_TIME_Absolute | 208 | struct GNUNET_TIME_Absolute |
213 | GNUNET_TIME_absolute_get_zero_ (void); | 209 | GNUNET_TIME_absolute_get_zero_(void); |
214 | 210 | ||
215 | 211 | ||
216 | /** | 212 | /** |
217 | * Return relative time of 1 microsecond. | 213 | * Return relative time of 1 microsecond. |
218 | */ | 214 | */ |
219 | struct GNUNET_TIME_Relative | 215 | struct GNUNET_TIME_Relative |
220 | GNUNET_TIME_relative_get_unit_ (void); | 216 | GNUNET_TIME_relative_get_unit_(void); |
221 | 217 | ||
222 | 218 | ||
223 | /** | 219 | /** |
224 | * Return relative time of 1ms. | 220 | * Return relative time of 1ms. |
225 | */ | 221 | */ |
226 | struct GNUNET_TIME_Relative | 222 | struct GNUNET_TIME_Relative |
227 | GNUNET_TIME_relative_get_millisecond_ (void); | 223 | GNUNET_TIME_relative_get_millisecond_(void); |
228 | 224 | ||
229 | 225 | ||
230 | /** | 226 | /** |
231 | * Return relative time of 1s. | 227 | * Return relative time of 1s. |
232 | */ | 228 | */ |
233 | struct GNUNET_TIME_Relative | 229 | struct GNUNET_TIME_Relative |
234 | GNUNET_TIME_relative_get_second_ (void); | 230 | GNUNET_TIME_relative_get_second_(void); |
235 | 231 | ||
236 | 232 | ||
237 | /** | 233 | /** |
238 | * Return relative time of 1 minute. | 234 | * Return relative time of 1 minute. |
239 | */ | 235 | */ |
240 | struct GNUNET_TIME_Relative | 236 | struct GNUNET_TIME_Relative |
241 | GNUNET_TIME_relative_get_minute_ (void); | 237 | GNUNET_TIME_relative_get_minute_(void); |
242 | 238 | ||
243 | 239 | ||
244 | /** | 240 | /** |
245 | * Return relative time of 1 hour. | 241 | * Return relative time of 1 hour. |
246 | */ | 242 | */ |
247 | struct GNUNET_TIME_Relative | 243 | struct GNUNET_TIME_Relative |
248 | GNUNET_TIME_relative_get_hour_ (void); | 244 | GNUNET_TIME_relative_get_hour_(void); |
249 | 245 | ||
250 | 246 | ||
251 | /** | 247 | /** |
252 | * Return "forever". | 248 | * Return "forever". |
253 | */ | 249 | */ |
254 | struct GNUNET_TIME_Relative | 250 | struct GNUNET_TIME_Relative |
255 | GNUNET_TIME_relative_get_forever_ (void); | 251 | GNUNET_TIME_relative_get_forever_(void); |
256 | 252 | ||
257 | 253 | ||
258 | /** | 254 | /** |
259 | * Return "forever". | 255 | * Return "forever". |
260 | */ | 256 | */ |
261 | struct GNUNET_TIME_Absolute | 257 | struct GNUNET_TIME_Absolute |
262 | GNUNET_TIME_absolute_get_forever_ (void); | 258 | GNUNET_TIME_absolute_get_forever_(void); |
263 | 259 | ||
264 | 260 | ||
265 | /** | 261 | /** |
@@ -268,7 +264,7 @@ GNUNET_TIME_absolute_get_forever_ (void); | |||
268 | * @return the current time | 264 | * @return the current time |
269 | */ | 265 | */ |
270 | struct GNUNET_TIME_Absolute | 266 | struct GNUNET_TIME_Absolute |
271 | GNUNET_TIME_absolute_get (void); | 267 | GNUNET_TIME_absolute_get(void); |
272 | 268 | ||
273 | 269 | ||
274 | /** | 270 | /** |
@@ -279,7 +275,7 @@ GNUNET_TIME_absolute_get (void); | |||
279 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) | 275 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) |
280 | */ | 276 | */ |
281 | struct GNUNET_TIME_Absolute | 277 | struct GNUNET_TIME_Absolute |
282 | GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); | 278 | GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel); |
283 | 279 | ||
284 | 280 | ||
285 | /** | 281 | /** |
@@ -291,7 +287,7 @@ GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); | |||
291 | * it was just now rounded | 287 | * it was just now rounded |
292 | */ | 288 | */ |
293 | int | 289 | int |
294 | GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at); | 290 | GNUNET_TIME_round_abs(struct GNUNET_TIME_Absolute *at); |
295 | 291 | ||
296 | 292 | ||
297 | /** | 293 | /** |
@@ -303,7 +299,7 @@ GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at); | |||
303 | * it was just now rounded | 299 | * it was just now rounded |
304 | */ | 300 | */ |
305 | int | 301 | int |
306 | GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt); | 302 | GNUNET_TIME_round_rel(struct GNUNET_TIME_Relative *rt); |
307 | 303 | ||
308 | 304 | ||
309 | /** | 305 | /** |
@@ -314,8 +310,8 @@ GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt); | |||
314 | * @return timestamp that is smaller | 310 | * @return timestamp that is smaller |
315 | */ | 311 | */ |
316 | struct GNUNET_TIME_Relative | 312 | struct GNUNET_TIME_Relative |
317 | GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, | 313 | GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, |
318 | struct GNUNET_TIME_Relative t2); | 314 | struct GNUNET_TIME_Relative t2); |
319 | 315 | ||
320 | 316 | ||
321 | 317 | ||
@@ -327,8 +323,8 @@ GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, | |||
327 | * @return timestamp that is larger | 323 | * @return timestamp that is larger |
328 | */ | 324 | */ |
329 | struct GNUNET_TIME_Relative | 325 | struct GNUNET_TIME_Relative |
330 | GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, | 326 | GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1, |
331 | struct GNUNET_TIME_Relative t2); | 327 | struct GNUNET_TIME_Relative t2); |
332 | 328 | ||
333 | 329 | ||
334 | /** | 330 | /** |
@@ -339,8 +335,8 @@ GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, | |||
339 | * @return timestamp that is smaller | 335 | * @return timestamp that is smaller |
340 | */ | 336 | */ |
341 | struct GNUNET_TIME_Absolute | 337 | struct GNUNET_TIME_Absolute |
342 | GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, | 338 | GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1, |
343 | struct GNUNET_TIME_Absolute t2); | 339 | struct GNUNET_TIME_Absolute t2); |
344 | 340 | ||
345 | 341 | ||
346 | /** | 342 | /** |
@@ -351,8 +347,8 @@ GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, | |||
351 | * @return timestamp that is smaller | 347 | * @return timestamp that is smaller |
352 | */ | 348 | */ |
353 | struct GNUNET_TIME_Absolute | 349 | struct GNUNET_TIME_Absolute |
354 | GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, | 350 | GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1, |
355 | struct GNUNET_TIME_Absolute t2); | 351 | struct GNUNET_TIME_Absolute t2); |
356 | 352 | ||
357 | 353 | ||
358 | /** | 354 | /** |
@@ -363,7 +359,7 @@ GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, | |||
363 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. | 359 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. |
364 | */ | 360 | */ |
365 | struct GNUNET_TIME_Relative | 361 | struct GNUNET_TIME_Relative |
366 | GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); | 362 | GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future); |
367 | 363 | ||
368 | 364 | ||
369 | /** | 365 | /** |
@@ -377,9 +373,9 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); | |||
377 | * assuming it continues at the same speed | 373 | * assuming it continues at the same speed |
378 | */ | 374 | */ |
379 | struct GNUNET_TIME_Relative | 375 | struct GNUNET_TIME_Relative |
380 | GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, | 376 | GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start, |
381 | uint64_t finished, | 377 | uint64_t finished, |
382 | uint64_t total); | 378 | uint64_t total); |
383 | 379 | ||
384 | 380 | ||
385 | /** | 381 | /** |
@@ -392,8 +388,8 @@ GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, | |||
392 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start | 388 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start |
393 | */ | 389 | */ |
394 | struct GNUNET_TIME_Relative | 390 | struct GNUNET_TIME_Relative |
395 | GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, | 391 | GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, |
396 | struct GNUNET_TIME_Absolute end); | 392 | struct GNUNET_TIME_Absolute end); |
397 | 393 | ||
398 | 394 | ||
399 | /** | 395 | /** |
@@ -404,7 +400,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, | |||
404 | * @return 0 if hence > now, otherwise now-hence. | 400 | * @return 0 if hence > now, otherwise now-hence. |
405 | */ | 401 | */ |
406 | struct GNUNET_TIME_Relative | 402 | struct GNUNET_TIME_Relative |
407 | GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); | 403 | GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence); |
408 | 404 | ||
409 | 405 | ||
410 | /** | 406 | /** |
@@ -416,8 +412,8 @@ GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); | |||
416 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise | 412 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise |
417 | */ | 413 | */ |
418 | struct GNUNET_TIME_Absolute | 414 | struct GNUNET_TIME_Absolute |
419 | GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, | 415 | GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, |
420 | struct GNUNET_TIME_Relative duration); | 416 | struct GNUNET_TIME_Relative duration); |
421 | 417 | ||
422 | 418 | ||
423 | /** | 419 | /** |
@@ -429,8 +425,8 @@ GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, | |||
429 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise | 425 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise |
430 | */ | 426 | */ |
431 | struct GNUNET_TIME_Absolute | 427 | struct GNUNET_TIME_Absolute |
432 | GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, | 428 | GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start, |
433 | struct GNUNET_TIME_Relative duration); | 429 | struct GNUNET_TIME_Relative duration); |
434 | 430 | ||
435 | 431 | ||
436 | /** | 432 | /** |
@@ -441,8 +437,8 @@ GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, | |||
441 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor | 437 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor |
442 | */ | 438 | */ |
443 | struct GNUNET_TIME_Relative | 439 | struct GNUNET_TIME_Relative |
444 | GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, | 440 | GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, |
445 | unsigned long long factor); | 441 | unsigned long long factor); |
446 | 442 | ||
447 | 443 | ||
448 | /** | 444 | /** |
@@ -453,8 +449,8 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, | |||
453 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor | 449 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor |
454 | */ | 450 | */ |
455 | struct GNUNET_TIME_Relative | 451 | struct GNUNET_TIME_Relative |
456 | GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel, | 452 | GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel, |
457 | unsigned long long factor); | 453 | unsigned long long factor); |
458 | 454 | ||
459 | 455 | ||
460 | /** | 456 | /** |
@@ -465,8 +461,8 @@ GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel, | |||
465 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor | 461 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor |
466 | */ | 462 | */ |
467 | struct GNUNET_TIME_Relative | 463 | struct GNUNET_TIME_Relative |
468 | GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, | 464 | GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, |
469 | unsigned long long factor); | 465 | unsigned long long factor); |
470 | 466 | ||
471 | 467 | ||
472 | /** | 468 | /** |
@@ -477,8 +473,8 @@ GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, | |||
477 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise | 473 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise |
478 | */ | 474 | */ |
479 | struct GNUNET_TIME_Relative | 475 | struct GNUNET_TIME_Relative |
480 | GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, | 476 | GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, |
481 | struct GNUNET_TIME_Relative a2); | 477 | struct GNUNET_TIME_Relative a2); |
482 | 478 | ||
483 | 479 | ||
484 | /** | 480 | /** |
@@ -489,8 +485,8 @@ GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, | |||
489 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise | 485 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise |
490 | */ | 486 | */ |
491 | struct GNUNET_TIME_Relative | 487 | struct GNUNET_TIME_Relative |
492 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, | 488 | GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, |
493 | struct GNUNET_TIME_Relative a2); | 489 | struct GNUNET_TIME_Relative a2); |
494 | 490 | ||
495 | 491 | ||
496 | /** | 492 | /** |
@@ -500,7 +496,7 @@ GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, | |||
500 | * @return converted time value | 496 | * @return converted time value |
501 | */ | 497 | */ |
502 | struct GNUNET_TIME_RelativeNBO | 498 | struct GNUNET_TIME_RelativeNBO |
503 | GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); | 499 | GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a); |
504 | 500 | ||
505 | 501 | ||
506 | /** | 502 | /** |
@@ -510,7 +506,7 @@ GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); | |||
510 | * @return converted time value | 506 | * @return converted time value |
511 | */ | 507 | */ |
512 | struct GNUNET_TIME_Relative | 508 | struct GNUNET_TIME_Relative |
513 | GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); | 509 | GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a); |
514 | 510 | ||
515 | 511 | ||
516 | /** | 512 | /** |
@@ -520,7 +516,7 @@ GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); | |||
520 | * @return converted time value | 516 | * @return converted time value |
521 | */ | 517 | */ |
522 | struct GNUNET_TIME_AbsoluteNBO | 518 | struct GNUNET_TIME_AbsoluteNBO |
523 | GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); | 519 | GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a); |
524 | 520 | ||
525 | 521 | ||
526 | /** | 522 | /** |
@@ -530,7 +526,7 @@ GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); | |||
530 | * @return converted time value | 526 | * @return converted time value |
531 | */ | 527 | */ |
532 | struct GNUNET_TIME_Absolute | 528 | struct GNUNET_TIME_Absolute |
533 | GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); | 529 | GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a); |
534 | 530 | ||
535 | 531 | ||
536 | /** | 532 | /** |
@@ -539,7 +535,7 @@ GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); | |||
539 | * @param offset the offset to skew the locale time by | 535 | * @param offset the offset to skew the locale time by |
540 | */ | 536 | */ |
541 | void | 537 | void |
542 | GNUNET_TIME_set_offset (long long offset); | 538 | GNUNET_TIME_set_offset(long long offset); |
543 | 539 | ||
544 | 540 | ||
545 | /** | 541 | /** |
@@ -548,14 +544,14 @@ GNUNET_TIME_set_offset (long long offset); | |||
548 | * @return the offset we currently skew the locale time by | 544 | * @return the offset we currently skew the locale time by |
549 | */ | 545 | */ |
550 | long long | 546 | long long |
551 | GNUNET_TIME_get_offset (void); | 547 | GNUNET_TIME_get_offset(void); |
552 | 548 | ||
553 | 549 | ||
554 | /** | 550 | /** |
555 | * Return the current year (i.e. '2011'). | 551 | * Return the current year (i.e. '2011'). |
556 | */ | 552 | */ |
557 | unsigned int | 553 | unsigned int |
558 | GNUNET_TIME_get_current_year (void); | 554 | GNUNET_TIME_get_current_year(void); |
559 | 555 | ||
560 | 556 | ||
561 | /** | 557 | /** |
@@ -565,7 +561,7 @@ GNUNET_TIME_get_current_year (void); | |||
565 | * @return absolute time for January 1st of that year. | 561 | * @return absolute time for January 1st of that year. |
566 | */ | 562 | */ |
567 | struct GNUNET_TIME_Absolute | 563 | struct GNUNET_TIME_Absolute |
568 | GNUNET_TIME_year_to_time (unsigned int year); | 564 | GNUNET_TIME_year_to_time(unsigned int year); |
569 | 565 | ||
570 | 566 | ||
571 | /** | 567 | /** |
@@ -575,7 +571,7 @@ GNUNET_TIME_year_to_time (unsigned int year); | |||
575 | * @return year a year (after 1970), 0 on error | 571 | * @return year a year (after 1970), 0 on error |
576 | */ | 572 | */ |
577 | unsigned int | 573 | unsigned int |
578 | GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at); | 574 | GNUNET_TIME_time_to_year(struct GNUNET_TIME_Absolute at); |
579 | 575 | ||
580 | 576 | ||
581 | /** | 577 | /** |
@@ -603,7 +599,7 @@ struct GNUNET_CONFIGURATION_Handle; | |||
603 | * @return monotonically increasing time | 599 | * @return monotonically increasing time |
604 | */ | 600 | */ |
605 | struct GNUNET_TIME_Absolute | 601 | struct GNUNET_TIME_Absolute |
606 | GNUNET_TIME_absolute_get_monotonic (const struct GNUNET_CONFIGURATION_Handle *cfg); | 602 | GNUNET_TIME_absolute_get_monotonic(const struct GNUNET_CONFIGURATION_Handle *cfg); |
607 | 603 | ||
608 | 604 | ||
609 | #if 0 /* keep Emacsens' auto-indent happy */ | 605 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_transport_application_service.h b/src/include/gnunet_transport_application_service.h index c12bd7441..2219cf7a7 100644 --- a/src/include/gnunet_transport_application_service.h +++ b/src/include/gnunet_transport_application_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2015, 2018, 2019 GNUnet e.V. | 3 | Copyright (C) 2010-2015, 2018, 2019 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -50,7 +50,7 @@ struct GNUNET_TRANSPORT_ApplicationHandle; | |||
50 | * @return ats application handle, NULL on error | 50 | * @return ats application handle, NULL on error |
51 | */ | 51 | */ |
52 | struct GNUNET_TRANSPORT_ApplicationHandle * | 52 | struct GNUNET_TRANSPORT_ApplicationHandle * |
53 | GNUNET_TRANSPORT_application_init ( | 53 | GNUNET_TRANSPORT_application_init( |
54 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 54 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
55 | 55 | ||
56 | 56 | ||
@@ -60,7 +60,7 @@ GNUNET_TRANSPORT_application_init ( | |||
60 | * @param ch handle to destroy | 60 | * @param ch handle to destroy |
61 | */ | 61 | */ |
62 | void | 62 | void |
63 | GNUNET_TRANSPORT_application_done ( | 63 | GNUNET_TRANSPORT_application_done( |
64 | struct GNUNET_TRANSPORT_ApplicationHandle *ch); | 64 | struct GNUNET_TRANSPORT_ApplicationHandle *ch); |
65 | 65 | ||
66 | 66 | ||
@@ -75,7 +75,7 @@ GNUNET_TRANSPORT_application_done ( | |||
75 | * @return suggest handle, NULL if a request is already pending | 75 | * @return suggest handle, NULL if a request is already pending |
76 | */ | 76 | */ |
77 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle * | 77 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle * |
78 | GNUNET_TRANSPORT_application_suggest ( | 78 | GNUNET_TRANSPORT_application_suggest( |
79 | struct GNUNET_TRANSPORT_ApplicationHandle *ch, | 79 | struct GNUNET_TRANSPORT_ApplicationHandle *ch, |
80 | const struct GNUNET_PeerIdentity *peer, | 80 | const struct GNUNET_PeerIdentity *peer, |
81 | enum GNUNET_MQ_PriorityPreferences pk, | 81 | enum GNUNET_MQ_PriorityPreferences pk, |
@@ -88,7 +88,7 @@ GNUNET_TRANSPORT_application_suggest ( | |||
88 | * @param sh handle to stop | 88 | * @param sh handle to stop |
89 | */ | 89 | */ |
90 | void | 90 | void |
91 | GNUNET_TRANSPORT_application_suggest_cancel ( | 91 | GNUNET_TRANSPORT_application_suggest_cancel( |
92 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh); | 92 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh); |
93 | 93 | ||
94 | 94 | ||
@@ -108,7 +108,7 @@ GNUNET_TRANSPORT_application_suggest_cancel ( | |||
108 | * @param addr address to validate | 108 | * @param addr address to validate |
109 | */ | 109 | */ |
110 | void | 110 | void |
111 | GNUNET_TRANSPORT_application_validate ( | 111 | GNUNET_TRANSPORT_application_validate( |
112 | struct GNUNET_TRANSPORT_ApplicationHandle *ch, | 112 | struct GNUNET_TRANSPORT_ApplicationHandle *ch, |
113 | const struct GNUNET_PeerIdentity *peer, | 113 | const struct GNUNET_PeerIdentity *peer, |
114 | enum GNUNET_NetworkType nt, | 114 | enum GNUNET_NetworkType nt, |
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h index ea1ff732e..e7c8be0c6 100644 --- a/src/include/gnunet_transport_communication_service.h +++ b/src/include/gnunet_transport_communication_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -87,9 +87,7 @@ struct GNUNET_TRANSPORT_CommunicatorHandle; | |||
87 | * FIXME: may want to distinguish bi-directional as well, | 87 | * FIXME: may want to distinguish bi-directional as well, |
88 | * should we define a bit for that? Needed in DV logic (handle_dv_learn)! | 88 | * should we define a bit for that? Needed in DV logic (handle_dv_learn)! |
89 | */ | 89 | */ |
90 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics | 90 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics { |
91 | { | ||
92 | |||
93 | /** | 91 | /** |
94 | * Characteristics are unknown (i.e. DV). | 92 | * Characteristics are unknown (i.e. DV). |
95 | */ | 93 | */ |
@@ -104,7 +102,6 @@ enum GNUNET_TRANSPORT_CommunicatorCharacteristics | |||
104 | * Transmission is unreliable (i.e. UDP) | 102 | * Transmission is unreliable (i.e. UDP) |
105 | */ | 103 | */ |
106 | GNUNET_TRANSPORT_CC_UNRELIABLE = 2 | 104 | GNUNET_TRANSPORT_CC_UNRELIABLE = 2 |
107 | |||
108 | }; | 105 | }; |
109 | 106 | ||
110 | 107 | ||
@@ -146,7 +143,7 @@ typedef void (*GNUNET_TRANSPORT_CommunicatorNotify) ( | |||
146 | * @return NULL on error | 143 | * @return NULL on error |
147 | */ | 144 | */ |
148 | struct GNUNET_TRANSPORT_CommunicatorHandle * | 145 | struct GNUNET_TRANSPORT_CommunicatorHandle * |
149 | GNUNET_TRANSPORT_communicator_connect ( | 146 | GNUNET_TRANSPORT_communicator_connect( |
150 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 147 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
151 | const char *config_section_name, | 148 | const char *config_section_name, |
152 | const char *addr_prefix, | 149 | const char *addr_prefix, |
@@ -163,7 +160,7 @@ GNUNET_TRANSPORT_communicator_connect ( | |||
163 | * @param ch handle returned from connect | 160 | * @param ch handle returned from connect |
164 | */ | 161 | */ |
165 | void | 162 | void |
166 | GNUNET_TRANSPORT_communicator_disconnect ( | 163 | GNUNET_TRANSPORT_communicator_disconnect( |
167 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch); | 164 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch); |
168 | 165 | ||
169 | 166 | ||
@@ -203,7 +200,7 @@ typedef void (*GNUNET_TRANSPORT_MessageCompletedCallback) (void *cls, | |||
203 | * the tranport service is not yet up | 200 | * the tranport service is not yet up |
204 | */ | 201 | */ |
205 | int | 202 | int |
206 | GNUNET_TRANSPORT_communicator_receive ( | 203 | GNUNET_TRANSPORT_communicator_receive( |
207 | struct GNUNET_TRANSPORT_CommunicatorHandle *handle, | 204 | struct GNUNET_TRANSPORT_CommunicatorHandle *handle, |
208 | const struct GNUNET_PeerIdentity *sender, | 205 | const struct GNUNET_PeerIdentity *sender, |
209 | const struct GNUNET_MessageHeader *msg, | 206 | const struct GNUNET_MessageHeader *msg, |
@@ -224,9 +221,7 @@ struct GNUNET_TRANSPORT_QueueHandle; | |||
224 | /** | 221 | /** |
225 | * Possible states of a connection. | 222 | * Possible states of a connection. |
226 | */ | 223 | */ |
227 | enum GNUNET_TRANSPORT_ConnectionStatus | 224 | enum GNUNET_TRANSPORT_ConnectionStatus { |
228 | { | ||
229 | |||
230 | /** | 225 | /** |
231 | * Connection is down. | 226 | * Connection is down. |
232 | */ | 227 | */ |
@@ -260,7 +255,7 @@ enum GNUNET_TRANSPORT_ConnectionStatus | |||
260 | * @return API handle identifying the new MQ | 255 | * @return API handle identifying the new MQ |
261 | */ | 256 | */ |
262 | struct GNUNET_TRANSPORT_QueueHandle * | 257 | struct GNUNET_TRANSPORT_QueueHandle * |
263 | GNUNET_TRANSPORT_communicator_mq_add ( | 258 | GNUNET_TRANSPORT_communicator_mq_add( |
264 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, | 259 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, |
265 | const struct GNUNET_PeerIdentity *peer, | 260 | const struct GNUNET_PeerIdentity *peer, |
266 | const char *address, | 261 | const char *address, |
@@ -277,7 +272,7 @@ GNUNET_TRANSPORT_communicator_mq_add ( | |||
277 | * @param qh handle for the queue that must be invalidated | 272 | * @param qh handle for the queue that must be invalidated |
278 | */ | 273 | */ |
279 | void | 274 | void |
280 | GNUNET_TRANSPORT_communicator_mq_del (struct GNUNET_TRANSPORT_QueueHandle *qh); | 275 | GNUNET_TRANSPORT_communicator_mq_del(struct GNUNET_TRANSPORT_QueueHandle *qh); |
281 | 276 | ||
282 | 277 | ||
283 | /** | 278 | /** |
@@ -297,7 +292,7 @@ struct GNUNET_TRANSPORT_AddressIdentifier; | |||
297 | * @param expiration when does the communicator forsee this address expiring? | 292 | * @param expiration when does the communicator forsee this address expiring? |
298 | */ | 293 | */ |
299 | struct GNUNET_TRANSPORT_AddressIdentifier * | 294 | struct GNUNET_TRANSPORT_AddressIdentifier * |
300 | GNUNET_TRANSPORT_communicator_address_add ( | 295 | GNUNET_TRANSPORT_communicator_address_add( |
301 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, | 296 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, |
302 | const char *address, | 297 | const char *address, |
303 | enum GNUNET_NetworkType nt, | 298 | enum GNUNET_NetworkType nt, |
@@ -311,7 +306,7 @@ GNUNET_TRANSPORT_communicator_address_add ( | |||
311 | * @param ai address that is no longer provided | 306 | * @param ai address that is no longer provided |
312 | */ | 307 | */ |
313 | void | 308 | void |
314 | GNUNET_TRANSPORT_communicator_address_remove ( | 309 | GNUNET_TRANSPORT_communicator_address_remove( |
315 | struct GNUNET_TRANSPORT_AddressIdentifier *ai); | 310 | struct GNUNET_TRANSPORT_AddressIdentifier *ai); |
316 | 311 | ||
317 | 312 | ||
@@ -334,7 +329,7 @@ GNUNET_TRANSPORT_communicator_address_remove ( | |||
334 | * notify-API to @a pid's communicator @a comm | 329 | * notify-API to @a pid's communicator @a comm |
335 | */ | 330 | */ |
336 | void | 331 | void |
337 | GNUNET_TRANSPORT_communicator_notify ( | 332 | GNUNET_TRANSPORT_communicator_notify( |
338 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, | 333 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch, |
339 | const struct GNUNET_PeerIdentity *pid, | 334 | const struct GNUNET_PeerIdentity *pid, |
340 | const char *comm, | 335 | const char *comm, |
diff --git a/src/include/gnunet_transport_core_service.h b/src/include/gnunet_transport_core_service.h index 076514779..e9ae4a2b4 100644 --- a/src/include/gnunet_transport_core_service.h +++ b/src/include/gnunet_transport_core_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -107,12 +107,12 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) ( | |||
107 | * @return NULL on error | 107 | * @return NULL on error |
108 | */ | 108 | */ |
109 | struct GNUNET_TRANSPORT_CoreHandle * | 109 | struct GNUNET_TRANSPORT_CoreHandle * |
110 | GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 110 | GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
111 | const struct GNUNET_PeerIdentity *self, | 111 | const struct GNUNET_PeerIdentity *self, |
112 | const struct GNUNET_MQ_MessageHandler *handlers, | 112 | const struct GNUNET_MQ_MessageHandler *handlers, |
113 | void *cls, | 113 | void *cls, |
114 | GNUNET_TRANSPORT_NotifyConnect nc, | 114 | GNUNET_TRANSPORT_NotifyConnect nc, |
115 | GNUNET_TRANSPORT_NotifyDisconnect nd); | 115 | GNUNET_TRANSPORT_NotifyDisconnect nd); |
116 | 116 | ||
117 | 117 | ||
118 | /** | 118 | /** |
@@ -121,7 +121,7 @@ GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
121 | * @param handle handle returned from connect | 121 | * @param handle handle returned from connect |
122 | */ | 122 | */ |
123 | void | 123 | void |
124 | GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle); | 124 | GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle); |
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
@@ -145,8 +145,8 @@ GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle); | |||
145 | * @param pid which peer was the message from that was fully processed by CORE | 145 | * @param pid which peer was the message from that was fully processed by CORE |
146 | */ | 146 | */ |
147 | void | 147 | void |
148 | GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch, | 148 | GNUNET_TRANSPORT_core_receive_continue(struct GNUNET_TRANSPORT_CoreHandle *ch, |
149 | const struct GNUNET_PeerIdentity *pid); | 149 | const struct GNUNET_PeerIdentity *pid); |
150 | 150 | ||
151 | 151 | ||
152 | /** | 152 | /** |
@@ -158,8 +158,8 @@ GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch, | |||
158 | * @return NULL if disconnected, otherwise message queue for @a peer | 158 | * @return NULL if disconnected, otherwise message queue for @a peer |
159 | */ | 159 | */ |
160 | struct GNUNET_MQ_Handle * | 160 | struct GNUNET_MQ_Handle * |
161 | GNUNET_TRANSPORT_core_get_mq (struct GNUNET_TRANSPORT_CoreHandle *handle, | 161 | GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, |
162 | const struct GNUNET_PeerIdentity *peer); | 162 | const struct GNUNET_PeerIdentity *peer); |
163 | 163 | ||
164 | 164 | ||
165 | #if 0 /* keep Emacsens' auto-indent happy */ | 165 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_transport_hello_service.h b/src/include/gnunet_transport_hello_service.h index fe863c058..512103c54 100644 --- a/src/include/gnunet_transport_hello_service.h +++ b/src/include/gnunet_transport_hello_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -58,9 +58,7 @@ extern "C" { | |||
58 | * classes to filter addresses by which domain they make | 58 | * classes to filter addresses by which domain they make |
59 | * sense to be used in. These are used in a bitmask. | 59 | * sense to be used in. These are used in a bitmask. |
60 | */ | 60 | */ |
61 | enum GNUNET_TRANSPORT_AddressClass | 61 | enum GNUNET_TRANSPORT_AddressClass { |
62 | { | ||
63 | |||
64 | /** | 62 | /** |
65 | * No address. | 63 | * No address. |
66 | */ | 64 | */ |
@@ -108,7 +106,6 @@ enum GNUNET_TRANSPORT_AddressClass | |||
108 | * Bitmask for "any" address. | 106 | * Bitmask for "any" address. |
109 | */ | 107 | */ |
110 | GNUNET_TRANSPORT_AC_ANY = 65535 | 108 | GNUNET_TRANSPORT_AC_ANY = 65535 |
111 | |||
112 | }; | 109 | }; |
113 | 110 | ||
114 | 111 | ||
@@ -141,10 +138,10 @@ struct GNUNET_TRANSPORT_HelloGetHandle; | |||
141 | * @return handle to cancel the operation | 138 | * @return handle to cancel the operation |
142 | */ | 139 | */ |
143 | struct GNUNET_TRANSPORT_HelloGetHandle * | 140 | struct GNUNET_TRANSPORT_HelloGetHandle * |
144 | GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg, | 141 | GNUNET_TRANSPORT_hello_get(const struct GNUNET_CONFIGURATION_Handle *cfg, |
145 | enum GNUNET_TRANSPORT_AddressClass ac, | 142 | enum GNUNET_TRANSPORT_AddressClass ac, |
146 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | 143 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
147 | void *rec_cls); | 144 | void *rec_cls); |
148 | 145 | ||
149 | 146 | ||
150 | /** | 147 | /** |
@@ -153,7 +150,7 @@ GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
153 | * @param ghh handle to cancel | 150 | * @param ghh handle to cancel |
154 | */ | 151 | */ |
155 | void | 152 | void |
156 | GNUNET_TRANSPORT_hello_get_cancel (struct GNUNET_TRANSPORT_HelloGetHandle *ghh); | 153 | GNUNET_TRANSPORT_hello_get_cancel(struct GNUNET_TRANSPORT_HelloGetHandle *ghh); |
157 | 154 | ||
158 | 155 | ||
159 | /** | 156 | /** |
@@ -183,9 +180,9 @@ typedef void (*GNUNET_TRANSPORT_AddressCallback) ( | |||
183 | * @return #GNUNET_OK if hello was well-formed, #GNUNET_SYSERR if not | 180 | * @return #GNUNET_OK if hello was well-formed, #GNUNET_SYSERR if not |
184 | */ | 181 | */ |
185 | int | 182 | int |
186 | GNUNET_TRANSPORT_hello_parse (const struct GNUNET_MessageHeader *hello, | 183 | GNUNET_TRANSPORT_hello_parse(const struct GNUNET_MessageHeader *hello, |
187 | GNUNET_TRANSPORT_AddressCallback cb, | 184 | GNUNET_TRANSPORT_AddressCallback cb, |
188 | void *cb_cls); | 185 | void *cb_cls); |
189 | 186 | ||
190 | 187 | ||
191 | #if 0 /* keep Emacsens' auto-indent happy */ | 188 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_transport_manipulation_service.h b/src/include/gnunet_transport_manipulation_service.h index 5b37345b0..3149d1dd5 100644 --- a/src/include/gnunet_transport_manipulation_service.h +++ b/src/include/gnunet_transport_manipulation_service.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -66,7 +66,7 @@ struct GNUNET_TRANSPORT_ManipulationHandle; | |||
66 | * @return NULL on error | 66 | * @return NULL on error |
67 | */ | 67 | */ |
68 | struct GNUNET_TRANSPORT_ManipulationHandle * | 68 | struct GNUNET_TRANSPORT_ManipulationHandle * |
69 | GNUNET_TRANSPORT_manipulation_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 69 | GNUNET_TRANSPORT_manipulation_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
70 | 70 | ||
71 | 71 | ||
72 | /** | 72 | /** |
@@ -75,7 +75,7 @@ GNUNET_TRANSPORT_manipulation_connect (const struct GNUNET_CONFIGURATION_Handle | |||
75 | * @param handle handle returned from connect | 75 | * @param handle handle returned from connect |
76 | */ | 76 | */ |
77 | void | 77 | void |
78 | GNUNET_TRANSPORT_manipulation_disconnect (struct GNUNET_TRANSPORT_ManipulationHandle *handle); | 78 | GNUNET_TRANSPORT_manipulation_disconnect(struct GNUNET_TRANSPORT_ManipulationHandle *handle); |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -91,11 +91,11 @@ GNUNET_TRANSPORT_manipulation_disconnect (struct GNUNET_TRANSPORT_ManipulationHa | |||
91 | * with one message delay. | 91 | * with one message delay. |
92 | */ | 92 | */ |
93 | void | 93 | void |
94 | GNUNET_TRANSPORT_manipulation_set (struct GNUNET_TRANSPORT_ManipulationHandle *handle, | 94 | GNUNET_TRANSPORT_manipulation_set(struct GNUNET_TRANSPORT_ManipulationHandle *handle, |
95 | const struct GNUNET_PeerIdentity *peer, | 95 | const struct GNUNET_PeerIdentity *peer, |
96 | const struct GNUNET_ATS_Properties *prop, | 96 | const struct GNUNET_ATS_Properties *prop, |
97 | struct GNUNET_TIME_Relative delay_in, | 97 | struct GNUNET_TIME_Relative delay_in, |
98 | struct GNUNET_TIME_Relative delay_out); | 98 | struct GNUNET_TIME_Relative delay_out); |
99 | 99 | ||
100 | 100 | ||
101 | #if 0 /* keep Emacsens' auto-indent happy */ | 101 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_transport_monitor_service.h b/src/include/gnunet_transport_monitor_service.h index f83fa7e9f..a67fca778 100644 --- a/src/include/gnunet_transport_monitor_service.h +++ b/src/include/gnunet_transport_monitor_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -56,9 +56,7 @@ extern "C" | |||
56 | /** | 56 | /** |
57 | * Information about another peer's address. | 57 | * Information about another peer's address. |
58 | */ | 58 | */ |
59 | struct GNUNET_TRANSPORT_MonitorInformation | 59 | struct GNUNET_TRANSPORT_MonitorInformation { |
60 | { | ||
61 | |||
62 | /** | 60 | /** |
63 | * Address we have for the peer, human-readable, 0-terminated, in UTF-8. | 61 | * Address we have for the peer, human-readable, 0-terminated, in UTF-8. |
64 | */ | 62 | */ |
@@ -103,7 +101,6 @@ struct GNUNET_TRANSPORT_MonitorInformation | |||
103 | * Current estimate of the RTT. | 101 | * Current estimate of the RTT. |
104 | */ | 102 | */ |
105 | struct GNUNET_TIME_Relative rtt; | 103 | struct GNUNET_TIME_Relative rtt; |
106 | |||
107 | }; | 104 | }; |
108 | 105 | ||
109 | 106 | ||
@@ -162,11 +159,11 @@ struct GNUNET_TRANSPORT_MonitorContext; | |||
162 | * @param cb_cls closure for @a mc | 159 | * @param cb_cls closure for @a mc |
163 | */ | 160 | */ |
164 | struct GNUNET_TRANSPORT_MonitorContext * | 161 | struct GNUNET_TRANSPORT_MonitorContext * |
165 | GNUNET_TRANSPORT_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg, | 162 | GNUNET_TRANSPORT_monitor(const struct GNUNET_CONFIGURATION_Handle *cfg, |
166 | const struct GNUNET_PeerIdentity *peer, | 163 | const struct GNUNET_PeerIdentity *peer, |
167 | int one_shot, | 164 | int one_shot, |
168 | GNUNET_TRANSPORT_MonitorCallback cb, | 165 | GNUNET_TRANSPORT_MonitorCallback cb, |
169 | void *cb_cls); | 166 | void *cb_cls); |
170 | 167 | ||
171 | 168 | ||
172 | /** | 169 | /** |
@@ -175,7 +172,7 @@ GNUNET_TRANSPORT_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
175 | * @param mc handle for the request to cancel | 172 | * @param mc handle for the request to cancel |
176 | */ | 173 | */ |
177 | void | 174 | void |
178 | GNUNET_TRANSPORT_monitor_cancel (struct GNUNET_TRANSPORT_MonitorContext *mc); | 175 | GNUNET_TRANSPORT_monitor_cancel(struct GNUNET_TRANSPORT_MonitorContext *mc); |
179 | 176 | ||
180 | 177 | ||
181 | #if 0 /* keep Emacsens' auto-indent happy */ | 178 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index ed5244987..12ecb88f2 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -134,9 +134,9 @@ typedef struct GNUNET_TIME_Relative | |||
134 | * @return type of the network the address belongs to | 134 | * @return type of the network the address belongs to |
135 | */ | 135 | */ |
136 | typedef enum GNUNET_NetworkType | 136 | typedef enum GNUNET_NetworkType |
137 | (*GNUNET_TRANSPORT_AddressToType) (void *cls, | 137 | (*GNUNET_TRANSPORT_AddressToType)(void *cls, |
138 | const struct sockaddr *addr, | 138 | const struct sockaddr *addr, |
139 | size_t addrlen); | 139 | size_t addrlen); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -203,8 +203,7 @@ typedef const struct GNUNET_MessageHeader * | |||
203 | * of this type as the first and only argument to the | 203 | * of this type as the first and only argument to the |
204 | * entry point of each transport plugin. | 204 | * entry point of each transport plugin. |
205 | */ | 205 | */ |
206 | struct GNUNET_TRANSPORT_PluginEnvironment | 206 | struct GNUNET_TRANSPORT_PluginEnvironment { |
207 | { | ||
208 | /** | 207 | /** |
209 | * Configuration to use. | 208 | * Configuration to use. |
210 | */ | 209 | */ |
@@ -277,7 +276,6 @@ struct GNUNET_TRANSPORT_PluginEnvironment | |||
277 | * UDP) can ignore this value. | 276 | * UDP) can ignore this value. |
278 | */ | 277 | */ |
279 | uint32_t max_connections; | 278 | uint32_t max_connections; |
280 | |||
281 | }; | 279 | }; |
282 | 280 | ||
283 | 281 | ||
@@ -550,8 +548,8 @@ typedef int | |||
550 | * @return the network type | 548 | * @return the network type |
551 | */ | 549 | */ |
552 | typedef enum GNUNET_NetworkType | 550 | typedef enum GNUNET_NetworkType |
553 | (*GNUNET_TRANSPORT_GetNetworkType) (void *cls, | 551 | (*GNUNET_TRANSPORT_GetNetworkType)(void *cls, |
554 | struct GNUNET_ATS_Session *session); | 552 | struct GNUNET_ATS_Session *session); |
555 | 553 | ||
556 | 554 | ||
557 | /** | 555 | /** |
@@ -562,8 +560,8 @@ typedef enum GNUNET_NetworkType | |||
562 | * @return the network type | 560 | * @return the network type |
563 | */ | 561 | */ |
564 | typedef enum GNUNET_NetworkType | 562 | typedef enum GNUNET_NetworkType |
565 | (*GNUNET_TRANSPORT_GetNetworkTypeForAddress) (void *cls, | 563 | (*GNUNET_TRANSPORT_GetNetworkTypeForAddress)(void *cls, |
566 | const struct GNUNET_HELLO_Address *address); | 564 | const struct GNUNET_HELLO_Address *address); |
567 | 565 | ||
568 | 566 | ||
569 | /** | 567 | /** |
@@ -606,9 +604,7 @@ typedef void | |||
606 | * Each plugin is required to return a pointer to a struct of this | 604 | * Each plugin is required to return a pointer to a struct of this |
607 | * type as the return value from its entry point. | 605 | * type as the return value from its entry point. |
608 | */ | 606 | */ |
609 | struct GNUNET_TRANSPORT_PluginFunctions | 607 | struct GNUNET_TRANSPORT_PluginFunctions { |
610 | { | ||
611 | |||
612 | /** | 608 | /** |
613 | * Closure for all of the callbacks. | 609 | * Closure for all of the callbacks. |
614 | */ | 610 | */ |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 80949b417..735e216e8 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -75,10 +75,10 @@ struct GNUNET_TRANSPORT_OfferHelloHandle; | |||
75 | * | 75 | * |
76 | */ | 76 | */ |
77 | struct GNUNET_TRANSPORT_OfferHelloHandle * | 77 | struct GNUNET_TRANSPORT_OfferHelloHandle * |
78 | GNUNET_TRANSPORT_offer_hello (const struct GNUNET_CONFIGURATION_Handle *cfg, | 78 | GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg, |
79 | const struct GNUNET_MessageHeader *hello, | 79 | const struct GNUNET_MessageHeader *hello, |
80 | GNUNET_SCHEDULER_TaskCallback cont, | 80 | GNUNET_SCHEDULER_TaskCallback cont, |
81 | void *cont_cls); | 81 | void *cont_cls); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
@@ -87,7 +87,7 @@ GNUNET_TRANSPORT_offer_hello (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
87 | * @param ohh the `struct GNUNET_TRANSPORT_OfferHelloHandle` to cancel | 87 | * @param ohh the `struct GNUNET_TRANSPORT_OfferHelloHandle` to cancel |
88 | */ | 88 | */ |
89 | void | 89 | void |
90 | GNUNET_TRANSPORT_offer_hello_cancel ( | 90 | GNUNET_TRANSPORT_offer_hello_cancel( |
91 | struct GNUNET_TRANSPORT_OfferHelloHandle *ohh); | 91 | struct GNUNET_TRANSPORT_OfferHelloHandle *ohh); |
92 | 92 | ||
93 | 93 | ||
@@ -133,7 +133,7 @@ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, | |||
133 | * @return handle to cancel the operation, NULL on error | 133 | * @return handle to cancel the operation, NULL on error |
134 | */ | 134 | */ |
135 | struct GNUNET_TRANSPORT_AddressToStringContext * | 135 | struct GNUNET_TRANSPORT_AddressToStringContext * |
136 | GNUNET_TRANSPORT_address_to_string ( | 136 | GNUNET_TRANSPORT_address_to_string( |
137 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 137 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
138 | const struct GNUNET_HELLO_Address *address, | 138 | const struct GNUNET_HELLO_Address *address, |
139 | int numeric, | 139 | int numeric, |
@@ -148,7 +148,7 @@ GNUNET_TRANSPORT_address_to_string ( | |||
148 | * @param alc the context handle | 148 | * @param alc the context handle |
149 | */ | 149 | */ |
150 | void | 150 | void |
151 | GNUNET_TRANSPORT_address_to_string_cancel ( | 151 | GNUNET_TRANSPORT_address_to_string_cancel( |
152 | struct GNUNET_TRANSPORT_AddressToStringContext *alc); | 152 | struct GNUNET_TRANSPORT_AddressToStringContext *alc); |
153 | 153 | ||
154 | 154 | ||
@@ -211,8 +211,7 @@ GNUNET_TRANSPORT_address_to_string_cancel ( | |||
211 | * to 0). | 211 | * to 0). |
212 | * | 212 | * |
213 | */ | 213 | */ |
214 | enum GNUNET_TRANSPORT_PeerState | 214 | enum GNUNET_TRANSPORT_PeerState { |
215 | { | ||
216 | /** | 215 | /** |
217 | * Fresh peer or completely disconnected | 216 | * Fresh peer or completely disconnected |
218 | */ | 217 | */ |
@@ -289,7 +288,7 @@ enum GNUNET_TRANSPORT_PeerState | |||
289 | * @param state the state | 288 | * @param state the state |
290 | */ | 289 | */ |
291 | const char * | 290 | const char * |
292 | GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state); | 291 | GNUNET_TRANSPORT_ps2s(enum GNUNET_TRANSPORT_PeerState state); |
293 | 292 | ||
294 | 293 | ||
295 | /** | 294 | /** |
@@ -299,7 +298,7 @@ GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state); | |||
299 | * @return #GNUNET_YES or #GNUNET_NO | 298 | * @return #GNUNET_YES or #GNUNET_NO |
300 | */ | 299 | */ |
301 | int | 300 | int |
302 | GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state); | 301 | GNUNET_TRANSPORT_is_connected(enum GNUNET_TRANSPORT_PeerState state); |
303 | 302 | ||
304 | 303 | ||
305 | /** | 304 | /** |
@@ -361,7 +360,7 @@ typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) ( | |||
361 | * @param peer_callback_cls closure for @a peer_callback | 360 | * @param peer_callback_cls closure for @a peer_callback |
362 | */ | 361 | */ |
363 | struct GNUNET_TRANSPORT_PeerMonitoringContext * | 362 | struct GNUNET_TRANSPORT_PeerMonitoringContext * |
364 | GNUNET_TRANSPORT_monitor_peers ( | 363 | GNUNET_TRANSPORT_monitor_peers( |
365 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 364 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
366 | const struct GNUNET_PeerIdentity *peer, | 365 | const struct GNUNET_PeerIdentity *peer, |
367 | int one_shot, | 366 | int one_shot, |
@@ -375,7 +374,7 @@ GNUNET_TRANSPORT_monitor_peers ( | |||
375 | * @param pic handle for the request to cancel | 374 | * @param pic handle for the request to cancel |
376 | */ | 375 | */ |
377 | void | 376 | void |
378 | GNUNET_TRANSPORT_monitor_peers_cancel ( | 377 | GNUNET_TRANSPORT_monitor_peers_cancel( |
379 | struct GNUNET_TRANSPORT_PeerMonitoringContext *pic); | 378 | struct GNUNET_TRANSPORT_PeerMonitoringContext *pic); |
380 | 379 | ||
381 | 380 | ||
@@ -414,9 +413,9 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) ( | |||
414 | * @return NULL on error, otherwise handle for cancellation | 413 | * @return NULL on error, otherwise handle for cancellation |
415 | */ | 414 | */ |
416 | struct GNUNET_TRANSPORT_Blacklist * | 415 | struct GNUNET_TRANSPORT_Blacklist * |
417 | GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, | 416 | GNUNET_TRANSPORT_blacklist(const struct GNUNET_CONFIGURATION_Handle *cfg, |
418 | GNUNET_TRANSPORT_BlacklistCallback cb, | 417 | GNUNET_TRANSPORT_BlacklistCallback cb, |
419 | void *cb_cls); | 418 | void *cb_cls); |
420 | 419 | ||
421 | 420 | ||
422 | /** | 421 | /** |
@@ -426,7 +425,7 @@ GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
426 | * @param br handle of the request that is to be cancelled | 425 | * @param br handle of the request that is to be cancelled |
427 | */ | 426 | */ |
428 | void | 427 | void |
429 | GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); | 428 | GNUNET_TRANSPORT_blacklist_cancel(struct GNUNET_TRANSPORT_Blacklist *br); |
430 | 429 | ||
431 | 430 | ||
432 | /** | 431 | /** |
@@ -444,9 +443,7 @@ struct GNUNET_TRANSPORT_PluginSession; | |||
444 | /** | 443 | /** |
445 | * Possible states of a session in a plugin. | 444 | * Possible states of a session in a plugin. |
446 | */ | 445 | */ |
447 | enum GNUNET_TRANSPORT_SessionState | 446 | enum GNUNET_TRANSPORT_SessionState { |
448 | { | ||
449 | |||
450 | /** | 447 | /** |
451 | * The session was created (first call for each session object). | 448 | * The session was created (first call for each session object). |
452 | */ | 449 | */ |
@@ -473,16 +470,13 @@ enum GNUNET_TRANSPORT_SessionState | |||
473 | * Last call for each session object. | 470 | * Last call for each session object. |
474 | */ | 471 | */ |
475 | GNUNET_TRANSPORT_SS_DONE | 472 | GNUNET_TRANSPORT_SS_DONE |
476 | |||
477 | }; | 473 | }; |
478 | 474 | ||
479 | 475 | ||
480 | /** | 476 | /** |
481 | * Information about a plugin's session. | 477 | * Information about a plugin's session. |
482 | */ | 478 | */ |
483 | struct GNUNET_TRANSPORT_SessionInfo | 479 | struct GNUNET_TRANSPORT_SessionInfo { |
484 | { | ||
485 | |||
486 | /** | 480 | /** |
487 | * New state of the session. | 481 | * New state of the session. |
488 | */ | 482 | */ |
@@ -561,9 +555,9 @@ typedef void (*GNUNET_TRANSPORT_SessionMonitorCallback) ( | |||
561 | * @return NULL on error, otherwise handle for cancellation | 555 | * @return NULL on error, otherwise handle for cancellation |
562 | */ | 556 | */ |
563 | struct GNUNET_TRANSPORT_PluginMonitor * | 557 | struct GNUNET_TRANSPORT_PluginMonitor * |
564 | GNUNET_TRANSPORT_monitor_plugins (const struct GNUNET_CONFIGURATION_Handle *cfg, | 558 | GNUNET_TRANSPORT_monitor_plugins(const struct GNUNET_CONFIGURATION_Handle *cfg, |
565 | GNUNET_TRANSPORT_SessionMonitorCallback cb, | 559 | GNUNET_TRANSPORT_SessionMonitorCallback cb, |
566 | void *cb_cls); | 560 | void *cb_cls); |
567 | 561 | ||
568 | 562 | ||
569 | /** | 563 | /** |
@@ -574,7 +568,7 @@ GNUNET_TRANSPORT_monitor_plugins (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
574 | * @param pm handle of the request that is to be cancelled | 568 | * @param pm handle of the request that is to be cancelled |
575 | */ | 569 | */ |
576 | void | 570 | void |
577 | GNUNET_TRANSPORT_monitor_plugins_cancel ( | 571 | GNUNET_TRANSPORT_monitor_plugins_cancel( |
578 | struct GNUNET_TRANSPORT_PluginMonitor *pm); | 572 | struct GNUNET_TRANSPORT_PluginMonitor *pm); |
579 | 573 | ||
580 | 574 | ||
@@ -659,13 +653,13 @@ typedef void (*GNUNET_TRANSPORT_NotifyExcessBandwidth) ( | |||
659 | * @return NULL on error | 653 | * @return NULL on error |
660 | */ | 654 | */ |
661 | struct GNUNET_TRANSPORT_CoreHandle * | 655 | struct GNUNET_TRANSPORT_CoreHandle * |
662 | GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 656 | GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, |
663 | const struct GNUNET_PeerIdentity *self, | 657 | const struct GNUNET_PeerIdentity *self, |
664 | const struct GNUNET_MQ_MessageHandler *handlers, | 658 | const struct GNUNET_MQ_MessageHandler *handlers, |
665 | void *cls, | 659 | void *cls, |
666 | GNUNET_TRANSPORT_NotifyConnect nc, | 660 | GNUNET_TRANSPORT_NotifyConnect nc, |
667 | GNUNET_TRANSPORT_NotifyDisconnect nd, | 661 | GNUNET_TRANSPORT_NotifyDisconnect nd, |
668 | GNUNET_TRANSPORT_NotifyExcessBandwidth neb); | 662 | GNUNET_TRANSPORT_NotifyExcessBandwidth neb); |
669 | 663 | ||
670 | 664 | ||
671 | /** | 665 | /** |
@@ -674,7 +668,7 @@ GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
674 | * @param handle handle returned from connect | 668 | * @param handle handle returned from connect |
675 | */ | 669 | */ |
676 | void | 670 | void |
677 | GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle); | 671 | GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle); |
678 | 672 | ||
679 | 673 | ||
680 | /** | 674 | /** |
@@ -685,8 +679,8 @@ GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle); | |||
685 | * @return NULL if disconnected, otherwise message queue for @a peer | 679 | * @return NULL if disconnected, otherwise message queue for @a peer |
686 | */ | 680 | */ |
687 | struct GNUNET_MQ_Handle * | 681 | struct GNUNET_MQ_Handle * |
688 | GNUNET_TRANSPORT_core_get_mq (struct GNUNET_TRANSPORT_CoreHandle *handle, | 682 | GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, |
689 | const struct GNUNET_PeerIdentity *peer); | 683 | const struct GNUNET_PeerIdentity *peer); |
690 | 684 | ||
691 | 685 | ||
692 | #if 0 /* keep Emacsens' auto-indent happy */ | 686 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index c01e641c1..941f394aa 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Philipp Toelke | 22 | * @author Philipp Toelke |
@@ -78,8 +78,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
78 | /** | 78 | /** |
79 | * Header from Linux TUN interface. | 79 | * Header from Linux TUN interface. |
80 | */ | 80 | */ |
81 | struct GNUNET_TUN_Layer2PacketHeader | 81 | struct GNUNET_TUN_Layer2PacketHeader { |
82 | { | ||
83 | /** | 82 | /** |
84 | * Some flags (unused). | 83 | * Some flags (unused). |
85 | */ | 84 | */ |
@@ -95,8 +94,7 @@ struct GNUNET_TUN_Layer2PacketHeader | |||
95 | /** | 94 | /** |
96 | * Standard IPv4 header. | 95 | * Standard IPv4 header. |
97 | */ | 96 | */ |
98 | struct GNUNET_TUN_IPv4Header | 97 | struct GNUNET_TUN_IPv4Header { |
99 | { | ||
100 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 98 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
101 | unsigned int header_length : 4 GNUNET_PACKED; | 99 | unsigned int header_length : 4 GNUNET_PACKED; |
102 | unsigned int version : 4 GNUNET_PACKED; | 100 | unsigned int version : 4 GNUNET_PACKED; |
@@ -152,8 +150,7 @@ struct GNUNET_TUN_IPv4Header | |||
152 | /** | 150 | /** |
153 | * Standard IPv6 header. | 151 | * Standard IPv6 header. |
154 | */ | 152 | */ |
155 | struct GNUNET_TUN_IPv6Header | 153 | struct GNUNET_TUN_IPv6Header { |
156 | { | ||
157 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 154 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
158 | unsigned int traffic_class_h : 4 GNUNET_PACKED; | 155 | unsigned int traffic_class_h : 4 GNUNET_PACKED; |
159 | unsigned int version : 4 GNUNET_PACKED; | 156 | unsigned int version : 4 GNUNET_PACKED; |
@@ -208,8 +205,7 @@ struct GNUNET_TUN_IPv6Header | |||
208 | /** | 205 | /** |
209 | * TCP packet header. | 206 | * TCP packet header. |
210 | */ | 207 | */ |
211 | struct GNUNET_TUN_TcpHeader | 208 | struct GNUNET_TUN_TcpHeader { |
212 | { | ||
213 | /** | 209 | /** |
214 | * Source port (in NBO). | 210 | * Source port (in NBO). |
215 | */ | 211 | */ |
@@ -276,8 +272,7 @@ struct GNUNET_TUN_TcpHeader | |||
276 | /** | 272 | /** |
277 | * UDP packet header. | 273 | * UDP packet header. |
278 | */ | 274 | */ |
279 | struct GNUNET_TUN_UdpHeader | 275 | struct GNUNET_TUN_UdpHeader { |
280 | { | ||
281 | /** | 276 | /** |
282 | * Source port (in NBO). | 277 | * Source port (in NBO). |
283 | */ | 278 | */ |
@@ -336,8 +331,7 @@ struct GNUNET_TUN_UdpHeader | |||
336 | /** | 331 | /** |
337 | * DNS flags (largely RFC 1035 / RFC 2136). | 332 | * DNS flags (largely RFC 1035 / RFC 2136). |
338 | */ | 333 | */ |
339 | struct GNUNET_TUN_DnsFlags | 334 | struct GNUNET_TUN_DnsFlags { |
340 | { | ||
341 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 335 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
342 | /** | 336 | /** |
343 | * Set to 1 if recursion is desired (client -> server) | 337 | * Set to 1 if recursion is desired (client -> server) |
@@ -389,7 +383,6 @@ struct GNUNET_TUN_DnsFlags | |||
389 | */ | 383 | */ |
390 | unsigned int recursion_available : 1 GNUNET_PACKED; | 384 | unsigned int recursion_available : 1 GNUNET_PACKED; |
391 | #elif __BYTE_ORDER == __BIG_ENDIAN | 385 | #elif __BYTE_ORDER == __BIG_ENDIAN |
392 | |||
393 | /** | 386 | /** |
394 | * query:0, response:1 | 387 | * query:0, response:1 |
395 | */ | 388 | */ |
@@ -443,15 +436,13 @@ struct GNUNET_TUN_DnsFlags | |||
443 | #else | 436 | #else |
444 | #error byteorder undefined | 437 | #error byteorder undefined |
445 | #endif | 438 | #endif |
446 | |||
447 | } GNUNET_GCC_STRUCT_LAYOUT; | 439 | } GNUNET_GCC_STRUCT_LAYOUT; |
448 | 440 | ||
449 | 441 | ||
450 | /** | 442 | /** |
451 | * DNS header. | 443 | * DNS header. |
452 | */ | 444 | */ |
453 | struct GNUNET_TUN_DnsHeader | 445 | struct GNUNET_TUN_DnsHeader { |
454 | { | ||
455 | /** | 446 | /** |
456 | * Unique identifier for the request/response. | 447 | * Unique identifier for the request/response. |
457 | */ | 448 | */ |
@@ -487,8 +478,7 @@ struct GNUNET_TUN_DnsHeader | |||
487 | /** | 478 | /** |
488 | * Payload of DNS SOA record (header). | 479 | * Payload of DNS SOA record (header). |
489 | */ | 480 | */ |
490 | struct GNUNET_TUN_DnsSoaRecord | 481 | struct GNUNET_TUN_DnsSoaRecord { |
491 | { | ||
492 | /** | 482 | /** |
493 | * The version number of the original copy of the zone. (NBO) | 483 | * The version number of the original copy of the zone. (NBO) |
494 | */ | 484 | */ |
@@ -522,9 +512,7 @@ struct GNUNET_TUN_DnsSoaRecord | |||
522 | /** | 512 | /** |
523 | * Payload of DNS SRV record (header). | 513 | * Payload of DNS SRV record (header). |
524 | */ | 514 | */ |
525 | struct GNUNET_TUN_DnsSrvRecord | 515 | struct GNUNET_TUN_DnsSrvRecord { |
526 | { | ||
527 | |||
528 | /** | 516 | /** |
529 | * Preference for this entry (lower value is higher preference). Clients | 517 | * Preference for this entry (lower value is higher preference). Clients |
530 | * will contact hosts from the lowest-priority group first and fall back | 518 | * will contact hosts from the lowest-priority group first and fall back |
@@ -551,9 +539,7 @@ struct GNUNET_TUN_DnsSrvRecord | |||
551 | /** | 539 | /** |
552 | * Payload of DNS CERT record. | 540 | * Payload of DNS CERT record. |
553 | */ | 541 | */ |
554 | struct GNUNET_TUN_DnsCertRecord | 542 | struct GNUNET_TUN_DnsCertRecord { |
555 | { | ||
556 | |||
557 | /** | 543 | /** |
558 | * Certificate type | 544 | * Certificate type |
559 | */ | 545 | */ |
@@ -577,9 +563,7 @@ struct GNUNET_TUN_DnsCertRecord | |||
577 | * Payload of DNSSEC TLSA record. | 563 | * Payload of DNSSEC TLSA record. |
578 | * http://datatracker.ietf.org/doc/draft-ietf-dane-protocol/ | 564 | * http://datatracker.ietf.org/doc/draft-ietf-dane-protocol/ |
579 | */ | 565 | */ |
580 | struct GNUNET_TUN_DnsTlsaRecord | 566 | struct GNUNET_TUN_DnsTlsaRecord { |
581 | { | ||
582 | |||
583 | /** | 567 | /** |
584 | * Certificate usage | 568 | * Certificate usage |
585 | * 0: CA cert | 569 | * 0: CA cert |
@@ -623,8 +607,7 @@ struct GNUNET_TUN_DnsTlsaRecord | |||
623 | /** | 607 | /** |
624 | * Payload of GNS VPN record | 608 | * Payload of GNS VPN record |
625 | */ | 609 | */ |
626 | struct GNUNET_TUN_GnsVpnRecord | 610 | struct GNUNET_TUN_GnsVpnRecord { |
627 | { | ||
628 | /** | 611 | /** |
629 | * The peer to contact | 612 | * The peer to contact |
630 | */ | 613 | */ |
@@ -642,8 +625,7 @@ struct GNUNET_TUN_GnsVpnRecord | |||
642 | /** | 625 | /** |
643 | * DNS query prefix. | 626 | * DNS query prefix. |
644 | */ | 627 | */ |
645 | struct GNUNET_TUN_DnsQueryLine | 628 | struct GNUNET_TUN_DnsQueryLine { |
646 | { | ||
647 | /** | 629 | /** |
648 | * Desired type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) | 630 | * Desired type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) |
649 | */ | 631 | */ |
@@ -659,8 +641,7 @@ struct GNUNET_TUN_DnsQueryLine | |||
659 | /** | 641 | /** |
660 | * General DNS record prefix. | 642 | * General DNS record prefix. |
661 | */ | 643 | */ |
662 | struct GNUNET_TUN_DnsRecordLine | 644 | struct GNUNET_TUN_DnsRecordLine { |
663 | { | ||
664 | /** | 645 | /** |
665 | * Record type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) | 646 | * Record type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) |
666 | */ | 647 | */ |
@@ -703,19 +684,16 @@ struct GNUNET_TUN_DnsRecordLine | |||
703 | /** | 684 | /** |
704 | * ICMP header. | 685 | * ICMP header. |
705 | */ | 686 | */ |
706 | struct GNUNET_TUN_IcmpHeader | 687 | struct GNUNET_TUN_IcmpHeader { |
707 | { | ||
708 | uint8_t type; | 688 | uint8_t type; |
709 | uint8_t code; | 689 | uint8_t code; |
710 | uint16_t crc GNUNET_PACKED; | 690 | uint16_t crc GNUNET_PACKED; |
711 | 691 | ||
712 | union | 692 | union { |
713 | { | ||
714 | /** | 693 | /** |
715 | * ICMP Echo (request/reply) | 694 | * ICMP Echo (request/reply) |
716 | */ | 695 | */ |
717 | struct | 696 | struct { |
718 | { | ||
719 | uint16_t identifier GNUNET_PACKED; | 697 | uint16_t identifier GNUNET_PACKED; |
720 | uint16_t sequence_number GNUNET_PACKED; | 698 | uint16_t sequence_number GNUNET_PACKED; |
721 | } echo; | 699 | } echo; |
@@ -723,8 +701,7 @@ struct GNUNET_TUN_IcmpHeader | |||
723 | /** | 701 | /** |
724 | * ICMP Destination Unreachable (RFC 1191) | 702 | * ICMP Destination Unreachable (RFC 1191) |
725 | */ | 703 | */ |
726 | struct ih_pmtu | 704 | struct ih_pmtu { |
727 | { | ||
728 | uint16_t empty GNUNET_PACKED; | 705 | uint16_t empty GNUNET_PACKED; |
729 | uint16_t next_hop_mtu GNUNET_PACKED; | 706 | uint16_t next_hop_mtu GNUNET_PACKED; |
730 | /* followed by original IP header + first 8 bytes of original IP datagram | 707 | /* followed by original IP header + first 8 bytes of original IP datagram |
@@ -740,7 +717,6 @@ struct GNUNET_TUN_IcmpHeader | |||
740 | * MTU for packets that are too big (IPv6). | 717 | * MTU for packets that are too big (IPv6). |
741 | */ | 718 | */ |
742 | uint32_t packet_too_big_mtu GNUNET_PACKED; | 719 | uint32_t packet_too_big_mtu GNUNET_PACKED; |
743 | |||
744 | } quench; | 720 | } quench; |
745 | }; | 721 | }; |
746 | 722 | ||
@@ -759,11 +735,11 @@ GNUNET_NETWORK_STRUCT_END | |||
759 | * @param dst destination IP address to use | 735 | * @param dst destination IP address to use |
760 | */ | 736 | */ |
761 | void | 737 | void |
762 | GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip, | 738 | GNUNET_TUN_initialize_ipv4_header(struct GNUNET_TUN_IPv4Header *ip, |
763 | uint8_t protocol, | 739 | uint8_t protocol, |
764 | uint16_t payload_length, | 740 | uint16_t payload_length, |
765 | const struct in_addr *src, | 741 | const struct in_addr *src, |
766 | const struct in_addr *dst); | 742 | const struct in_addr *dst); |
767 | 743 | ||
768 | 744 | ||
769 | /** | 745 | /** |
@@ -777,11 +753,11 @@ GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip, | |||
777 | * @param dst destination IP address to use | 753 | * @param dst destination IP address to use |
778 | */ | 754 | */ |
779 | void | 755 | void |
780 | GNUNET_TUN_initialize_ipv6_header (struct GNUNET_TUN_IPv6Header *ip, | 756 | GNUNET_TUN_initialize_ipv6_header(struct GNUNET_TUN_IPv6Header *ip, |
781 | uint8_t protocol, | 757 | uint8_t protocol, |
782 | uint16_t payload_length, | 758 | uint16_t payload_length, |
783 | const struct in6_addr *src, | 759 | const struct in6_addr *src, |
784 | const struct in6_addr *dst); | 760 | const struct in6_addr *dst); |
785 | 761 | ||
786 | /** | 762 | /** |
787 | * Calculate IPv4 TCP checksum. | 763 | * Calculate IPv4 TCP checksum. |
@@ -792,10 +768,10 @@ GNUNET_TUN_initialize_ipv6_header (struct GNUNET_TUN_IPv6Header *ip, | |||
792 | * @param payload_length number of bytes of TCP @a payload | 768 | * @param payload_length number of bytes of TCP @a payload |
793 | */ | 769 | */ |
794 | void | 770 | void |
795 | GNUNET_TUN_calculate_tcp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | 771 | GNUNET_TUN_calculate_tcp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, |
796 | struct GNUNET_TUN_TcpHeader *tcp, | 772 | struct GNUNET_TUN_TcpHeader *tcp, |
797 | const void *payload, | 773 | const void *payload, |
798 | uint16_t payload_length); | 774 | uint16_t payload_length); |
799 | 775 | ||
800 | /** | 776 | /** |
801 | * Calculate IPv6 TCP checksum. | 777 | * Calculate IPv6 TCP checksum. |
@@ -806,10 +782,10 @@ GNUNET_TUN_calculate_tcp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | |||
806 | * @param payload_length number of bytes of TCP payload | 782 | * @param payload_length number of bytes of TCP payload |
807 | */ | 783 | */ |
808 | void | 784 | void |
809 | GNUNET_TUN_calculate_tcp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | 785 | GNUNET_TUN_calculate_tcp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, |
810 | struct GNUNET_TUN_TcpHeader *tcp, | 786 | struct GNUNET_TUN_TcpHeader *tcp, |
811 | const void *payload, | 787 | const void *payload, |
812 | uint16_t payload_length); | 788 | uint16_t payload_length); |
813 | 789 | ||
814 | /** | 790 | /** |
815 | * Calculate IPv4 UDP checksum. | 791 | * Calculate IPv4 UDP checksum. |
@@ -820,10 +796,10 @@ GNUNET_TUN_calculate_tcp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | |||
820 | * @param payload_length number of bytes of UDP @a payload | 796 | * @param payload_length number of bytes of UDP @a payload |
821 | */ | 797 | */ |
822 | void | 798 | void |
823 | GNUNET_TUN_calculate_udp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | 799 | GNUNET_TUN_calculate_udp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, |
824 | struct GNUNET_TUN_UdpHeader *udp, | 800 | struct GNUNET_TUN_UdpHeader *udp, |
825 | const void *payload, | 801 | const void *payload, |
826 | uint16_t payload_length); | 802 | uint16_t payload_length); |
827 | 803 | ||
828 | 804 | ||
829 | /** | 805 | /** |
@@ -835,10 +811,10 @@ GNUNET_TUN_calculate_udp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | |||
835 | * @param payload_length number of bytes of @a payload | 811 | * @param payload_length number of bytes of @a payload |
836 | */ | 812 | */ |
837 | void | 813 | void |
838 | GNUNET_TUN_calculate_udp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | 814 | GNUNET_TUN_calculate_udp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, |
839 | struct GNUNET_TUN_UdpHeader *udp, | 815 | struct GNUNET_TUN_UdpHeader *udp, |
840 | const void *payload, | 816 | const void *payload, |
841 | uint16_t payload_length); | 817 | uint16_t payload_length); |
842 | 818 | ||
843 | 819 | ||
844 | /** | 820 | /** |
@@ -849,9 +825,9 @@ GNUNET_TUN_calculate_udp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | |||
849 | * @param payload_length number of bytes of @a payload | 825 | * @param payload_length number of bytes of @a payload |
850 | */ | 826 | */ |
851 | void | 827 | void |
852 | GNUNET_TUN_calculate_icmp_checksum (struct GNUNET_TUN_IcmpHeader *icmp, | 828 | GNUNET_TUN_calculate_icmp_checksum(struct GNUNET_TUN_IcmpHeader *icmp, |
853 | const void *payload, | 829 | const void *payload, |
854 | uint16_t payload_length); | 830 | uint16_t payload_length); |
855 | 831 | ||
856 | 832 | ||
857 | /** | 833 | /** |
@@ -863,9 +839,9 @@ GNUNET_TUN_calculate_icmp_checksum (struct GNUNET_TUN_IcmpHeader *icmp, | |||
863 | * bytes long. | 839 | * bytes long. |
864 | */ | 840 | */ |
865 | void | 841 | void |
866 | GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip, | 842 | GNUNET_TUN_ipv4toregexsearch(const struct in_addr *ip, |
867 | uint16_t port, | 843 | uint16_t port, |
868 | char *rxstr); | 844 | char *rxstr); |
869 | 845 | ||
870 | 846 | ||
871 | /** | 847 | /** |
@@ -877,9 +853,9 @@ GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip, | |||
877 | * bytes long. | 853 | * bytes long. |
878 | */ | 854 | */ |
879 | void | 855 | void |
880 | GNUNET_TUN_ipv6toregexsearch (const struct in6_addr *ipv6, | 856 | GNUNET_TUN_ipv6toregexsearch(const struct in6_addr *ipv6, |
881 | uint16_t port, | 857 | uint16_t port, |
882 | char *rxstr); | 858 | char *rxstr); |
883 | 859 | ||
884 | 860 | ||
885 | /** | 861 | /** |
@@ -892,7 +868,7 @@ GNUNET_TUN_ipv6toregexsearch (const struct in6_addr *ipv6, | |||
892 | * @return regular expression, NULL on error | 868 | * @return regular expression, NULL on error |
893 | */ | 869 | */ |
894 | char * | 870 | char * |
895 | GNUNET_TUN_ipv6policy2regex (const char *policy); | 871 | GNUNET_TUN_ipv6policy2regex(const char *policy); |
896 | 872 | ||
897 | 873 | ||
898 | /** | 874 | /** |
@@ -905,7 +881,7 @@ GNUNET_TUN_ipv6policy2regex (const char *policy); | |||
905 | * @return regular expression, NULL on error | 881 | * @return regular expression, NULL on error |
906 | */ | 882 | */ |
907 | char * | 883 | char * |
908 | GNUNET_TUN_ipv4policy2regex (const char *policy); | 884 | GNUNET_TUN_ipv4policy2regex(const char *policy); |
909 | 885 | ||
910 | 886 | ||
911 | /** | 887 | /** |
@@ -917,8 +893,8 @@ GNUNET_TUN_ipv4policy2regex (const char *policy); | |||
917 | * @param[out] hc corresponding hash | 893 | * @param[out] hc corresponding hash |
918 | */ | 894 | */ |
919 | void | 895 | void |
920 | GNUNET_TUN_service_name_to_hash (const char *service_name, | 896 | GNUNET_TUN_service_name_to_hash(const char *service_name, |
921 | struct GNUNET_HashCode *hc); | 897 | struct GNUNET_HashCode *hc); |
922 | 898 | ||
923 | 899 | ||
924 | /** | 900 | /** |
@@ -930,9 +906,9 @@ GNUNET_TUN_service_name_to_hash (const char *service_name, | |||
930 | * @return #GNUNET_YES if they are equal | 906 | * @return #GNUNET_YES if they are equal |
931 | */ | 907 | */ |
932 | int | 908 | int |
933 | GNUNET_TUN_sockaddr_cmp (const struct sockaddr *sa, | 909 | GNUNET_TUN_sockaddr_cmp(const struct sockaddr *sa, |
934 | const struct sockaddr *sb, | 910 | const struct sockaddr *sb, |
935 | int include_port); | 911 | int include_port); |
936 | 912 | ||
937 | 913 | ||
938 | /** | 914 | /** |
@@ -945,9 +921,9 @@ GNUNET_TUN_sockaddr_cmp (const struct sockaddr *sa, | |||
945 | * @param[out] cadet_port CADET port to use | 921 | * @param[out] cadet_port CADET port to use |
946 | */ | 922 | */ |
947 | void | 923 | void |
948 | GNUNET_TUN_compute_service_cadet_port (const struct GNUNET_HashCode *desc, | 924 | GNUNET_TUN_compute_service_cadet_port(const struct GNUNET_HashCode *desc, |
949 | uint16_t ip_port, | 925 | uint16_t ip_port, |
950 | struct GNUNET_HashCode *cadet_port); | 926 | struct GNUNET_HashCode *cadet_port); |
951 | 927 | ||
952 | #endif | 928 | #endif |
953 | 929 | ||
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h index a7bd7ce4b..24ad4e4e5 100644 --- a/src/include/gnunet_util_lib.h +++ b/src/include/gnunet_util_lib.h | |||
@@ -50,7 +50,7 @@ extern "C" | |||
50 | /** | 50 | /** |
51 | * Smallest supported message. | 51 | * Smallest supported message. |
52 | */ | 52 | */ |
53 | #define GNUNET_MIN_MESSAGE_SIZE sizeof (struct GNUNET_MessageHeader) | 53 | #define GNUNET_MIN_MESSAGE_SIZE sizeof(struct GNUNET_MessageHeader) |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * NOTE: You MUST adjust this URL to point to the location of a | 56 | * NOTE: You MUST adjust this URL to point to the location of a |
diff --git a/src/include/gnunet_util_taler_wallet_lib.h b/src/include/gnunet_util_taler_wallet_lib.h index d986c29a4..a036824f6 100644 --- a/src/include/gnunet_util_taler_wallet_lib.h +++ b/src/include/gnunet_util_taler_wallet_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
diff --git a/src/include/gnunet_vpn_service.h b/src/include/gnunet_vpn_service.h index 2096bf539..7e066b14f 100644 --- a/src/include/gnunet_vpn_service.h +++ b/src/include/gnunet_vpn_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -59,8 +59,8 @@ struct GNUNET_VPN_RedirectionRequest; | |||
59 | * specified target peer; NULL on error | 59 | * specified target peer; NULL on error |
60 | */ | 60 | */ |
61 | typedef void (*GNUNET_VPN_AllocationCallback)(void *cls, | 61 | typedef void (*GNUNET_VPN_AllocationCallback)(void *cls, |
62 | int af, | 62 | int af, |
63 | const void *address); | 63 | const void *address); |
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
@@ -69,7 +69,7 @@ typedef void (*GNUNET_VPN_AllocationCallback)(void *cls, | |||
69 | * @param rr request to cancel | 69 | * @param rr request to cancel |
70 | */ | 70 | */ |
71 | void | 71 | void |
72 | GNUNET_VPN_cancel_request (struct GNUNET_VPN_RedirectionRequest *rr); | 72 | GNUNET_VPN_cancel_request(struct GNUNET_VPN_RedirectionRequest *rr); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -95,14 +95,14 @@ GNUNET_VPN_cancel_request (struct GNUNET_VPN_RedirectionRequest *rr); | |||
95 | * anyway) | 95 | * anyway) |
96 | */ | 96 | */ |
97 | struct GNUNET_VPN_RedirectionRequest * | 97 | struct GNUNET_VPN_RedirectionRequest * |
98 | GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | 98 | GNUNET_VPN_redirect_to_peer(struct GNUNET_VPN_Handle *vh, |
99 | int result_af, | 99 | int result_af, |
100 | uint8_t protocol, | 100 | uint8_t protocol, |
101 | const struct GNUNET_PeerIdentity *peer, | 101 | const struct GNUNET_PeerIdentity *peer, |
102 | const struct GNUNET_HashCode *serv, | 102 | const struct GNUNET_HashCode *serv, |
103 | struct GNUNET_TIME_Absolute expiration_time, | 103 | struct GNUNET_TIME_Absolute expiration_time, |
104 | GNUNET_VPN_AllocationCallback cb, | 104 | GNUNET_VPN_AllocationCallback cb, |
105 | void *cb_cls); | 105 | void *cb_cls); |
106 | 106 | ||
107 | 107 | ||
108 | /** | 108 | /** |
@@ -129,13 +129,13 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
129 | * anyway) | 129 | * anyway) |
130 | */ | 130 | */ |
131 | struct GNUNET_VPN_RedirectionRequest * | 131 | struct GNUNET_VPN_RedirectionRequest * |
132 | GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh, | 132 | GNUNET_VPN_redirect_to_ip(struct GNUNET_VPN_Handle *vh, |
133 | int result_af, | 133 | int result_af, |
134 | int addr_af, | 134 | int addr_af, |
135 | const void *addr, | 135 | const void *addr, |
136 | struct GNUNET_TIME_Absolute expiration_time, | 136 | struct GNUNET_TIME_Absolute expiration_time, |
137 | GNUNET_VPN_AllocationCallback cb, | 137 | GNUNET_VPN_AllocationCallback cb, |
138 | void *cb_cls); | 138 | void *cb_cls); |
139 | 139 | ||
140 | 140 | ||
141 | /** | 141 | /** |
@@ -145,7 +145,7 @@ GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh, | |||
145 | * @return VPN handle | 145 | * @return VPN handle |
146 | */ | 146 | */ |
147 | struct GNUNET_VPN_Handle * | 147 | struct GNUNET_VPN_Handle * |
148 | GNUNET_VPN_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 148 | GNUNET_VPN_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
149 | 149 | ||
150 | 150 | ||
151 | /** | 151 | /** |
@@ -154,7 +154,7 @@ GNUNET_VPN_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
154 | * @param vh VPN handle | 154 | * @param vh VPN handle |
155 | */ | 155 | */ |
156 | void | 156 | void |
157 | GNUNET_VPN_disconnect (struct GNUNET_VPN_Handle *vh); | 157 | GNUNET_VPN_disconnect(struct GNUNET_VPN_Handle *vh); |
158 | 158 | ||
159 | #endif | 159 | #endif |
160 | 160 | ||
diff --git a/src/include/platform.h b/src/include/platform.h index 6a3e8e4b8..e12d08e44 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Nils Durner | 22 | * @author Nils Durner |
@@ -39,7 +39,7 @@ | |||
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #ifdef WINDOWS | 41 | #ifdef WINDOWS |
42 | #define BREAKPOINT asm("int $3;"); | 42 | #define BREAKPOINT asm ("int $3;"); |
43 | #define GNUNET_SIGCHLD 17 | 43 | #define GNUNET_SIGCHLD 17 |
44 | #else | 44 | #else |
45 | #define BREAKPOINT | 45 | #define BREAKPOINT |
@@ -223,11 +223,11 @@ | |||
223 | /** | 223 | /** |
224 | * GNU gettext support macro. | 224 | * GNU gettext support macro. |
225 | */ | 225 | */ |
226 | #define _(String) dgettext(PACKAGE,String) | 226 | #define _(String) dgettext(PACKAGE, String) |
227 | #define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor" | 227 | #define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor" |
228 | #else | 228 | #else |
229 | #include "libintlemu.h" | 229 | #include "libintlemu.h" |
230 | #define _(String) dgettext("org.gnunet.gnunet",String) | 230 | #define _(String) dgettext("org.gnunet.gnunet", String) |
231 | #define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor" | 231 | #define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor" |
232 | #endif | 232 | #endif |
233 | 233 | ||
@@ -249,7 +249,7 @@ | |||
249 | #ifdef DARWIN | 249 | #ifdef DARWIN |
250 | #define __BYTE_ORDER BYTE_ORDER | 250 | #define __BYTE_ORDER BYTE_ORDER |
251 | #define __BIG_ENDIAN BIG_ENDIAN | 251 | #define __BIG_ENDIAN BIG_ENDIAN |
252 | /* not available on darwin, override configure */ | 252 | /* not available on darwin, override configure */ |
253 | #undef HAVE_STAT64 | 253 | #undef HAVE_STAT64 |
254 | #undef HAVE_MREMAP | 254 | #undef HAVE_MREMAP |
255 | #endif | 255 | #endif |
@@ -257,7 +257,7 @@ | |||
257 | 257 | ||
258 | #if !HAVE_ATOLL | 258 | #if !HAVE_ATOLL |
259 | long long | 259 | long long |
260 | atoll (const char *nptr); | 260 | atoll(const char *nptr); |
261 | #endif | 261 | #endif |
262 | 262 | ||
263 | #if ENABLE_NLS | 263 | #if ENABLE_NLS |
diff --git a/src/include/tap-windows.h b/src/include/tap-windows.h index c9eb38eba..37f4129c0 100644 --- a/src/include/tap-windows.h +++ b/src/include/tap-windows.h | |||
@@ -37,25 +37,25 @@ | |||
37 | * ============= | 37 | * ============= |
38 | */ | 38 | */ |
39 | 39 | ||
40 | #define TAP_WIN_CONTROL_CODE(request,method) \ | 40 | #define TAP_WIN_CONTROL_CODE(request, method) \ |
41 | CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) | 41 | CTL_CODE(FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) |
42 | 42 | ||
43 | /* Present in 8.1 */ | 43 | /* Present in 8.1 */ |
44 | 44 | ||
45 | #define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED) | 45 | #define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE(1, METHOD_BUFFERED) |
46 | #define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED) | 46 | #define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE(2, METHOD_BUFFERED) |
47 | #define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED) | 47 | #define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE(3, METHOD_BUFFERED) |
48 | #define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED) | 48 | #define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE(4, METHOD_BUFFERED) |
49 | #define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED) | 49 | #define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE(5, METHOD_BUFFERED) |
50 | #define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED) | 50 | #define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE(6, METHOD_BUFFERED) |
51 | #define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED) | 51 | #define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE(7, METHOD_BUFFERED) |
52 | #define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED) | 52 | #define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE(8, METHOD_BUFFERED) |
53 | #define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED) | 53 | #define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE(9, METHOD_BUFFERED) |
54 | 54 | ||
55 | /* Added in 8.2 */ | 55 | /* Added in 8.2 */ |
56 | 56 | ||
57 | /* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ | 57 | /* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ |
58 | #define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED) | 58 | #define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE(10, METHOD_BUFFERED) |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * ================= | 61 | * ================= |
diff --git a/src/include/winproc.h b/src/include/winproc.h index 3910321d7..139f07e61 100644 --- a/src/include/winproc.h +++ b/src/include/winproc.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Nils Durner | 22 | * @author Nils Durner |
@@ -60,175 +60,174 @@ extern "C" | |||
60 | #define MAX_NAME_LENGTH 25 | 60 | #define MAX_NAME_LENGTH 25 |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | typedef DWORD WINAPI (*TNtQuerySystemInformation) (int, PVOID, ULONG, PULONG); | 63 | typedef DWORD WINAPI (*TNtQuerySystemInformation) (int, PVOID, ULONG, PULONG); |
64 | typedef DWORD WINAPI (*TGetIfEntry) (PMIB_IFROW pIfRow); | 64 | typedef DWORD WINAPI (*TGetIfEntry) (PMIB_IFROW pIfRow); |
65 | typedef DWORD WINAPI (*TGetIpAddrTable) (PMIB_IPADDRTABLE pIpAddrTable, | 65 | typedef DWORD WINAPI (*TGetIpAddrTable) (PMIB_IPADDRTABLE pIpAddrTable, |
66 | PULONG pdwSize, BOOL bOrder); | 66 | PULONG pdwSize, BOOL bOrder); |
67 | typedef DWORD WINAPI (*TGetIfTable) (PMIB_IFTABLE pIfTable, PULONG pdwSize, | 67 | typedef DWORD WINAPI (*TGetIfTable) (PMIB_IFTABLE pIfTable, PULONG pdwSize, |
68 | BOOL bOrder); | 68 | BOOL bOrder); |
69 | typedef DWORD WINAPI (*TGetBestInterfaceEx) (struct sockaddr *, PDWORD); | 69 | typedef DWORD WINAPI (*TGetBestInterfaceEx) (struct sockaddr *, PDWORD); |
70 | /* TODO: Explicitly import -A variants (i.e. TCreateHardLinkA) or -W | 70 | /* TODO: Explicitly import -A variants (i.e. TCreateHardLinkA) or -W |
71 | * variants (TCreateHardLinkW), etc. | 71 | * variants (TCreateHardLinkW), etc. |
72 | */ | 72 | */ |
73 | typedef DWORD WINAPI (*TCreateHardLink) (LPCTSTR lpFileName, | 73 | typedef DWORD WINAPI (*TCreateHardLink) (LPCTSTR lpFileName, |
74 | LPCTSTR lpExistingFileName, | 74 | LPCTSTR lpExistingFileName, |
75 | LPSECURITY_ATTRIBUTES | 75 | LPSECURITY_ATTRIBUTES |
76 | lpSecurityAttributes); | 76 | lpSecurityAttributes); |
77 | typedef SC_HANDLE WINAPI (*TOpenSCManager) (LPCTSTR lpMachineName, | 77 | typedef SC_HANDLE WINAPI (*TOpenSCManager) (LPCTSTR lpMachineName, |
78 | LPCTSTR lpDatabaseName, | 78 | LPCTSTR lpDatabaseName, |
79 | DWORD dwDesiredAccess); | ||
80 | typedef SC_HANDLE WINAPI (*TCreateService) (SC_HANDLE hSCManager, | ||
81 | LPCTSTR lpServiceName, | ||
82 | LPCTSTR lpDisplayName, | ||
83 | DWORD dwDesiredAccess, | ||
84 | DWORD dwServiceType, | ||
85 | DWORD dwStartType, | ||
86 | DWORD dwErrorControl, | ||
87 | LPCTSTR lpBinaryPathName, | ||
88 | LPCTSTR lpLoadOrderGroup, | ||
89 | LPDWORD lpdwTagId, | ||
90 | LPCTSTR lpDependencies, | ||
91 | LPCTSTR lpServiceStartName, | ||
92 | LPCTSTR lpPassword); | ||
93 | typedef BOOL WINAPI (*TCloseServiceHandle) (SC_HANDLE hSCObject); | ||
94 | typedef BOOL WINAPI (*TDeleteService) (SC_HANDLE hService); | ||
95 | typedef SERVICE_STATUS_HANDLE WINAPI (*TRegisterServiceCtrlHandler) (LPCTSTR | ||
96 | lpServiceName, | ||
97 | LPHANDLER_FUNCTION | ||
98 | lpHandlerProc); | ||
99 | typedef BOOL WINAPI (*TSetServiceStatus) (SERVICE_STATUS_HANDLE | ||
100 | hServiceStatus, | ||
101 | LPSERVICE_STATUS lpServiceStatus); | ||
102 | typedef BOOL WINAPI (*TStartServiceCtrlDispatcher) (const | ||
103 | LPSERVICE_TABLE_ENTRY | ||
104 | lpServiceTable); | ||
105 | typedef BOOL WINAPI (*TControlService) (SC_HANDLE hService, DWORD dwControl, | ||
106 | LPSERVICE_STATUS lpServiceStatus); | ||
107 | typedef SC_HANDLE WINAPI (*TOpenService) (SC_HANDLE hSCManager, | ||
108 | LPCTSTR lpServiceName, | ||
109 | DWORD dwDesiredAccess); | 79 | DWORD dwDesiredAccess); |
110 | typedef DWORD WINAPI (*TGetAdaptersInfo) (PIP_ADAPTER_INFO pAdapterInfo, | 80 | typedef SC_HANDLE WINAPI (*TCreateService) (SC_HANDLE hSCManager, |
111 | PULONG pOutBufLen); | 81 | LPCTSTR lpServiceName, |
112 | typedef NET_API_STATUS WINAPI (*TNetUserAdd) (LPCWSTR, DWORD, PBYTE, PDWORD); | 82 | LPCTSTR lpDisplayName, |
113 | typedef NET_API_STATUS WINAPI (*TNetUserSetInfo) (LPCWSTR servername, | 83 | DWORD dwDesiredAccess, |
114 | LPCWSTR username, | 84 | DWORD dwServiceType, |
115 | DWORD level, LPBYTE buf, | 85 | DWORD dwStartType, |
116 | LPDWORD param_err); | 86 | DWORD dwErrorControl, |
117 | typedef NTSTATUS NTAPI (*TLsaOpenPolicy) (PLSA_UNICODE_STRING, | 87 | LPCTSTR lpBinaryPathName, |
118 | PLSA_OBJECT_ATTRIBUTES, ACCESS_MASK, | 88 | LPCTSTR lpLoadOrderGroup, |
119 | PLSA_HANDLE); | 89 | LPDWORD lpdwTagId, |
120 | typedef NTSTATUS NTAPI (*TLsaAddAccountRights) (LSA_HANDLE, PSID, | 90 | LPCTSTR lpDependencies, |
121 | PLSA_UNICODE_STRING, ULONG); | 91 | LPCTSTR lpServiceStartName, |
122 | typedef NTSTATUS NTAPI (*TLsaRemoveAccountRights) (LSA_HANDLE, PSID, BOOLEAN, | 92 | LPCTSTR lpPassword); |
123 | PLSA_UNICODE_STRING, | 93 | typedef BOOL WINAPI (*TCloseServiceHandle) (SC_HANDLE hSCObject); |
124 | ULONG); | 94 | typedef BOOL WINAPI (*TDeleteService) (SC_HANDLE hService); |
125 | typedef NTSTATUS NTAPI (*TLsaClose) (LSA_HANDLE); | 95 | typedef SERVICE_STATUS_HANDLE WINAPI (*TRegisterServiceCtrlHandler) (LPCTSTR |
126 | typedef BOOL WINAPI (*TLookupAccountName) (LPCTSTR lpSystemName, | 96 | lpServiceName, |
127 | LPCTSTR lpAccountName, PSID Sid, | 97 | LPHANDLER_FUNCTION |
128 | LPDWORD cbSid, | 98 | lpHandlerProc); |
129 | LPTSTR ReferencedDomainName, | 99 | typedef BOOL WINAPI (*TSetServiceStatus) (SERVICE_STATUS_HANDLE |
130 | LPDWORD cchReferencedDomainName, | 100 | hServiceStatus, |
131 | PSID_NAME_USE peUse); | 101 | LPSERVICE_STATUS lpServiceStatus); |
132 | 102 | typedef BOOL WINAPI (*TStartServiceCtrlDispatcher) (const | |
133 | typedef BOOL WINAPI (*TGetFileSecurity) (LPCTSTR lpFileName, | 103 | LPSERVICE_TABLE_ENTRY |
134 | SECURITY_INFORMATION | 104 | lpServiceTable); |
135 | RequestedInformation, | 105 | typedef BOOL WINAPI (*TControlService) (SC_HANDLE hService, DWORD dwControl, |
136 | PSECURITY_DESCRIPTOR | 106 | LPSERVICE_STATUS lpServiceStatus); |
137 | pSecurityDescriptor, DWORD nLength, | 107 | typedef SC_HANDLE WINAPI (*TOpenService) (SC_HANDLE hSCManager, |
138 | LPDWORD lpnLengthNeeded); | 108 | LPCTSTR lpServiceName, |
139 | typedef BOOL WINAPI (*TInitializeSecurityDescriptor) (PSECURITY_DESCRIPTOR | 109 | DWORD dwDesiredAccess); |
140 | pSecurityDescriptor, | 110 | typedef DWORD WINAPI (*TGetAdaptersInfo) (PIP_ADAPTER_INFO pAdapterInfo, |
141 | DWORD dwRevision); | 111 | PULONG pOutBufLen); |
142 | typedef BOOL WINAPI (*TGetSecurityDescriptorDacl) (PSECURITY_DESCRIPTOR | 112 | typedef NET_API_STATUS WINAPI (*TNetUserAdd) (LPCWSTR, DWORD, PBYTE, PDWORD); |
143 | pSecurityDescriptor, | 113 | typedef NET_API_STATUS WINAPI (*TNetUserSetInfo) (LPCWSTR servername, |
144 | LPBOOL lpbDaclPresent, | 114 | LPCWSTR username, |
145 | PACL * pDacl, | 115 | DWORD level, LPBYTE buf, |
146 | LPBOOL lpbDaclDefaulted); | 116 | LPDWORD param_err); |
147 | typedef BOOL WINAPI (*TGetAclInformation) (PACL pAcl, LPVOID pAclInformation, | 117 | typedef NTSTATUS NTAPI (*TLsaOpenPolicy) (PLSA_UNICODE_STRING, |
148 | DWORD nAclInformationLength, | 118 | PLSA_OBJECT_ATTRIBUTES, ACCESS_MASK, |
149 | ACL_INFORMATION_CLASS | 119 | PLSA_HANDLE); |
150 | dwAclInformationClass); | 120 | typedef NTSTATUS NTAPI (*TLsaAddAccountRights) (LSA_HANDLE, PSID, |
151 | typedef BOOL WINAPI (*TInitializeAcl) (PACL pAcl, DWORD nAclLength, | 121 | PLSA_UNICODE_STRING, ULONG); |
152 | DWORD dwAclRevision); | 122 | typedef NTSTATUS NTAPI (*TLsaRemoveAccountRights) (LSA_HANDLE, PSID, BOOLEAN, |
153 | typedef BOOL WINAPI (*TGetAce) (PACL pAcl, DWORD dwAceIndex, LPVOID * pAce); | 123 | PLSA_UNICODE_STRING, |
154 | typedef BOOL WINAPI (*TEqualSid) (PSID pSid1, PSID pSid2); | 124 | ULONG); |
155 | typedef BOOL WINAPI (*TAddAce) (PACL pAcl, DWORD dwAceRevision, | 125 | typedef NTSTATUS NTAPI (*TLsaClose) (LSA_HANDLE); |
156 | DWORD dwStartingAceIndex, LPVOID pAceList, | 126 | typedef BOOL WINAPI (*TLookupAccountName) (LPCTSTR lpSystemName, |
157 | DWORD nAceListLength); | 127 | LPCTSTR lpAccountName, PSID Sid, |
158 | typedef BOOL WINAPI (*TAddAccessAllowedAce) (PACL pAcl, DWORD dwAceRevision, | 128 | LPDWORD cbSid, |
159 | DWORD AccessMask, PSID pSid); | 129 | LPTSTR ReferencedDomainName, |
160 | typedef BOOL WINAPI (*TSetNamedSecurityInfo) (LPTSTR pObjectName, | 130 | LPDWORD cchReferencedDomainName, |
161 | SE_OBJECT_TYPE ObjectType, | 131 | PSID_NAME_USE peUse); |
162 | SECURITY_INFORMATION | 132 | |
163 | SecurityInfo, PSID psidOwner, | 133 | typedef BOOL WINAPI (*TGetFileSecurity) (LPCTSTR lpFileName, |
164 | PSID psidGroup, PACL pDacl, | 134 | SECURITY_INFORMATION |
165 | PACL pSacl); | 135 | RequestedInformation, |
166 | 136 | PSECURITY_DESCRIPTOR | |
167 | extern TGetBestInterfaceEx GNGetBestInterfaceEx; | 137 | pSecurityDescriptor, DWORD nLength, |
168 | extern TNtQuerySystemInformation GNNtQuerySystemInformation; | 138 | LPDWORD lpnLengthNeeded); |
169 | extern TGetIfEntry GNGetIfEntry; | 139 | typedef BOOL WINAPI (*TInitializeSecurityDescriptor) (PSECURITY_DESCRIPTOR |
170 | extern TGetIpAddrTable GNGetIpAddrTable; | 140 | pSecurityDescriptor, |
171 | extern TGetIfTable GNGetIfTable; | 141 | DWORD dwRevision); |
172 | extern TCreateHardLink GNCreateHardLink; | 142 | typedef BOOL WINAPI (*TGetSecurityDescriptorDacl) (PSECURITY_DESCRIPTOR |
173 | extern TOpenSCManager GNOpenSCManager; | 143 | pSecurityDescriptor, |
174 | extern TCreateService GNCreateService; | 144 | LPBOOL lpbDaclPresent, |
175 | extern TCloseServiceHandle GNCloseServiceHandle; | 145 | PACL * pDacl, |
176 | extern TDeleteService GNDeleteService; | 146 | LPBOOL lpbDaclDefaulted); |
177 | extern TRegisterServiceCtrlHandler GNRegisterServiceCtrlHandler; | 147 | typedef BOOL WINAPI (*TGetAclInformation) (PACL pAcl, LPVOID pAclInformation, |
178 | extern TSetServiceStatus GNSetServiceStatus; | 148 | DWORD nAclInformationLength, |
179 | extern TStartServiceCtrlDispatcher GNStartServiceCtrlDispatcher; | 149 | ACL_INFORMATION_CLASS |
180 | extern TControlService GNControlService; | 150 | dwAclInformationClass); |
181 | extern TOpenService GNOpenService; | 151 | typedef BOOL WINAPI (*TInitializeAcl) (PACL pAcl, DWORD nAclLength, |
182 | extern TGetAdaptersInfo GNGetAdaptersInfo; | 152 | DWORD dwAclRevision); |
183 | extern TNetUserAdd GNNetUserAdd; | 153 | typedef BOOL WINAPI (*TGetAce) (PACL pAcl, DWORD dwAceIndex, LPVOID * pAce); |
184 | extern TNetUserSetInfo GNNetUserSetInfo; | 154 | typedef BOOL WINAPI (*TEqualSid) (PSID pSid1, PSID pSid2); |
185 | extern TLsaOpenPolicy GNLsaOpenPolicy; | 155 | typedef BOOL WINAPI (*TAddAce) (PACL pAcl, DWORD dwAceRevision, |
186 | extern TLsaAddAccountRights GNLsaAddAccountRights; | 156 | DWORD dwStartingAceIndex, LPVOID pAceList, |
187 | extern TLsaRemoveAccountRights GNLsaRemoveAccountRights; | 157 | DWORD nAceListLength); |
188 | extern TLsaClose GNLsaClose; | 158 | typedef BOOL WINAPI (*TAddAccessAllowedAce) (PACL pAcl, DWORD dwAceRevision, |
189 | extern TLookupAccountName GNLookupAccountName; | 159 | DWORD AccessMask, PSID pSid); |
190 | extern TGetFileSecurity GNGetFileSecurity; | 160 | typedef BOOL WINAPI (*TSetNamedSecurityInfo) (LPTSTR pObjectName, |
191 | extern TInitializeSecurityDescriptor GNInitializeSecurityDescriptor; | 161 | SE_OBJECT_TYPE ObjectType, |
192 | extern TGetSecurityDescriptorDacl GNGetSecurityDescriptorDacl; | 162 | SECURITY_INFORMATION |
193 | extern TGetAclInformation GNGetAclInformation; | 163 | SecurityInfo, PSID psidOwner, |
194 | extern TInitializeAcl GNInitializeAcl; | 164 | PSID psidGroup, PACL pDacl, |
195 | extern TGetAce GNGetAce; | 165 | PACL pSacl); |
196 | extern TEqualSid GNEqualSid; | 166 | |
197 | extern TAddAce GNAddAce; | 167 | extern TGetBestInterfaceEx GNGetBestInterfaceEx; |
198 | extern TAddAccessAllowedAce GNAddAccessAllowedAce; | 168 | extern TNtQuerySystemInformation GNNtQuerySystemInformation; |
199 | extern TSetNamedSecurityInfo GNSetNamedSecurityInfo; | 169 | extern TGetIfEntry GNGetIfEntry; |
200 | 170 | extern TGetIpAddrTable GNGetIpAddrTable; | |
201 | 171 | extern TGetIfTable GNGetIfTable; | |
202 | BOOL CreateShortcut (const char *pszSrc, const char *pszDest); | 172 | extern TCreateHardLink GNCreateHardLink; |
203 | BOOL DereferenceShortcut (char *pszShortcut); | 173 | extern TOpenSCManager GNOpenSCManager; |
204 | long QueryRegistry (HKEY hMainKey, const char *pszKey, const char *pszSubKey, | 174 | extern TCreateService GNCreateService; |
205 | char *pszBuffer, long *pdLength); | 175 | extern TCloseServiceHandle GNCloseServiceHandle; |
206 | int ListNICs (void (*callback) (void *, const char *, int), void *cls); | 176 | extern TDeleteService GNDeleteService; |
207 | BOOL AddPathAccessRights (char *lpszFileName, char *lpszAccountName, | 177 | extern TRegisterServiceCtrlHandler GNRegisterServiceCtrlHandler; |
208 | DWORD dwAccessMask); | 178 | extern TSetServiceStatus GNSetServiceStatus; |
209 | char *winErrorStr (const char *prefix, int dwErr); | 179 | extern TStartServiceCtrlDispatcher GNStartServiceCtrlDispatcher; |
210 | void EnumNICs (PMIB_IFTABLE * pIfTable, PMIB_IPADDRTABLE * pAddrTable); | 180 | extern TControlService GNControlService; |
181 | extern TOpenService GNOpenService; | ||
182 | extern TGetAdaptersInfo GNGetAdaptersInfo; | ||
183 | extern TNetUserAdd GNNetUserAdd; | ||
184 | extern TNetUserSetInfo GNNetUserSetInfo; | ||
185 | extern TLsaOpenPolicy GNLsaOpenPolicy; | ||
186 | extern TLsaAddAccountRights GNLsaAddAccountRights; | ||
187 | extern TLsaRemoveAccountRights GNLsaRemoveAccountRights; | ||
188 | extern TLsaClose GNLsaClose; | ||
189 | extern TLookupAccountName GNLookupAccountName; | ||
190 | extern TGetFileSecurity GNGetFileSecurity; | ||
191 | extern TInitializeSecurityDescriptor GNInitializeSecurityDescriptor; | ||
192 | extern TGetSecurityDescriptorDacl GNGetSecurityDescriptorDacl; | ||
193 | extern TGetAclInformation GNGetAclInformation; | ||
194 | extern TInitializeAcl GNInitializeAcl; | ||
195 | extern TGetAce GNGetAce; | ||
196 | extern TEqualSid GNEqualSid; | ||
197 | extern TAddAce GNAddAce; | ||
198 | extern TAddAccessAllowedAce GNAddAccessAllowedAce; | ||
199 | extern TSetNamedSecurityInfo GNSetNamedSecurityInfo; | ||
200 | |||
201 | |||
202 | BOOL CreateShortcut(const char *pszSrc, const char *pszDest); | ||
203 | BOOL DereferenceShortcut(char *pszShortcut); | ||
204 | long QueryRegistry(HKEY hMainKey, const char *pszKey, const char *pszSubKey, | ||
205 | char *pszBuffer, long *pdLength); | ||
206 | int ListNICs(void (*callback)(void *, const char *, int), void *cls); | ||
207 | BOOL AddPathAccessRights(char *lpszFileName, char *lpszAccountName, | ||
208 | DWORD dwAccessMask); | ||
209 | char *winErrorStr(const char *prefix, int dwErr); | ||
210 | void EnumNICs(PMIB_IFTABLE * pIfTable, PMIB_IPADDRTABLE * pAddrTable); | ||
211 | 211 | ||
212 | #define ENUMNICS3_MASK_OK 0x01 | 212 | #define ENUMNICS3_MASK_OK 0x01 |
213 | #define ENUMNICS3_BCAST_OK 0x02 | 213 | #define ENUMNICS3_BCAST_OK 0x02 |
214 | 214 | ||
215 | struct EnumNICs3_results | 215 | struct EnumNICs3_results { |
216 | { | 216 | unsigned char flags; |
217 | unsigned char flags; | 217 | int is_default; |
218 | int is_default; | 218 | char pretty_name[1001]; |
219 | char pretty_name[1001]; | 219 | size_t addr_size; |
220 | size_t addr_size; | 220 | SOCKADDR_STORAGE address; |
221 | SOCKADDR_STORAGE address; | 221 | SOCKADDR_STORAGE mask; |
222 | SOCKADDR_STORAGE mask; | 222 | SOCKADDR_STORAGE broadcast; |
223 | SOCKADDR_STORAGE broadcast; | 223 | }; |
224 | }; | 224 | |
225 | 225 | int EnumNICs3(struct EnumNICs3_results **, int *EnumNICs3_results_count); | |
226 | int EnumNICs3 (struct EnumNICs3_results **, int *EnumNICs3_results_count); | 226 | void EnumNICs3_free(struct EnumNICs3_results *); |
227 | void EnumNICs3_free (struct EnumNICs3_results *); | 227 | int GNInitWinEnv(); |
228 | int GNInitWinEnv (); | 228 | void GNShutdownWinEnv(); |
229 | void GNShutdownWinEnv (); | 229 | |
230 | 230 | BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode, DWORD dwTimeout); | |
231 | BOOL SafeTerminateProcess (HANDLE hProcess, UINT uExitCode, DWORD dwTimeout); | ||
232 | #ifdef __cplusplus | 231 | #ifdef __cplusplus |
233 | } | 232 | } |
234 | #endif | 233 | #endif |