diff options
Diffstat (limited to 'src/messenger/messenger_api_list_tunnels.h')
-rw-r--r-- | src/messenger/messenger_api_list_tunnels.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/src/messenger/messenger_api_list_tunnels.h b/src/messenger/messenger_api_list_tunnels.h index 0240fceb8..bd0a42e41 100644 --- a/src/messenger/messenger_api_list_tunnels.h +++ b/src/messenger/messenger_api_list_tunnels.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2020 GNUnet e.V. | 3 | Copyright (C) 2020--2021 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 |
@@ -47,7 +47,7 @@ struct GNUNET_MESSENGER_ListTunnels | |||
47 | /** | 47 | /** |
48 | * Initializes list of tunnels peer identities as empty list. | 48 | * Initializes list of tunnels peer identities as empty list. |
49 | * | 49 | * |
50 | * @param tunnels List of peer identities | 50 | * @param[out] tunnels List of peer identities |
51 | */ | 51 | */ |
52 | void | 52 | void |
53 | init_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); | 53 | init_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); |
@@ -55,7 +55,7 @@ init_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); | |||
55 | /** | 55 | /** |
56 | * Clears the list of tunnels peer identities. | 56 | * Clears the list of tunnels peer identities. |
57 | * | 57 | * |
58 | * @param tunnels List of peer identities | 58 | * @param[in/out] tunnels List of peer identities |
59 | */ | 59 | */ |
60 | void | 60 | void |
61 | clear_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); | 61 | clear_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); |
@@ -63,8 +63,8 @@ clear_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); | |||
63 | /** | 63 | /** |
64 | * Adds a specific <i>peer</i> from a tunnel to the end of the list. | 64 | * Adds a specific <i>peer</i> from a tunnel to the end of the list. |
65 | * | 65 | * |
66 | * @param tunnels List of peer identities | 66 | * @param[in/out] tunnels List of peer identities |
67 | * @param peer Peer identity of tunnel | 67 | * @param[in] peer Peer identity of tunnel |
68 | */ | 68 | */ |
69 | void | 69 | void |
70 | add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer); | 70 | add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer); |
@@ -79,8 +79,8 @@ add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct | |||
79 | * the found element in the list. If no matching element is found, <i>index</i> will | 79 | * the found element in the list. If no matching element is found, <i>index</i> will |
80 | * contain the total amount of elements in the list. | 80 | * contain the total amount of elements in the list. |
81 | * | 81 | * |
82 | * @param tunnels List of peer identities | 82 | * @param[in/out] tunnels List of peer identities |
83 | * @param peer Peer identity of tunnel | 83 | * @param[in] peer Peer identity of tunnel |
84 | * @param[out] index Index of found element (optional) | 84 | * @param[out] index Index of found element (optional) |
85 | * @return Element in the list with matching peer identity | 85 | * @return Element in the list with matching peer identity |
86 | */ | 86 | */ |
@@ -89,11 +89,11 @@ find_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GN | |||
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Tests linearly if the list of tunnels peer identities contains a specific | 91 | * Tests linearly if the list of tunnels peer identities contains a specific |
92 | * <i>peer</i> identity and returns GNUNET_YES on success, otherwise GNUNET_NO. | 92 | * <i>peer</i> identity and returns #GNUNET_YES on success, otherwise #GNUNET_NO. |
93 | * | 93 | * |
94 | * @param tunnels List of peer identities | 94 | * @param[in/out] tunnels List of peer identities |
95 | * @param peer Peer identity of tunnel | 95 | * @param[in] peer Peer identity of tunnel |
96 | * @return GNUNET_YES on success, otherwise GNUNET_NO | 96 | * @return #GNUNET_YES on success, otherwise #GNUNET_NO |
97 | */ | 97 | */ |
98 | int | 98 | int |
99 | contains_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer); | 99 | contains_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer); |
@@ -102,11 +102,29 @@ contains_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struc | |||
102 | * Removes a specific <i>element</i> from the list of tunnels peer identities and returns | 102 | * Removes a specific <i>element</i> from the list of tunnels peer identities and returns |
103 | * the next element in the list. | 103 | * the next element in the list. |
104 | * | 104 | * |
105 | * @param tunnels List of peer identities | 105 | * @param[in/out] tunnels List of peer identities |
106 | * @param element Element of the list | 106 | * @param[in/out] element Element of the list |
107 | * @return Next element in the list | 107 | * @return Next element in the list |
108 | */ | 108 | */ |
109 | struct GNUNET_MESSENGER_ListTunnel* | 109 | struct GNUNET_MESSENGER_ListTunnel* |
110 | remove_from_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element); | 110 | remove_from_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element); |
111 | 111 | ||
112 | /** | ||
113 | * Loads the list of tunnels peer identities from a file under a given <i>path</i>. | ||
114 | * | ||
115 | * @param[out] messages List of hashes | ||
116 | * @param[in] path Path of file | ||
117 | */ | ||
118 | void | ||
119 | load_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path); | ||
120 | |||
121 | /** | ||
122 | * Saves the list of tunnels peer identities to a file under a given <i>path</i>. | ||
123 | * | ||
124 | * @param[in] messages List of hashes | ||
125 | * @param[in] path Path of file | ||
126 | */ | ||
127 | void | ||
128 | save_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path); | ||
129 | |||
112 | #endif //GNUNET_MESSENGER_API_LIST_TUNNELS_H | 130 | #endif //GNUNET_MESSENGER_API_LIST_TUNNELS_H |