GNUnet 0.27.0
 
Loading...
Searching...
No Matches
gnunet-service-cadet_core.h File Reference

cadet service; interaction with CORE service More...

#include "gnunet_util_lib.h"
Include dependency graph for gnunet-service-cadet_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GCO_init (const struct GNUNET_CONFIGURATION_Handle *c)
 Initialize the CORE subsystem.
 
void GCO_shutdown (void)
 Shut down the CORE subsystem.
 

Detailed Description

cadet service; interaction with CORE service

Author
Bartlomiej Polot
Christian Grothoff

All functions in this file should use the prefix GCO (Gnunet Cadet cOre (bottom))

Definition in file gnunet-service-cadet_core.h.

Function Documentation

◆ GCO_init()

void GCO_init ( const struct GNUNET_CONFIGURATION_Handle c)

Initialize the CORE subsystem.

Parameters
cConfiguration.

Definition at line 1262 of file gnunet-service-cadet_core.c.

1263{
1268 NULL),
1269 GNUNET_MQ_hd_fixed_size (connection_create_ack,
1272 NULL),
1273 GNUNET_MQ_hd_fixed_size (connection_broken,
1276 NULL),
1280 NULL),
1281 GNUNET_MQ_hd_fixed_size (tunnel_kx,
1284 NULL),
1285 GNUNET_MQ_hd_fixed_size (tunnel_kx_auth,
1288 NULL),
1289 GNUNET_MQ_hd_var_size (tunnel_encrypted,
1292 NULL),
1294 const struct GNUNET_CORE_ServiceInfo service_info = {
1296 .version = { 1, 0 },
1297 .version_max = { 1, 0 },
1298 .version_min = { 1, 0 },
1299 };
1300
1302 "CADET",
1303 "MAX_ROUTES",
1304 &max_routes))
1305 max_routes = 5000;
1307 "CADET",
1308 "MAX_MSGS_QUEUE",
1309 &max_buffers))
1310 max_buffers = 10000;
1314 NULL,
1315 NULL,
1318 handlers,
1319 &service_info);
1320}
struct GNUNET_MQ_MessageHandlers handlers[]
Definition 003.c:1
static struct CadetConnection * connection_create(struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, enum CadetConnectionState init_state, GCC_ReadyCallback ready_cb, void *ready_cb_cls)
Create a connection to destination via path and notify cb whenever we are ready for more data.
static void * core_connect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq, enum GNUNET_CORE_PeerClass class)
Method called whenever a given peer connects.
static struct GNUNET_CORE_Handle * core
Handle to the CORE service.
static struct GNUNET_CONTAINER_Heap * route_heap
Heap of routes, MIN-sorted by last activity.
static unsigned long long max_routes
Maximum number of concurrent routes this peer will support.
static void core_disconnect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls)
Method called whenever a peer disconnects.
static struct GNUNET_CONTAINER_MultiShortmap * routes
Routes on which this peer is an intermediate.
static unsigned long long max_buffers
Maximum number of envelopes we will buffer at this peer.
static void connection_destroy(struct Connection *connection)
Destroy a connection.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
struct GNUNET_CORE_Handle * GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_StartupCallback init, GNUNET_CORE_ConnectEventHandler connects, GNUNET_CORE_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers, const struct GNUNET_CORE_ServiceInfo *service_info)
Connect to the core service.
Definition core_api.c:698
@ GNUNET_CORE_SERVICE_CADET
Identifier for cadet service.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
@ GNUNET_CONTAINER_HEAP_ORDER_MIN
Heap with the minimum cost at the root.
@ GNUNET_OK
@ GNUNET_NO
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK
Send origin an ACK that the connection is complete.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN
Notify that a connection is no longer valid.
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX
Axolotl key exchange.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY
Request the destruction of a connection.
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH
Axolotl key exchange response with authentication.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
Request the creation of a connection.
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED
Axolotl encrypted data.
Message for notifying a disconnection in a path.
Message for ack'ing a connection.
Message for cadet connection creation.
Message to destroy a connection.
Axolotl-encrypted tunnel message with application payload.
Message for a Key eXchange for a tunnel, with authentication.
Message for a Key eXchange for a tunnel.
Gnunet service info - identifying compatibility with a range of version of a service communicating ov...
enum GNUNET_CORE_Service service
Identifier of the service on top of CORE.
Message handler for a specific message type.

References connection_create(), connection_destroy(), core, core_connect_cb(), core_disconnect_cb(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_multishortmap_create(), GNUNET_CORE_connect(), GNUNET_CORE_SERVICE_CADET, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_OK, handlers, max_buffers, max_routes, route_heap, routes, and GNUNET_CORE_ServiceInfo::service.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GCO_shutdown()

void GCO_shutdown ( void  )

Shut down the CORE subsystem.

Definition at line 1324 of file gnunet-service-cadet_core.c.

1325{
1326 if (NULL != core)
1327 {
1329 core = NULL;
1330 }
1333 routes = NULL;
1335 route_heap = NULL;
1336 if (NULL != timeout_task)
1337 {
1339 timeout_task = NULL;
1340 }
1341}
static struct GNUNET_SCHEDULER_Task * timeout_task
Task to timeout routes.
void GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle)
Disconnect from the core service.
Definition core_api.c:744
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
unsigned int GNUNET_CONTAINER_multishortmap_size(const struct GNUNET_CONTAINER_MultiShortmap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition scheduler.c:986

References core, GNUNET_assert, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_CORE_disconnect(), GNUNET_SCHEDULER_cancel(), route_heap, routes, and timeout_task.

Referenced by shutdown_task().

Here is the call graph for this function:
Here is the caller graph for this function: