GNUnet 0.21.1
messenger_api_cmd_stop_service.c File Reference

cmd to stop a messenger service. More...

Include dependency graph for messenger_api_cmd_stop_service.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_MESSENGER_StopServiceState
 

Functions

static enum GNUNET_GenericReturnValue cleanup_rooms_cb (void *cls, const struct GNUNET_HashCode *key, void *value)
 
static void stop_service_run (void *cls, struct GNUNET_TESTING_Interpreter *is)
 
static void stop_service_cleanup (void *cls)
 
struct GNUNET_TESTING_Command GNUNET_MESSENGER_cmd_stop_service (const char *label, const char *service_label)
 

Detailed Description

cmd to stop a messenger service.

Author
Tobias Frisch

Definition in file messenger_api_cmd_stop_service.c.

Function Documentation

◆ cleanup_rooms_cb()

static enum GNUNET_GenericReturnValue cleanup_rooms_cb ( void *  cls,
const struct GNUNET_HashCode key,
void *  value 
)
static

Definition at line 38 of file messenger_api_cmd_stop_service.c.

41{
42 struct GNUNET_MESSENGER_RoomState *rs = cls;
44 return GNUNET_YES;
45}
@ GNUNET_YES
void GNUNET_MESSENGER_destroy_room_state(struct GNUNET_MESSENGER_RoomState *room_state)

References GNUNET_MESSENGER_destroy_room_state(), and GNUNET_YES.

Referenced by stop_service_run().

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

◆ stop_service_run()

static void stop_service_run ( void *  cls,
struct GNUNET_TESTING_Interpreter is 
)
static

Definition at line 49 of file messenger_api_cmd_stop_service.c.

51{
52 struct GNUNET_MESSENGER_StopServiceState *stop_ss = cls;
53
54 const struct GNUNET_TESTING_Command *service_cmd;
56 stop_ss->
57 service_label);
58
60 GNUNET_MESSENGER_get_trait_state (service_cmd, &sss);
61
63 sss->msg = NULL;
64
67 sss->rooms = NULL;
68}
struct GNUNET_TESTING_Interpreter * is
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
void GNUNET_MESSENGER_disconnect(struct GNUNET_MESSENGER_Handle *handle)
Disconnect all of the messengers used services and clears up its used memory.
enum GNUNET_GenericReturnValue GNUNET_MESSENGER_get_trait_state(const struct GNUNET_TESTING_Command *cmd, struct GNUNET_MESSENGER_StartServiceState **ret)
static enum GNUNET_GenericReturnValue cleanup_rooms_cb(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Handle * msg
struct GNUNET_CONTAINER_MultiHashMap * rooms
A command to be run by the interpreter.

References cleanup_rooms_cb(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_MESSENGER_disconnect(), GNUNET_MESSENGER_get_trait_state(), GNUNET_TESTING_interpreter_lookup_command(), is, GNUNET_MESSENGER_StartServiceState::msg, and GNUNET_MESSENGER_StartServiceState::rooms.

Referenced by GNUNET_MESSENGER_cmd_stop_service().

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

◆ stop_service_cleanup()

static void stop_service_cleanup ( void *  cls)
static

Definition at line 72 of file messenger_api_cmd_stop_service.c.

73{
74 struct GNUNET_MESSENGER_StopServiceState *sss = cls;
75
77 GNUNET_free (sss);
78}
#define GNUNET_free(ptr)
Wrapper around free.

References GNUNET_free, and GNUNET_MESSENGER_StopServiceState::service_label.

Referenced by GNUNET_MESSENGER_cmd_stop_service().

Here is the caller graph for this function:

◆ GNUNET_MESSENGER_cmd_stop_service()

struct GNUNET_TESTING_Command GNUNET_MESSENGER_cmd_stop_service ( const char *  label,
const char *  service_label 
)

Definition at line 82 of file messenger_api_cmd_stop_service.c.

84{
86
89
91 label,
94 NULL,
95 NULL);
96}
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static void stop_service_cleanup(void *cls)
static void stop_service_run(void *cls, struct GNUNET_TESTING_Interpreter *is)

References GNUNET_new, GNUNET_strdup, GNUNET_TESTING_command_new(), GNUNET_MESSENGER_StopServiceState::service_label, stop_service_cleanup(), and stop_service_run().

Here is the call graph for this function: