aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_ego_store.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-service-messenger_ego_store.h')
-rw-r--r--src/messenger/gnunet-service-messenger_ego_store.h57
1 files changed, 52 insertions, 5 deletions
diff --git a/src/messenger/gnunet-service-messenger_ego_store.h b/src/messenger/gnunet-service-messenger_ego_store.h
index 4222a4e91..4ed2bbf6d 100644
--- a/src/messenger/gnunet-service-messenger_ego_store.h
+++ b/src/messenger/gnunet-service-messenger_ego_store.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--2022 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
@@ -62,7 +62,8 @@ struct GNUNET_MESSENGER_EgoOperation
62 struct GNUNET_IDENTITY_Operation *operation; 62 struct GNUNET_IDENTITY_Operation *operation;
63 63
64 struct GNUNET_MESSENGER_EgoStore *store; 64 struct GNUNET_MESSENGER_EgoStore *store;
65 void *handle; 65
66 void *cls;
66 67
67 char *identifier; 68 char *identifier;
68}; 69};
@@ -73,6 +74,7 @@ struct GNUNET_MESSENGER_EgoStore
73 74
74 struct GNUNET_IDENTITY_Handle *identity; 75 struct GNUNET_IDENTITY_Handle *identity;
75 struct GNUNET_CONTAINER_MultiHashMap *egos; 76 struct GNUNET_CONTAINER_MultiHashMap *egos;
77 struct GNUNET_CONTAINER_MultiHashMap *handles;
76 78
77 struct GNUNET_MESSENGER_EgoLookup *lu_start; 79 struct GNUNET_MESSENGER_EgoLookup *lu_start;
78 struct GNUNET_MESSENGER_EgoLookup *lu_end; 80 struct GNUNET_MESSENGER_EgoLookup *lu_end;
@@ -101,15 +103,38 @@ clear_ego_store (struct GNUNET_MESSENGER_EgoStore *store);
101 103
102/** 104/**
103 * Creates a new EGO which will be registered to a <i>store</i> under 105 * Creates a new EGO which will be registered to a <i>store</i> under
104 * a specific <i>identifier</i>. A given <i>handle</i> will be informed 106 * a specific <i>identifier</i>.
105 * about the creation and changes its EGO accordingly.
106 * 107 *
107 * @param[in/out] store EGO-store 108 * @param[in/out] store EGO-store
108 * @param[in] identifier Identifier string 109 * @param[in] identifier Identifier string
109 * @param[in/out] handle Handle or NULL
110 */ 110 */
111void 111void
112create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, 112create_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
113 const char *identifier);
114
115/**
116 * Binds an EGO which was registered to a <i>store</i> under
117 * a specific <i>identifier</i> to a given <i>handle</i>
118 *
119 * @param[in/out] store EGO-store
120 * @param[in] identifier Identifier string
121 * @param[in/out] handle Handle
122 */
123void
124bind_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
125 const char *identifier,
126 void *handle);
127
128/**
129 * Binds an EGO which was registered to a <i>store</i> under
130 * a specific <i>identifier</i> to a given <i>handle</i>
131 *
132 * @param[in/out] store EGO-store
133 * @param[in] identifier Identifier string
134 * @param[in/out] handle Handle
135 */
136void
137unbind_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
113 const char *identifier, 138 const char *identifier,
114 void *handle); 139 void *handle);
115 140
@@ -143,6 +168,17 @@ update_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
143 const struct GNUNET_IDENTITY_PrivateKey *key); 168 const struct GNUNET_IDENTITY_PrivateKey *key);
144 169
145/** 170/**
171 * Deletes the registration of an EGO in a <i>store</i> under
172 * a specific <i>identifier</i>.
173 *
174 * @param[in/out] store EGO-store
175 * @param[in] identifier Identifier string
176 */
177void
178delete_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
179 const char *identifier);
180
181/**
146 * Updates the location of a registered EGO in a <i>store</i> to 182 * Updates the location of a registered EGO in a <i>store</i> to
147 * a different one under a specific <i>new_identifier<i> replacing 183 * a different one under a specific <i>new_identifier<i> replacing
148 * its old one. 184 * its old one.
@@ -156,4 +192,15 @@ rename_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
156 const char *old_identifier, 192 const char *old_identifier,
157 const char *new_identifier); 193 const char *new_identifier);
158 194
195/**
196 * Replaces the registered EGO in a <i>store</i> under a specific
197 * <i>identifier</i> with a newly created one.
198 *
199 * @param[in/out] store EGO-store
200 * @param[in] identifier Identifier string
201 */
202void
203renew_store_ego (struct GNUNET_MESSENGER_EgoStore *store,
204 const char *identifier);
205
159#endif //GNUNET_SERVICE_MESSENGER_EGO_STORE_H 206#endif //GNUNET_SERVICE_MESSENGER_EGO_STORE_H