GNUnet 0.26.2-1-g232dc9ef2
 
Loading...
Searching...
No Matches
gnunet-service-identity.c File Reference

identity management service More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_statistics_service.h"
#include "identity.h"
Include dependency graph for gnunet-service-identity.c:

Go to the source code of this file.

Data Structures

struct  Ego
 Information we keep about each ego. More...
 
struct  RenameContext
 Closure for 'handle_ego_rename'. More...
 

Functions

static char * get_ego_filename (struct Ego *ego)
 Get the name of the file we use to store a given ego.
 
static void client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
 Called whenever a client is disconnected.
 
static void * client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
 Add a client to our list of active clients.
 
static void shutdown_task (void *cls)
 Task run during shutdown.
 
static void send_result_code (struct GNUNET_SERVICE_Client *client, uint32_t result_code)
 Send a result code back to the client.
 
static struct GNUNET_MQ_Envelopecreate_update_message (struct Ego *ego)
 Create an update message with information about the current state of an ego.
 
static void handle_start_message (void *cls, const struct GNUNET_MessageHeader *message)
 Handler for START message from client, sends information about all identities to the client immediately and adds the client to the notification context for future updates.
 
static int check_lookup_message (void *cls, const struct LookupMessage *message)
 Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.
 
static void handle_lookup_message (void *cls, const struct LookupMessage *message)
 Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.
 
static int check_lookup_by_suffix_message (void *cls, const struct LookupMessage *message)
 Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.
 
static void handle_lookup_by_suffix_message (void *cls, const struct LookupMessage *message)
 Handler for LOOKUP_BY_SUFFIX message from client, sends information about ONE identity to the client immediately.
 
static void notify_listeners (struct Ego *ego)
 Send an updated message for the given ego to all listeners.
 
static int check_create_message (void *cls, const struct CreateRequestMessage *msg)
 Checks a GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message.
 
static void handle_create_message (void *cls, const struct CreateRequestMessage *crm)
 Handler for CREATE message from client, creates new identity.
 
static void handle_ego_rename (void *cls, const char *section)
 An ego was renamed; rename it in all subsystems where it is currently set as the default.
 
static int check_rename_message (void *cls, const struct RenameMessage *msg)
 Checks a GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message.
 
static void handle_rename_message (void *cls, const struct RenameMessage *rm)
 Handler for RENAME message from client, creates new identity.
 
static void handle_ego_delete (void *cls, const char *section)
 An ego was removed, remove it from all subsystems where it is currently set as the default.
 
static int check_delete_message (void *cls, const struct DeleteMessage *msg)
 Checks a GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message.
 
static void handle_delete_message (void *cls, const struct DeleteMessage *dm)
 Handler for DELETE message from client, creates new identity.
 
static int read_from_file (const char *filename, void *buf, size_t buf_size)
 
static int process_ego_file (void *cls, const char *filename)
 Process the given file from the "EGODIR".
 
static void run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service)
 Handle network size estimate clients.
 
 GNUNET_SERVICE_MAIN (GNUNET_OS_project_data_gnunet(), "identity", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_fixed_size(start_message, GNUNET_MESSAGE_TYPE_IDENTITY_START, struct GNUNET_MessageHeader, NULL), GNUNET_MQ_hd_var_size(lookup_message, GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP, struct LookupMessage, NULL), GNUNET_MQ_hd_var_size(lookup_by_suffix_message, GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP_BY_SUFFIX, struct LookupMessage, NULL), GNUNET_MQ_hd_var_size(create_message, GNUNET_MESSAGE_TYPE_IDENTITY_CREATE, struct CreateRequestMessage, NULL), GNUNET_MQ_hd_var_size(rename_message, GNUNET_MESSAGE_TYPE_IDENTITY_RENAME, struct RenameMessage, NULL), GNUNET_MQ_hd_var_size(delete_message, GNUNET_MESSAGE_TYPE_IDENTITY_DELETE, struct DeleteMessage, NULL), GNUNET_MQ_handler_end())
 Define "main" method using service macro.
 

Variables

static const struct GNUNET_CONFIGURATION_Handlecfg
 Handle to our current configuration.
 
static struct GNUNET_CONFIGURATION_Handlesubsystem_cfg
 Handle to subsystem configuration which for each subsystem contains the name of the default ego.
 
static struct GNUNET_STATISTICS_Handlestats
 Handle to the statistics service.
 
static struct GNUNET_NotificationContextnc
 Notification context, simplifies client broadcasts.
 
static char * ego_directory
 Directory where we store the identities.
 
static char * subsystem_cfg_file
 Configuration file name where subsystem information is kept.
 
static struct Egoego_head
 Head of DLL of all egos.
 
static struct Egoego_tail
 Tail of DLL of all egos.
 

Detailed Description

identity management service

Author
Christian Grothoff

The purpose of this service is to manage private keys that represent the various egos/pseudonyms/identities of a GNUnet user.

Todo:

  • auto-initialze default egos; maybe trigger default initializations (such as gnunet-gns-import.sh?)

Definition in file gnunet-service-identity.c.

Function Documentation

◆ get_ego_filename()

