diff options
Diffstat (limited to 'src/messenger/messenger_api_list_tunnels.h')
-rw-r--r-- | src/messenger/messenger_api_list_tunnels.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/messenger/messenger_api_list_tunnels.h b/src/messenger/messenger_api_list_tunnels.h index d2ceeafc2..212f2ae21 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--2021 GNUnet e.V. | 3 | Copyright (C) 2020--2023 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 |
@@ -35,6 +35,7 @@ struct GNUNET_MESSENGER_ListTunnel | |||
35 | struct GNUNET_MESSENGER_ListTunnel *next; | 35 | struct GNUNET_MESSENGER_ListTunnel *next; |
36 | 36 | ||
37 | GNUNET_PEER_Id peer; | 37 | GNUNET_PEER_Id peer; |
38 | struct GNUNET_HashCode *hash; | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | struct GNUNET_MESSENGER_ListTunnels | 41 | struct GNUNET_MESSENGER_ListTunnels |
@@ -62,12 +63,16 @@ clear_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels); | |||
62 | /** | 63 | /** |
63 | * 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. |
64 | * | 65 | * |
66 | * Optionally adds the <i>hash</i> of the peer message from the specific <i>peer</i>. | ||
67 | * | ||
65 | * @param[in,out] tunnels List of peer identities | 68 | * @param[in,out] tunnels List of peer identities |
66 | * @param[in] peer Peer identity of tunnel | 69 | * @param[in] peer Peer identity of tunnel |
70 | * @param[in] hash Hash of peer message or NULL | ||
67 | */ | 71 | */ |
68 | void | 72 | void |
69 | add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, | 73 | add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, |
70 | const struct GNUNET_PeerIdentity *peer); | 74 | const struct GNUNET_PeerIdentity *peer, |
75 | const struct GNUNET_HashCode *hash); | ||
71 | 76 | ||
72 | /** | 77 | /** |
73 | * Searches linearly through the list of tunnels peer identities for matching a | 78 | * Searches linearly through the list of tunnels peer identities for matching a |
@@ -90,6 +95,22 @@ find_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, | |||
90 | size_t *index); | 95 | size_t *index); |
91 | 96 | ||
92 | /** | 97 | /** |
98 | * Updates a specific <i>peer</i> from a tunnel in the list. | ||
99 | * | ||
100 | * This function exists to add the <i>hash</i> of a newer peer message | ||
101 | * from the specific <i>peer</i> to the list element. It can also remove | ||
102 | * the hash when NULL is provided as new <i>hash</i> value. | ||
103 | * | ||
104 | * @param[in,out] tunnels List of peer identities | ||
105 | * @param[in] peer Peer identity of tunnel | ||
106 | * @param[in] hash Hash of peer message or NULL | ||
107 | */ | ||
108 | void | ||
109 | update_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, | ||
110 | const struct GNUNET_PeerIdentity *peer, | ||
111 | const struct GNUNET_HashCode *hash); | ||
112 | |||
113 | /** | ||
93 | * Tests linearly if the list of tunnels peer identities contains a specific | 114 | * Tests linearly if the list of tunnels peer identities contains a specific |
94 | * <i>peer</i> identity and returns #GNUNET_YES on success, otherwise #GNUNET_NO. | 115 | * <i>peer</i> identity and returns #GNUNET_YES on success, otherwise #GNUNET_NO. |
95 | * | 116 | * |