GNUnet  0.11.x
messenger_api_handle.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_MESSENGER_API_HANDLE_H
27 #define GNUNET_MESSENGER_API_HANDLE_H
28 
29 #include "platform.h"
30 #include "gnunet_cadet_service.h"
31 #include "gnunet_container_lib.h"
32 #include "gnunet_crypto_lib.h"
34 #include "gnunet_peer_lib.h"
35 
37 
38 #include "messenger_api_contact.h"
39 #include "messenger_api_room.h"
40 
42 {
44 
46 
48  void *identity_cls;
49 
51  void *msg_cls;
52 
53  char *name;
55 
58 
61 };
62 
75 
81 void
83 
90 void
91 set_handle_name (struct GNUNET_MESSENGER_Handle *handle, const char *name);
92 
99 const char*
101 
108 void
110 
117 const struct GNUNET_IDENTITY_PublicKey*
119 
130  const struct GNUNET_IDENTITY_PublicKey *pubkey);
131 
140 void
142  const struct GNUNET_IDENTITY_PublicKey *pubkey);
143 
150 void
152 
161 void
163  const struct GNUNET_HashCode *key);
164 
171 void
173 
174 #endif //GNUNET_MESSENGER_API_HANDLE_H
void entry_handle_room_at(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
Adds a tunnel for a room known to a handle identified by a given key to a list of opened connections...
struct GNUNET_CONTAINER_MultiHashMap * contacts
struct GNUNET_SCHEDULER_Task * reconnect_task
void open_handle_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Marks a room known to a handle identified by a given key as open.
Internal representation of the hash map.
struct GNUNET_MQ_Handle * mq
cryptographic primitives for GNUnet
void(* GNUNET_MESSENGER_MessageCallback)(void *cls, const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Method called whenever a message is sent or received from a room.
GNUNET_MESSENGER_MessageCallback msg_callback
messenger api: client implementation of GNUnet MESSENGER service
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_CONTAINER_MultiHashMap * rooms
A 512-bit hashcode.
void destroy_handle(struct GNUNET_MESSENGER_Handle *handle)
Destroys a handle and frees its memory fully from the client API.
struct GNUNET_TIME_Relative reconnect_time
void swap_handle_contact_by_pubkey(struct GNUNET_MESSENGER_Handle *handle, struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Changes the public key for a contact known to a handle to a specific public key and updates local map...
struct GNUNET_HashCode key
The key used in the DHT.
void(* GNUNET_MESSENGER_IdentityCallback)(void *cls, struct GNUNET_MESSENGER_Handle *handle)
Method called whenever the EGO of a handle changes or if the first connection fails to load a valid E...
struct GNUNET_MESSENGER_Handle * create_handle(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_MESSENGER_IdentityCallback identity_callback, void *identity_cls, GNUNET_MESSENGER_MessageCallback msg_callback, void *msg_cls)
Creates and allocates a new handle using a given configuration and a custom message callback with a g...
const struct GNUNET_CONFIGURATION_Handle * cfg
Handle to a message queue.
Definition: mq.c:85
The identity of the host (wraps the signing key of the peer).
An identity key as per LSD0001.
void close_handle_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Destroys and so implicitly closes a room known to a handle identified by a given key.
configuration data
Definition: configuration.c:84
Entry in list of pending tasks.
Definition: scheduler.c:134
struct GNUNET_MESSENGER_Contact * get_handle_contact_by_pubkey(const struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Returns a contact known to a handle identified by a given public key.
const char * get_handle_name(const struct GNUNET_MESSENGER_Handle *handle)
Returns the current name of a given handle or NULL if no valid name was assigned yet.
struct GNUNET_IDENTITY_PublicKey * pubkey
const struct GNUNET_IDENTITY_PublicKey * get_handle_key(const struct GNUNET_MESSENGER_Handle *handle)
Returns the public key of a given handle.
messenger api: client implementation of GNUnet MESSENGER service
GNUNET_MESSENGER_IdentityCallback identity_callback
void set_handle_key(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Sets the public key of a given handle to a specific public key.
Time for relative time used by GNUnet, in microseconds.
void set_handle_name(struct GNUNET_MESSENGER_Handle *handle, const char *name)
Sets the name of a handle to a specific name.