static char * get_ego_filename ( struct Ego ego)
static

Get the name of the file we use to store a given ego.

Parameters
egoego for which we need the filename
Returns
full filename for the given ego

Definition at line 116 of file gnunet-service-identity.c.

117{
118 char *filename;
119
121 "%s%s%s",
124 ego->identifier);
125 return filename;
126}
static char * filename
static char * ego_directory
Directory where we store the identities.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define DIR_SEPARATOR_STR
Definition platform.h:167
char * identifier
String identifier for the ego.

References DIR_SEPARATOR_STR, ego_directory, filename, GNUNET_asprintf(), and Ego::identifier.

Referenced by handle_create_message(), handle_delete_message(), and handle_rename_message().

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

◆ client_disconnect_cb()

static void client_disconnect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
void *  app_ctx 
)
static

Called whenever a client is disconnected.

Parameters
clsclosure
clientidentification of the client
app_ctxclient

Definition at line 137 of file gnunet-service-identity.c.

140{
142 "Client %p disconnected\n",
143 client);
144}
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG

References GNUNET_ERROR_TYPE_DEBUG, and GNUNET_log.

◆ client_connect_cb()

static void * client_connect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
struct GNUNET_MQ_Handle mq 
)
static

Add a client to our list of active clients.

Parameters
clsNULL
clientclient to add
mqmessage queue for client
Returns
internal namestore client structure for this client

Definition at line 156 of file gnunet-service-identity.c.

159{
160 return client;
161}

◆ shutdown_task()

static void shutdown_task ( void *  cls)
static

Task run during shutdown.

Parameters
clsunused

Definition at line 170 of file gnunet-service-identity.c.

171{
172 struct Ego *e;
173
174 if (NULL != nc)
175 {
177 nc = NULL;
178 }
179 if (NULL != stats)
180 {
182 stats = NULL;
183 }
185 subsystem_cfg = NULL;
187 subsystem_cfg_file = NULL;
189 ego_directory = NULL;
190 while (NULL != (e = ego_head))
191 {
193 ego_tail,
194 e);
196 GNUNET_free (e);
197 }
198}
static struct Ego * ego_tail
Tail of DLL of all egos.
static struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
static struct GNUNET_NotificationContext * nc
Notification context, simplifies client broadcasts.
static char * subsystem_cfg_file
Configuration file name where subsystem information is kept.
static struct Ego * ego_head
Head of DLL of all egos.
static struct GNUNET_CONFIGURATION_Handle * subsystem_cfg
Handle to subsystem configuration which for each subsystem contains the name of the default ego.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
@ GNUNET_NO
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc)
Destroy the context, force disconnect for all subscribers.
Definition nc.c:138
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
Information we keep about each ego.

References ego_directory, ego_head, ego_tail, GNUNET_CONFIGURATION_destroy(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NO, GNUNET_notification_context_destroy(), GNUNET_STATISTICS_destroy(), Ego::identifier, nc, stats, subsystem_cfg, and subsystem_cfg_file.

Here is the call graph for this function:

◆ send_result_code()

static void send_result_code ( struct GNUNET_SERVICE_Client client,
uint32_t  result_code 
)
static

Send a result code back to the client.

Parameters
clientclient that should receive the result code
result_codecode to transmit

Definition at line 208 of file gnunet-service-identity.c.

210{
211 struct ResultCodeMessage *rcm;
212 struct GNUNET_MQ_Envelope *env;
213
214 env =
216 rcm->result_code = htonl (result_code);
218 "Sending result %d (%s) to client\n",
219 (int) result_code,
220 GNUNET_ErrorCode_get_hint (result_code));
222}
struct GNUNET_MQ_Envelope * env
Definition 005.c:1
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition mq.c:305
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE
Generic response from identity service with success and/or error message.
struct GNUNET_MQ_Handle * GNUNET_SERVICE_client_get_mq(struct GNUNET_SERVICE_Client *c)
Obtain the message queue of c.
Definition service.c:2544
Answer from service to client about last operation; GET_DEFAULT maybe answered with this message on f...
Definition identity.h:79
uint32_t result_code
Status code for the last operation, in NBO.
Definition identity.h:89

References env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ErrorCode_get_hint(), GNUNET_log, GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_get_mq(), and ResultCodeMessage::result_code.

Referenced by handle_create_message(), handle_delete_message(), handle_lookup_by_suffix_message(), handle_lookup_message(), and handle_rename_message().

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

◆ create_update_message()

static struct GNUNET_MQ_Envelope * create_update_message ( struct Ego ego)
static

Create an update message with information about the current state of an ego.

Parameters
egoego to create message for
Returns
corresponding update message

Definition at line 232 of file gnunet-service-identity.c.

