GNUnet  0.11.x
gnunet-service-messenger_ego_store.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2020--2021 GNUnet e.V.
4 
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
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
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/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
26 #ifndef GNUNET_SERVICE_MESSENGER_EGO_STORE_H
27 #define GNUNET_SERVICE_MESSENGER_EGO_STORE_H
28 
29 #include "platform.h"
30 #include "gnunet_container_lib.h"
31 
32 #include "messenger_api_ego.h"
33 
36 
37 typedef void
38 (*GNUNET_MESSENGER_EgoLookupCallback) (void *cls, const char *identifier,
39  const struct GNUNET_MESSENGER_Ego *ego);
40 
42 {
45 
47 
49 
51  void *cls;
52 
53  char *identifier;
54 };
55 
57 {
60 
62 
64  void *handle;
65 
66  char *identifier;
67 };
68 
70 {
72 
75 
78 
81 };
82 
89 void
91 
97 void
99 
109 void
110 create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier,
111  void *handle);
112 
122 void
123 lookup_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier,
125 
135 struct GNUNET_MESSENGER_Ego*
136 update_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier,
137  const struct GNUNET_IDENTITY_PrivateKey *key);
138 
148 void
149 rename_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *old_identifier,
150  const char *new_identifier);
151 
152 #endif //GNUNET_SERVICE_MESSENGER_EGO_STORE_H
const struct GNUNET_CONFIGURATION_Handle * cfg
void(* GNUNET_MESSENGER_EgoLookupCallback)(void *cls, const char *identifier, const struct GNUNET_MESSENGER_Ego *ego)
void rename_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *old_identifier, const char *new_identifier)
Updates the location of a registered EGO in a store to a different one under a specific new_identifie...
Handle for ego lookup.
struct GNUNET_MESSENGER_EgoLookup * prev
struct GNUNET_MESSENGER_EgoOperation * op_start
A private key for an identity as per LSD0001.
struct GNUNET_MESSENGER_EgoOperation * prev
void init_ego_store(struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONFIGURATION_Handle *config)
Initializes an EGO-store as fully empty.
Internal representation of the hash map.
Handle for an operation with the identity service.
Definition: identity_api.c:39
void create_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, void *handle)
Creates a new EGO which will be registered to a store under a specific identifier.
struct GNUNET_IDENTITY_Handle * identity
Handle for the service.
Definition: identity_api.c:95
static const struct GNUNET_CONFIGURATION_Handle * config
GNUNET_MESSENGER_EgoLookupCallback cb
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
GNUnet MESSENGER service.
struct GNUNET_CONTAINER_MultiHashMap * egos
struct GNUNET_HashCode key
The key used in the DHT.
struct GNUNET_MESSENGER_EgoStore * store
struct GNUNET_MESSENGER_EgoLookup * lu_end
struct GNUNET_MESSENGER_Ego * update_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, const struct GNUNET_IDENTITY_PrivateKey *key)
Updates the registration of an EGO to a store under a specific identifier with a new key...
struct GNUNET_MESSENGER_EgoStore * store
configuration data
Definition: configuration.c:84
struct GNUNET_MESSENGER_EgoLookup * next
struct GNUNET_IDENTITY_Operation * operation
struct GNUNET_IDENTITY_EgoLookup * lookup
struct GNUNET_MESSENGER_EgoLookup * lu_start
struct GNUNET_MESSENGER_EgoOperation * op_end
void clear_ego_store(struct GNUNET_MESSENGER_EgoStore *store)
Clears an EGO-store, wipes its content and deallocates its memory.
struct GNUNET_MESSENGER_EgoOperation * next
void lookup_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, GNUNET_MESSENGER_EgoLookupCallback lookup, void *cls)
Lookups an EGO which was registered to a store under a specific identifier.