#include "platform.h"
#include <stdlib.h>
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
Go to the source code of this file.
|
static void | handle_stop (void *cls, const struct GNUNET_MessageHeader *message) |
| Handler for STOP message. More...
|
|
static void * | client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *c, struct GNUNET_MQ_Handle *mq) |
| Callback called when a client connects to the service. More...
|
|
static void | client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *c, void *internal_cls) |
| Callback called when a client disconnected from the service. More...
|
|
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SERVICE_Handle *service) |
|
| GNUNET_SERVICE_MAIN ("do-nothing", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_fixed_size(stop, GNUNET_MESSAGE_TYPE_ARM_STOP, struct GNUNET_MessageHeader, NULL), GNUNET_MQ_handler_end()) |
| Define "main" method using service macro. More...
|
|
void | GNUNET_mockup_done (void) |
|
void | __attribute__ ((destructor)) |
|
◆ handle_stop()
Handler for STOP message.
- Parameters
-
cls | client identification of the client |
message | the actual message |
Definition at line 36 of file mockup-service.c.
38{
40
41 (void) message;
43 "Initiating shutdown as requested by client.\n");
46
47
48
50}
#define GNUNET_log(kind,...)
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
void GNUNET_SERVICE_client_persist(struct GNUNET_SERVICE_Client *c)
Set the persist option on this client.
Handle to a client that is connected to a service.
References GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SCHEDULER_shutdown(), GNUNET_SERVICE_client_persist(), and special_ret.
◆ client_connect_cb()
Callback called when a client connects to the service.
- Parameters
-
cls | closure for the service |
c | the new client that connected to the service |
mq | the message queue used to send messages to the client |
- Returns
- c
Definition at line 62 of file mockup-service.c.
65{
66 (void) cls;
68 return c;
69}
struct GNUNET_MQ_Handle * mq
References mq.
◆ client_disconnect_cb()
Callback called when a client disconnected from the service.
- Parameters
-
cls | closure for the service |
c | the client that disconnected |
internal_cls | should be equal to c |
Definition at line 80 of file mockup-service.c.
83{
84 (void) cls;
86}
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
References GNUNET_assert.
◆ run()
Definition at line 90 of file mockup-service.c.
93{
94 (void) cls;
97
98}
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
References cfg, and service.
◆ GNUNET_SERVICE_MAIN()
GNUNET_SERVICE_MAIN |
( |
"do-nothing" |
, |
|
|
GNUNET_SERVICE_OPTION_NONE |
, |
|
|
& |
run, |
|
|
& |
client_connect_cb, |
|
|
& |
client_disconnect_cb, |
|
|
NULL |
, |
|
|
GNUNET_MQ_hd_fixed_size(stop, GNUNET_MESSAGE_TYPE_ARM_STOP, struct GNUNET_MessageHeader, NULL) |
, |
|
|
GNUNET_MQ_handler_end() |
|
|
) |
| |
Define "main" method using service macro.
◆ GNUNET_mockup_done()
void GNUNET_mockup_done |
( |
void |
| ) |
|
◆ __attribute__()
void __attribute__ |
( |
(destructor) |
| ) |
|
◆ special_ret