233{
234 struct UpdateMessage *um;
235 struct GNUNET_MQ_Envelope *env;
236 size_t name_len;
237 ssize_t key_len;
238
240 name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1);
241 env = GNUNET_MQ_msg_extra (um, name_len + key_len,
243 um->name_len = htons (name_len);
244 um->end_of_list = htons (GNUNET_NO);
245 um->key_len = htons (key_len);
246 GNUNET_memcpy (&um[1], ego->identifier, name_len);
248 ((char*) &um[1]) + name_len,
249 key_len);
250 return env;
251}
ssize_t GNUNET_CRYPTO_write_blindable_sk_to_buffer(const struct GNUNET_CRYPTO_BlindablePrivateKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_BlindablePrivateKey to a compact buffer.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
ssize_t GNUNET_CRYPTO_blindable_sk_get_length(const struct GNUNET_CRYPTO_BlindablePrivateKey *key)
Get the compacted length of a GNUNET_CRYPTO_BlindablePrivateKey.
Definition crypto_pkey.c:64
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE
Update about identity status from service to clients.
struct GNUNET_CRYPTO_BlindablePrivateKey pk
Private key of the ego.
Service informs client about status of a pseudonym.
Definition identity.h:112
uint16_t end_of_list
Usually GNUNET_NO, GNUNET_YES to signal end of list.
Definition identity.h:127
uint16_t key_len
Key length.
Definition identity.h:132
uint16_t name_len
Number of bytes in ego name string including 0-termination, in NBO; 0 if the ego was deleted.
Definition identity.h:122

References UpdateMessage::end_of_list, env, GNUNET_CRYPTO_blindable_sk_get_length(), GNUNET_CRYPTO_write_blindable_sk_to_buffer(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, GNUNET_MQ_msg_extra, GNUNET_NO, Ego::identifier, UpdateMessage::key_len, UpdateMessage::name_len, and Ego::pk.

Referenced by handle_lookup_by_suffix_message(), handle_lookup_message(), and handle_start_message().

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

◆ handle_start_message()

static void handle_start_message ( void *  cls,
const struct GNUNET_MessageHeader message 
)
static

Handler for START message from client, sends information about all identities to the client immediately and adds the client to the notification context for future updates.

Parameters
clsa struct GNUNET_SERVICE_Client *
messagethe message received

Definition at line 264 of file gnunet-service-identity.c.

266{
267 struct GNUNET_SERVICE_Client *client = cls;
268
270 "Received START message from client\n");
275 for (struct Ego *ego = ego_head; NULL != ego; ego = ego->next)
276 {
279 }
280 {
281 struct UpdateMessage *ume;
282 struct GNUNET_MQ_Envelope *env;
283
285 0,
287 ume->end_of_list = htons (GNUNET_YES);
288 ume->name_len = htons (0);
289 ume->key_len = htons (0);
291 env);
292 }
294}
static struct GNUNET_MQ_Envelope * create_update_message(struct Ego *ego)
Create an update message with information about the current state of an ego.
@ GNUNET_YES
void GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc, struct GNUNET_MQ_Handle *mq)
Add a subscriber to the notification context.
Definition nc.c:161
void GNUNET_SERVICE_client_mark_monitor(struct GNUNET_SERVICE_Client *c)
Set the 'monitor' flag on this client.
Definition service.c:2527
void GNUNET_SERVICE_client_disable_continue_warning(struct GNUNET_SERVICE_Client *c)
Disable the warning the server issues if a message is not acknowledged in a timely fashion.
Definition service.c:2450
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition service.c:2433
struct Ego * next
We keep egos in a DLL.
Handle to a client that is connected to a service.
Definition service.c:249

References create_update_message(), ego_head, UpdateMessage::end_of_list, env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_notification_context_add(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_disable_continue_warning(), GNUNET_SERVICE_client_get_mq(), GNUNET_SERVICE_client_mark_monitor(), GNUNET_YES, UpdateMessage::key_len, UpdateMessage::name_len, nc, and Ego::next.

Here is the call graph for this function:

◆ check_lookup_message()

static int check_lookup_message ( void *  cls,
const struct LookupMessage message 
)
static

Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.

Parameters
clsunused
messagethe message received
Returns
GNUNET_SYSERR if message was ill-formed

Definition at line 306 of file gnunet-service-identity.c.

308{
310 return GNUNET_OK;
311}
@ GNUNET_OK
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...

References GNUNET_MQ_check_zero_termination, and GNUNET_OK.

◆ handle_lookup_message()

static void handle_lookup_message ( void *  cls,
const struct LookupMessage message 
)
static

Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.

Parameters
clsa struct GNUNET_SERVICE_Client *
messagethe message received

Definition at line 322 of file gnunet-service-identity.c.

324{
325 struct GNUNET_SERVICE_Client *client = cls;
326 const char *name;
327 struct GNUNET_MQ_Envelope *env;
328 struct Ego *ego;
329
331 "Received LOOKUP message from client\n");
332 name = (const char *) &message[1];
333 for (ego = ego_head; NULL != ego; ego = ego->next)
334 {
335 if (0 != strcasecmp (name, ego->identifier))
336 continue;
340 return;
341 }
344}
static char * name
Name (label) of the records to list.
static void send_result_code(struct GNUNET_SERVICE_Client *client, uint32_t result_code)
Send a result code back to the client.
@ GNUNET_EC_IDENTITY_NOT_FOUND
Ego not found.

