GNUnet  0.11.x
gnunet-service-messenger_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2020 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_SERVICE_H
27 #define GNUNET_SERVICE_MESSENGER_SERVICE_H
28 
29 #include "platform.h"
31 #include "gnunet_crypto_lib.h"
32 #include "gnunet_container_lib.h"
33 #include "gnunet_disk_lib.h"
35 
36 #include "messenger_api_ego.h"
37 
39 
42 
44 {
47 
49 
50  char *dir;
51 
54 
56 
58 
61 };
62 
71 create_service (const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_SERVICE_Handle *service_handle);
72 
78 void
80 
90 lookup_service_ego (struct GNUNET_MESSENGER_Service *service, const char *identifier);
91 
100 void
101 update_service_ego (struct GNUNET_MESSENGER_Service *service, const char *identifier,
102  const struct GNUNET_IDENTITY_PrivateKey* key);
103 
113 
120 void
122 
131 int
133 
145 
154 void
156  const struct GNUNET_IDENTITY_PublicKey *pubkey);
157 
166 struct GNUNET_ShortHashCode*
168 
179 
189 int
191  const struct GNUNET_HashCode *key);
192 
206 int
208  const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key);
209 
222 int
224  const struct GNUNET_HashCode *key);
225 
233 void
235 
243 void
245 
255 void
257  const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
258 
259 #endif //GNUNET_SERVICE_MESSENGER_SERVICE_H
GNUnet MESSENGER service.
struct GNUNET_CADET_Handle * cadet
Opaque handle to the service.
Definition: cadet_api.c:38
Handle to a service.
Definition: service.c:116
struct GNUNET_MESSENGER_ListHandles handles
A private key for an identity as per LSD0001.
struct GNUNET_MESSENGER_SrvRoom * get_service_room(struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key)
Returns the room identified by a given key for a service.
struct GNUNET_ShortHashCode * generate_service_new_member_id(struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key)
Tries to generate and allocate a new unique member id for a given room of a service identified by its...
Internal representation of the hash map.
struct GNUNET_SCHEDULER_Task * shutdown
A 256-bit hashcode.
cryptographic primitives for GNUnet
void load_service_room_and_messages(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room)
Loads the local configuration for a given room of a service which contains the last messages hash and...
int get_service_peer_identity(const struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer)
Tries to write the peer identity of the peer running a service on to the peer parameter.
struct GNUNET_CONTAINER_MultiHashMap * rooms
void update_service_ego(struct GNUNET_MESSENGER_Service *service, const char *identifier, const struct GNUNET_IDENTITY_PrivateKey *key)
Updates the registration of an EGO to a service under a specific identifier with a new key...
Handle for the service.
Definition: identity_api.c:95
static struct GNUNET_IDENTITY_PublicKey pubkey
Public key of the zone to look in.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
void remove_service_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle)
Removes a handle from a service and destroys it.
struct GNUNET_SERVICE_Handle * service
int open_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Tries to open a room using a given key for a service by a specific handle.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * egos
GNUnet MESSENGER service.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
int close_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Tries to close a room using a given key for a service by a specific handle.
void swap_service_contact_by_pubkey(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvContact *contact, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Changes the public key for a contact known to a service to a specific public key and updates local ma...
int entry_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
Tries to enter a room using a given key for a service by a specific handle.
Handle to a message queue.
Definition: mq.c:85
GNUnet MESSENGER service.
struct GNUNET_MESSENGER_SrvHandle * add_service_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq)
Creates and adds a new handle to a service using a given message queue.
struct GNUNET_MESSENGER_Service * create_service(const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_SERVICE_Handle *service_handle)
Creates and allocates a new service using a given config and a GNUnet service handle.
const struct GNUNET_CONFIGURATION_Handle * config
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CONTAINER_MultiHashMap * contacts
An identity key as per LSD0001.
configuration data
Definition: configuration.c:84
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
Entry in list of pending tasks.
Definition: scheduler.c:134
struct GNUNET_MESSENGER_Ego * lookup_service_ego(struct GNUNET_MESSENGER_Service *service, const char *identifier)
Lookups an EGO which was registered to a service under a specific identifier.
struct GNUNET_MESSENGER_SrvContact * get_service_contact_by_pubkey(struct GNUNET_MESSENGER_Service *service, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Returns a contact of a service identified by a given public key.
void save_service_room_and_messages(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room)
Saves the configuration for a given room of a service which contains the last messages hash and the r...
void destroy_service(struct GNUNET_MESSENGER_Service *service)
Destroys a service and frees its memory fully.
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
struct GNUNET_IDENTITY_Handle * identity
GNUnet MESSENGER service.