References create_update_message(), ego_head, env, GNUNET_EC_IDENTITY_NOT_FOUND, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_get_mq(), Ego::identifier, name, Ego::next, and send_result_code().

Here is the call graph for this function:

◆ check_lookup_by_suffix_message()

static int check_lookup_by_suffix_message ( void *  cls,
const struct LookupMessage message 
)
static

Handler for LOOKUP message from client, sends information about ONE identity to the client immediately.

Parameters
clsunused
messagethe message received
Returns
GNUNET_SYSERR if message was ill-formed

Definition at line 356 of file gnunet-service-identity.c.

358{
360 return GNUNET_OK;
361}

References GNUNET_MQ_check_zero_termination, and GNUNET_OK.

◆ handle_lookup_by_suffix_message()

static void handle_lookup_by_suffix_message ( void *  cls,
const struct LookupMessage message 
)
static

Handler for LOOKUP_BY_SUFFIX message from client, sends information about ONE identity to the client immediately.

Parameters
clsa struct GNUNET_SERVICE_Client *
messagethe message received

Definition at line 372 of file gnunet-service-identity.c.

374{
375 struct GNUNET_SERVICE_Client *client = cls;
376 const char *name;
377 struct GNUNET_MQ_Envelope *env;
378 struct Ego *lprefix;
379
381 "Received LOOKUP_BY_SUFFIX message from client\n");
382 name = (const char *) &message[1];
383 lprefix = NULL;
384 for (struct Ego *ego = ego_head; NULL != ego; ego = ego->next)
385 {
386 if ((strlen (ego->identifier) <= strlen (name)) &&
387 (0 == strcmp (ego->identifier,
388 &name[strlen (name) - strlen (ego->identifier)])) &&
389 ((strlen (name) == strlen (ego->identifier)) ||
390 ('.' == name[strlen (name) - strlen (ego->identifier) - 1])) &&
391 ((NULL == lprefix) ||
392 (strlen (ego->identifier) > strlen (lprefix->identifier))))
393 {
394 /* found better match, update! */
395 lprefix = ego;
396 }
397 }
398 if (NULL != lprefix)
399 {
400 env = create_update_message (lprefix);
403 return;
404 }
407}

References create_update_message(), ego_head, env, GNUNET_EC_IDENTITY_NOT_FOUND, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_get_mq(), Ego::identifier, name, Ego::next, and send_result_code().

Here is the call graph for this function:

◆ notify_listeners()

static void notify_listeners ( struct Ego ego)
static

Send an updated message for the given ego to all listeners.

Parameters
egoego to send the update for

Definition at line 416 of file gnunet-service-identity.c.

417{
418 struct UpdateMessage *um;
419 size_t name_len;
420 ssize_t key_len;
421
422 name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1);
424 um = GNUNET_malloc (sizeof(struct UpdateMessage) + name_len + key_len);
426 um->header.size = htons (sizeof(struct UpdateMessage) + name_len + key_len);
427 um->name_len = htons (name_len);
428 um->end_of_list = htons (GNUNET_NO);
429 um->key_len = htons (key_len);
430 GNUNET_memcpy (&um[1], ego->identifier, name_len);
432 ((char*) &um[1]) + name_len,
433 key_len);
435 GNUNET_free (um);
436}
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_malloc(size)
Wrapper around malloc.
void GNUNET_notification_context_broadcast(struct GNUNET_NotificationContext *nc, const struct GNUNET_MessageHeader *msg, int can_drop)
Send a message to all subscribers of this context.
Definition nc.c:190
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE.
Definition identity.h:116

References UpdateMessage::end_of_list, GNUNET_CRYPTO_blindable_sk_get_length(), GNUNET_CRYPTO_write_blindable_sk_to_buffer(), GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, GNUNET_NO, GNUNET_notification_context_broadcast(), UpdateMessage::header, Ego::identifier, UpdateMessage::key_len, UpdateMessage::name_len, nc, Ego::pk, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.

Referenced by handle_create_message(), handle_delete_message(), and handle_rename_message().

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

◆ check_create_message()

static int check_create_message ( void *  cls,
const struct CreateRequestMessage msg 
)
static

Checks a GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message.

Parameters
clsclient sending the message
msgmessage of type struct CreateRequestMessage
Returns
GNUNET_OK if msg is well-formed

Definition at line 447 of file gnunet-service-identity.c.

449{
450 uint16_t size;
451 uint16_t name_len;
452 size_t key_len;
453 const char *str;
454
455 size = ntohs (msg->header.size);
456 if (size <= sizeof(struct CreateRequestMessage))
457 {
458 GNUNET_break (0);
459 return GNUNET_SYSERR;
460 }
461 name_len = ntohs (msg->name_len);
462 key_len = ntohs (msg->key_len);
463 if (name_len + key_len + sizeof(struct CreateRequestMessage) != size)
464 {
465 GNUNET_break (0);
466 return GNUNET_SYSERR;
467 }
468 str = (const char *) &msg[1] + key_len;
469 if ('\0' != str[name_len - 1])
470 {
471 GNUNET_break (0);
472 return GNUNET_SYSERR;
473 }
474 return GNUNET_OK;
475}
struct GNUNET_MessageHeader * msg
Definition 005.c:2
@ GNUNET_SYSERR
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
static unsigned int size
Size of the "table".
Definition peer.c:68
Client requests creation of an identity.
Definition identity.h:149
const char * str
Definition time.c:1252

References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, UpdateMessage::key_len, msg, UpdateMessage::name_len, GNUNET_MessageHeader::size, size, and str.

◆ handle_create_message()

static void handle_create_message ( void *  cls,
const struct CreateRequestMessage crm 
)
static

Handler for CREATE message from client, creates new identity.

Parameters
clsunused
crmthe message received

Definition at line 485 of file gnunet-service-identity.c.

487{
488 struct GNUNET_CRYPTO_BlindablePrivateKey private_key;
489 struct GNUNET_SERVICE_Client *client = cls;
490 struct Ego *ego;
491 char *str;
492 char *fn;
493 size_t key_len;
494 size_t kb_read;
495
496 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREATE message from client\n");
497 key_len = ntohs (crm->key_len);
498 if ((GNUNET_SYSERR ==
500 key_len,
501 &private_key,
502 &kb_read)) ||
503 (kb_read != key_len))
504 {
506 return;
507 }
508 str = GNUNET_STRINGS_utf8_tolower ((const char *) &crm[1] + key_len);
509 for (ego = ego_head; NULL != ego; ego = ego->next)
510 {
511 if (0 == strcmp (ego->identifier, str))
512 {
513 send_result_code (client,
517 return;
518 }
519 }
520 ego = GNUNET_new (struct Ego);
521 ego->pk = private_key;
524 ego_tail,
525 ego);
527 fn = get_ego_filename (ego);
528 if (GNUNET_OK !=
530 &private_key,
535 GNUNET_free (fn);
537 notify_listeners (ego);
539}
static void notify_listeners(struct Ego *ego)
Send an updated message for the given ego to all listeners.
static char * get_ego_filename(struct Ego *ego)
Get the name of the file we use to store a given ego.
@ GNUNET_EC_NONE
No error (success).
@ GNUNET_EC_IDENTITY_NAME_CONFLICT
Identifier already in use for another ego.
enum GNUNET_GenericReturnValue GNUNET_DISK_fn_write(const char *fn, const void *buf, size_t buf_size, enum GNUNET_DISK_AccessPermissions mode)
Write a buffer to a file atomically.
Definition disk.c:750
@ GNUNET_DISK_PERM_USER_READ
Owner can read.
@ GNUNET_DISK_PERM_USER_WRITE
Owner can write.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_private_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePrivateKey *key, size_t *read)
Reads a GNUNET_CRYPTO_BlindablePrivateKey from a compact buffer.
#define GNUNET_log_strerror_file(level, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition service.c:2462
char * GNUNET_STRINGS_utf8_tolower(const char *input)
Convert the utf-8 input string to lower case.
Definition strings.c:475
uint16_t key_len
Key length.
Definition identity.h:163
A private key for an identity as per LSD0001.

References ego_head, ego_tail, get_ego_filename(), GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_DISK_fn_write(), GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_EC_IDENTITY_NAME_CONFLICT, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_log_strerror_file, GNUNET_new, GNUNET_OK, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_strdup, GNUNET_STRINGS_utf8_tolower(), GNUNET_SYSERR, Ego::identifier, CreateRequestMessage::key_len, Ego::next, notify_listeners(), Ego::pk, send_result_code(), and str.

Here is the call graph for this function:

◆ handle_ego_rename()

static void handle_ego_rename ( void *  cls,
const char *  section 
)
static

An ego was renamed; rename it in all subsystems where it is currently set as the default.

Parameters
clsthe 'struct RenameContext'
sectiona section in the configuration to process

Definition at line 566 of file gnunet-service-identity.c.

567{
568 struct RenameContext *rc = cls;
569 char *id;
570
572 section,
573 "DEFAULT_IDENTIFIER",
574 &id))
575 return;
576 if (0 != strcmp (id, rc->old_name))
577 {
578 GNUNET_free (id);
579 return;
580 }
582 section,
583 "DEFAULT_IDENTIFIER",
584 rc->new_name);
585 GNUNET_free (id);
586}
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
void GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
Set a configuration value that should be a string.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
Closure for 'handle_ego_rename'.
const char * old_name
Old name.
const char * new_name
New name.

References GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_free, GNUNET_OK, id, RenameContext::new_name, RenameContext::old_name, and subsystem_cfg.

Referenced by handle_rename_message().

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

◆ check_rename_message()

static int check_rename_message ( void *  cls,
const struct RenameMessage msg 
)
static

Checks a GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message.

Parameters
clsclient sending the message
msgmessage of type struct RenameMessage
Returns
GNUNET_OK if msg is well-formed

Definition at line 597 of file gnunet-service-identity.c.

598{
599 uint16_t size;
600 uint16_t old_name_len;
601 uint16_t new_name_len;
602 const char *old_name;
603 const char *new_name;
604
605 size = ntohs (msg->header.size);
606 if (size <= sizeof(struct RenameMessage))
607 {
608 GNUNET_break (0);
609 return GNUNET_SYSERR;
610 }
611 old_name_len = ntohs (msg->old_name_len);
612 new_name_len = ntohs (msg->new_name_len);
613 old_name = (const char *) &msg[1];
614 new_name = &old_name[old_name_len];
615 if ((old_name_len + new_name_len + sizeof(struct RenameMessage) != size) ||
616 ('\0' != old_name[old_name_len - 1]) ||
617 ('\0' != new_name[new_name_len - 1]))
618 {
619 GNUNET_break (0);
620 return GNUNET_SYSERR;
621 }
622
623 return GNUNET_OK;
624}
Client requests renaming of an identity.
Definition identity.h:176

References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, RenameContext::new_name, RenameContext::old_name, GNUNET_MessageHeader::size, and size.

◆ handle_rename_message()

static void handle_rename_message ( void *  cls,
const struct RenameMessage rm 
)
static

Handler for RENAME message from client, creates new identity.

Parameters
clsunused
rmthe message received

Definition at line 635 of file gnunet-service-identity.c.

636{
637 uint16_t old_name_len;
638 struct Ego *ego;
639 char *old_name;
640 char *new_name;
641 struct RenameContext rename_ctx;
642 struct GNUNET_SERVICE_Client *client = cls;
643 char *fn_old;
644 char *fn_new;
645 const char *old_name_tmp;
646
647 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received RENAME message from client\n");
648 old_name_len = ntohs (rm->old_name_len);
649 old_name_tmp = (const char *) &rm[1];
650 old_name = GNUNET_STRINGS_utf8_tolower (old_name_tmp);
651 new_name = GNUNET_STRINGS_utf8_tolower (&old_name_tmp[old_name_len]);
652
653 /* check if new name is already in use */
654 for (ego = ego_head; NULL != ego; ego = ego->next)
655 {
656 if (0 == strcmp (ego->identifier, new_name))
657 {
660 GNUNET_free (old_name);
661 GNUNET_free (new_name);
662 return;
663 }
664 }
665
666 /* locate old name and, if found, perform rename */
667 for (ego = ego_head; NULL != ego; ego = ego->next)
668 {
669 if (0 == strcmp (ego->identifier, old_name))
670 {
671 fn_old = get_ego_filename (ego);
672 GNUNET_free (ego->identifier);
673 rename_ctx.old_name = old_name;
674 rename_ctx.new_name = new_name;
677 &rename_ctx);
678 if (GNUNET_OK !=
680 GNUNET_log (
682 _ ("Failed to write subsystem default identifier map to `%s'.\n"),
684 ego->identifier = GNUNET_strdup (new_name);
685 fn_new = get_ego_filename (ego);
686 if (0 != rename (fn_old, fn_new))
688 GNUNET_free (fn_old);
689 GNUNET_free (fn_new);
690 GNUNET_free (old_name);
691 GNUNET_free (new_name);
692 notify_listeners (ego);
695 return;
696 }
697 }
698
699 /* failed to locate old name */
701 GNUNET_free (old_name);
702 GNUNET_free (new_name);
704}
static void handle_ego_rename(void *cls, const char *section)
An ego was renamed; rename it in all subsystems where it is currently set as the default.
void GNUNET_CONFIGURATION_iterate_sections(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_SectionIterator iter, void *iter_cls)
Iterate over all sections in the configuration.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Write configuration file.
@ GNUNET_ERROR_TYPE_WARNING
#define _(String)
GNU gettext support macro.
Definition platform.h:179
uint16_t old_name_len
Number of characters in the old name including 0-termination, in NBO.
Definition identity.h:185

References _, ego_head, get_ego_filename(), GNUNET_CONFIGURATION_iterate_sections(), GNUNET_CONFIGURATION_write(), GNUNET_EC_IDENTITY_NAME_CONFLICT, GNUNET_EC_IDENTITY_NOT_FOUND, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_log_strerror_file, GNUNET_OK, GNUNET_SERVICE_client_continue(), GNUNET_strdup, GNUNET_STRINGS_utf8_tolower(), handle_ego_rename(), Ego::identifier, RenameContext::new_name, Ego::next, notify_listeners(), RenameContext::old_name, RenameMessage::old_name_len, send_result_code(), subsystem_cfg, and subsystem_cfg_file.

Here is the call graph for this function:

◆ handle_ego_delete()

static void handle_ego_delete ( void *  cls,
const char *  section 
)
static

An ego was removed, remove it from all subsystems where it is currently set as the default.

Parameters
clsname of the removed ego (const char *)
sectiona section in the configuration to process

Definition at line 715 of file gnunet-service-identity.c.

716{
717 const char *identifier = cls;
718 char *id;
719
721 section,
722 "DEFAULT_IDENTIFIER",
723 &id))
724 return;
725 if (0 != strcmp (id, identifier))
726 {
727 GNUNET_free (id);
728 return;
729 }
731 section,
732 "DEFAULT_IDENTIFIER",
733 NULL);
734 GNUNET_free (id);
735}

References GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_free, GNUNET_OK, id, and subsystem_cfg.

Referenced by handle_delete_message().

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

◆ check_delete_message()

static int check_delete_message ( void *  cls,
const struct DeleteMessage msg 
)
static

Checks a GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message.

Parameters
clsclient sending the message
msgmessage of type struct DeleteMessage
Returns
GNUNET_OK if msg is well-formed

Definition at line 746 of file gnunet-service-identity.c.

747{
748 uint16_t size;
749 uint16_t name_len;
750 const char *name;
751
752 size = ntohs (msg->header.size);
753 if (size <= sizeof(struct DeleteMessage))
754 {
755 GNUNET_break (0);
756 return GNUNET_SYSERR;
757 }
758 name = (const char *) &msg[1];
759 name_len = ntohs (msg->name_len);
760 if ((name_len + sizeof(struct DeleteMessage) != size) ||
761 (0 != ntohs (msg->reserved)) || ('\0' != name[name_len - 1]))
762 {
763 GNUNET_break (0);
764 return GNUNET_SYSERR;
765 }
766 return GNUNET_OK;
767}
Client requests deletion of an identity.
Definition identity.h:202

References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, name, GNUNET_MessageHeader::size, and size.

◆ handle_delete_message()

static void handle_delete_message ( void *  cls,
const struct DeleteMessage dm 
)
static

Handler for DELETE message from client, creates new identity.

Parameters
clsunused
dmthe message received

Definition at line 778 of file gnunet-service-identity.c.

779{
780 struct Ego *ego;
781 char *name;
782 char *fn;
783 struct GNUNET_SERVICE_Client *client = cls;
784
786 "Received DELETE message from client\n");
787 name = GNUNET_STRINGS_utf8_tolower ((const char *) &dm[1]);
788
789 for (ego = ego_head; NULL != ego; ego = ego->next)
790 {
791 if (0 == strcmp (ego->identifier, name))
792 {
796 ego->identifier);
797 if (GNUNET_OK !=
799 GNUNET_log (
801 _ ("Failed to write subsystem default identifier map to `%s'.\n"),
803 fn = get_ego_filename (ego);
804 if (0 != unlink (fn))
806 GNUNET_free (fn);
807 GNUNET_free (ego->identifier);
808 ego->identifier = NULL;
809 notify_listeners (ego);
810 GNUNET_free (ego);
814 return;
815 }
816 }
817
821}
static void handle_ego_delete(void *cls, const char *section)
An ego was removed, remove it from all subsystems where it is currently set as the default.

References _, ego_head, ego_tail, get_ego_filename(), GNUNET_CONFIGURATION_iterate_sections(), GNUNET_CONFIGURATION_write(), GNUNET_CONTAINER_DLL_remove, GNUNET_EC_IDENTITY_NOT_FOUND, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_log_strerror_file, GNUNET_OK, GNUNET_SERVICE_client_continue(), GNUNET_STRINGS_utf8_tolower(), handle_ego_delete(), Ego::identifier, name, Ego::next, notify_listeners(), send_result_code(), subsystem_cfg, and subsystem_cfg_file.

Here is the call graph for this function:

◆ read_from_file()

static int read_from_file ( const char *  filename,
void *  buf,
size_t  buf_size 
)
static

Definition at line 825 of file gnunet-service-identity.c.

828{
829 int fd;
830 struct stat sb;
831
832 fd = open (filename,
833 O_RDONLY);
834 if (-1 == fd)
835 {
836 memset (buf,
837 0,
838 buf_size);
839 return GNUNET_SYSERR;
840 }
841 if (0 != fstat (fd,
842 &sb))
843 {
845 "stat",
846 filename);
847 GNUNET_assert (0 == close (fd));
848 memset (buf,
849 0,
850 buf_size);
851 return GNUNET_SYSERR;
852 }
853 if (sb.st_size != buf_size)
854 {
856 "File `%s' has wrong size (%llu), expected %llu bytes\n",
857 filename,
858 (unsigned long long) sb.st_size,
859 (unsigned long long) buf_size);
860 GNUNET_assert (0 == close (fd));
861 memset (buf,
862 0,
863 buf_size);
864 return GNUNET_SYSERR;
865 }
866 if (buf_size !=
867 read (fd,
868 buf,
869 buf_size))
870 {
872 "read",
873 filename);
874 GNUNET_assert (0 == close (fd));
875 memset (buf,
876 0,
877 buf_size);
878 return GNUNET_SYSERR;
879 }
880 GNUNET_assert (0 == close (fd));
881 return GNUNET_OK;
882}
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.

References filename, GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_log_strerror_file, GNUNET_OK, and GNUNET_SYSERR.

Referenced by process_ego_file().

Here is the caller graph for this function:

◆ process_ego_file()

static int process_ego_file ( void *  cls,
const char *  filename 
)
static

Process the given file from the "EGODIR".

Parses the file and creates the respective 'struct Ego' in memory.

Parameters
clsNULL
filenamename of the file to parse
Returns
GNUNET_OK to continue to iterate, GNUNET_NO to stop iteration with no error, GNUNET_SYSERR to abort iteration with error!

Definition at line 896 of file gnunet-service-identity.c.

898{
899 struct Ego *ego;
900 const char *fn;
901
902 fn = strrchr (filename, (int) DIR_SEPARATOR);
903 if (NULL == fn)
904 {
905 GNUNET_break (0);
906 return GNUNET_OK;
907 }
908 ego = GNUNET_new (struct Ego);
909 if (GNUNET_OK !=
911 &ego->pk,
912 sizeof (ego->pk)))
913 {
914 GNUNET_free (ego);
916 _ ("Failed to parse ego information in `%s'\n"),
917 filename);
918 return GNUNET_OK;
919 }
921 "Loaded ego `%s'\n",
922 fn + 1);
923 ego->identifier = GNUNET_strdup (fn + 1);
925 return GNUNET_OK;
926}
static int read_from_file(const char *filename, void *buf, size_t buf_size)
#define DIR_SEPARATOR
Definition platform.h:166

References _, DIR_SEPARATOR, ego_head, ego_tail, filename, GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_OK, GNUNET_strdup, Ego::identifier, Ego::pk, and read_from_file().

Referenced by run().

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

◆ run()

static void run ( void *  cls,
const struct GNUNET_CONFIGURATION_Handle c,
struct GNUNET_SERVICE_Handle service 
)
static

Handle network size estimate clients.

Parameters
clsclosure
serverthe initialized server
cconfiguration to use

Definition at line 937 of file gnunet-service-identity.c.

940{
941 cfg = c;
944 "identity",
945 "EGODIR",
947 {
950 return;
951 }
952 if (GNUNET_OK !=
954 "identity",
955 "SUBSYSTEM_CFG",
957 {
959 "identity",
960 "SUBSYSTEM_CFG");
962 return;
963 }
965 "Loading subsystem configuration `%s'\n",
968 ;
970 (GNUNET_OK !=
972 {
974 _ (
975 "Failed to parse subsystem identity configuration file `%s'\n"),
978 return;
979 }
980 stats = GNUNET_STATISTICS_create ("identity", cfg);
982 {
984 _ ("Failed to create directory `%s' for storing egos\n"),
986 }
989 NULL);
991}
struct GNUNET_SCHEDULER_Task * shutdown_task
static const struct GNUNET_CONFIGURATION_Handle * cfg
Handle to our current configuration.
static int process_ego_file(void *cls, const char *filename)
Process the given file from the "EGODIR".
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(const struct GNUNET_OS_ProjectData *pd)
Create a new configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Parse a configuration file, add all of the options in the file to the configuration environment.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
Definition disk.c:533
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
Definition disk.c:547
int GNUNET_DISK_directory_scan(const char *dir_name, GNUNET_FileNameCallback callback, void *callback_cls)
Scan a directory for files.
Definition disk.c:839
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
struct GNUNET_NotificationContext * GNUNET_notification_context_create(unsigned int queue_length)
Create a new notification context.
Definition nc.c:122
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition scheduler.c:567
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition scheduler.c:1339
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.

References _, cfg, ego_directory, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONFIGURATION_parse(), GNUNET_DISK_directory_create(), GNUNET_DISK_directory_scan(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_log_config_missing(), GNUNET_notification_context_create(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_STATISTICS_create(), GNUNET_YES, nc, process_ego_file(), shutdown_task, stats, subsystem_cfg, and subsystem_cfg_file.

Here is the call graph for this function:

◆ GNUNET_SERVICE_MAIN()

Define "main" method using service macro.

Variable Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* cfg
static

Handle to our current configuration.

Definition at line 70 of file gnunet-service-identity.c.

Referenced by run().

◆ subsystem_cfg

struct GNUNET_CONFIGURATION_Handle* subsystem_cfg
static

Handle to subsystem configuration which for each subsystem contains the name of the default ego.

Definition at line 76 of file gnunet-service-identity.c.

Referenced by handle_delete_message(), handle_ego_delete(), handle_ego_rename(), handle_rename_message(), run(), and shutdown_task().

◆ stats

struct GNUNET_STATISTICS_Handle* stats
static

Handle to the statistics service.

Definition at line 81 of file gnunet-service-identity.c.

Referenced by run(), and shutdown_task().

◆ nc

struct GNUNET_NotificationContext* nc
static

Notification context, simplifies client broadcasts.

Definition at line 86 of file gnunet-service-identity.c.

Referenced by handle_start_message(), notify_listeners(), run(), and shutdown_task().

◆ ego_directory

char* ego_directory
static

Directory where we store the identities.

Definition at line 91 of file gnunet-service-identity.c.

Referenced by get_ego_filename(), run(), and shutdown_task().

◆ subsystem_cfg_file

char* subsystem_cfg_file
static

Configuration file name where subsystem information is kept.

Definition at line 96 of file gnunet-service-identity.c.

Referenced by handle_delete_message(), handle_rename_message(), run(), and shutdown_task().

◆ ego_head

◆ ego_tail

struct Ego* ego_tail
static

Tail of DLL of all egos.

Definition at line 106 of file gnunet-service-identity.c.

Referenced by handle_create_message(), handle_delete_message(), process_ego_file(), and shutdown_task().