GNUnet 0.28.1-dev.2-13-g57ceb9dfb
 
Loading...
Searching...
No Matches
Peer Store service
Collaboration diagram for Peer Store service:

Data Structures

struct  GNUNET_PEERSTORE_Record
 Single PEERSTORE record. More...
 

Macros

#define GNUNET_PEERSTORE_HELLO_KEY   "peerstore-peer-hello-uri"
 Key used for storing HELLO in the peerstore.
 
#define GNUNET_PEERSTORE_TRANSPORT_URLADDRESS_KEY   "transport-communicator-url"
 Key used for storing addresses in URL format in the peerstore.
 
#define GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY   "transport-peer-hello"
 Key used for storing HELLOs in the peerstore.
 
#define GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME    "transport-backchannel-monotonic-time"
 Key used to store sender's monotonic time from backchannel messages.
 
#define GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME    "transport-dv-learn-monotonic-time"
 Key used to store sender's monotonic time from DV learn messages.
 
#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE    "transport-tcp-communicator-handshake"
 Key used to store sender's monotonic time from handshake message.
 
#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE_ACK    "transport-tcp-communicator-handshake-ack"
 Key used to store sender's monotonic time from handshake ack message.
 
#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_REKEY    "transport-tcp-communicator-rekey"
 Key used to store sender's monotonic time from rekey message.
 

Typedefs

typedef void(* GNUNET_PEERSTORE_Continuation) (void *cls, int success)
 Continuation called with a status result.
 
typedef void(* GNUNET_PEERSTORE_Processor) (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
 Function called by PEERSTORE for each matching record.
 
typedef void(* GNUNET_PEERSTORE_hello_notify_cb) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *hello, const char *err_msg)
 Function called by PEERSTORE when notifying a client about a changed hello.
 

Enumerations

enum  GNUNET_PEERSTORE_StoreOption { GNUNET_PEERSTORE_STOREOPTION_MULTIPLE = 0 , GNUNET_PEERSTORE_STOREOPTION_REPLACE = 1 }
 Options for storing values in PEERSTORE. More...
 

Functions

struct GNUNET_PEERSTORE_StoreHelloContextGNUNET_PEERSTORE_hello_add (struct GNUNET_PEERSTORE_Handle *h, const struct GNUNET_MessageHeader *msg, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
 Add hello to peerstore.
 
void GNUNET_PEERSTORE_hello_add_cancel (struct GNUNET_PEERSTORE_StoreHelloContext *huc)
 Cancel the request to add a hello.
 
struct GNUNET_PEERSTORE_HandleGNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Connect to the PEERSTORE service.
 
void GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h)
 Disconnect from the PEERSTORE service.
 
struct GNUNET_PEERSTORE_StoreContextGNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
 Store a new entry in the PEERSTORE.
 
void GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc)
 Cancel a store request.
 
struct GNUNET_PEERSTORE_IterateContextGNUNET_PEERSTORE_iteration_start (struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
 Iterate over peerstore entries.
 
void GNUNET_PEERSTORE_iteration_next (struct GNUNET_PEERSTORE_IterateContext *ic, uint64_t limit)
 Continue an iteration.
 
void GNUNET_PEERSTORE_iteration_stop (struct GNUNET_PEERSTORE_IterateContext *ic)
 Cancel an iteration.
 
struct GNUNET_PEERSTORE_MonitorGNUNET_PEERSTORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, int iterate_first, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
 Request watching a given key The monitoring can be filtered to contain only records matching peer and/or key.
 
void GNUNET_PEERSTORE_monitor_next (struct GNUNET_PEERSTORE_Monitor *zm, uint64_t limit)
 Calls the monitor processor specified in GNUNET_PEERSTORE_monitor_start for the next record(s).
 
void GNUNET_PEERSTORE_monitor_stop (struct GNUNET_PEERSTORE_Monitor *zm)
 Stop monitoring.
 

Detailed Description

See also
Documentation

Macro Definition Documentation

◆ GNUNET_PEERSTORE_HELLO_KEY

#define GNUNET_PEERSTORE_HELLO_KEY   "peerstore-peer-hello-uri"

Key used for storing HELLO in the peerstore.

Definition at line 52 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_URLADDRESS_KEY

#define GNUNET_PEERSTORE_TRANSPORT_URLADDRESS_KEY   "transport-communicator-url"

Key used for storing addresses in URL format in the peerstore.

Definition at line 57 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY

#define GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY   "transport-peer-hello"

Key used for storing HELLOs in the peerstore.

Definition at line 62 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME

#define GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME    "transport-backchannel-monotonic-time"

Key used to store sender's monotonic time from backchannel messages.

Definition at line 68 of file gnunet_peerstore_service.h.

100{
105
111
112};
113
118
123
128
133{
137 char *sub_system;
138
143
147 char *key;
148
152 void *value;
153
157 size_t value_size;
158
163
164};
165
166
173typedef void (*GNUNET_PEERSTORE_Continuation) (void *cls, int success);
174
175
180
181
195typedef void (*GNUNET_PEERSTORE_Processor) (
196 void *cls,
197 const struct GNUNET_PEERSTORE_Record *record,
198 const char *emsg);
199
206typedef void (*GNUNET_PEERSTORE_hello_notify_cb) (
207 void *cls,
208 const struct GNUNET_PeerIdentity *peer,
209 const struct GNUNET_MessageHeader *hello,
210 const char *err_msg);
211
223 const struct GNUNET_MessageHeader *msg,
225 void *cont_cls);
226
227
233void
236
237
245
246
253void
255
256
275 const char *sub_system,
276 const struct GNUNET_PeerIdentity *peer,
277 const char *key,
278 const void *value,
279 size_t size,
283 void *cont_cls);
284
285
291void
293
294
315 const char *sub_system,
316 const struct GNUNET_PeerIdentity *peer,
317 const char *key,
319 void *callback_cls);
320
321
329void
331 uint64_t limit);
332
333
340void
342
377 int iterate_first,
378 const char *sub_system,
379 const struct GNUNET_PeerIdentity *peer,
380 const char *key,
382 void *error_cb_cls,
384 void *sync_cb_cls,
386 void *callback_cls);
387
409void
411 uint64_t limit);
412
418void
420
421#if 0 /* keep Emacsens' auto-indent happy */
422{
423#endif
424#ifdef __cplusplus
425}
426#endif
427
428#endif
429
/* end of group */
431
/* end of group addition */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition 002.c:5
struct GNUNET_MessageHeader * msg
Definition 005.c:2
static void error_cb(void *cls)
Function called if lookup fails.
Definition gnunet-abd.c:484
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition gnunet-arm.c:98
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition gnunet-arm.c:108
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
struct GNUNET_HashCode key
The key used in the DHT.
static void sync_cb(void *cls)
Function called once we are in sync in monitor mode.
static struct GNUNET_NAMESTORE_ZoneMonitor * zm
Monitor handle.
static char * value
Value of the record to add/remove.
static struct GNUNET_FS_SearchContext * sc
void GNUNET_PEERSTORE_monitor_stop(struct GNUNET_PEERSTORE_Monitor *zm)
Stop monitoring.
struct GNUNET_PEERSTORE_IterateContext * GNUNET_PEERSTORE_iteration_start(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Iterate over peerstore entries.
void GNUNET_PEERSTORE_iteration_next(struct GNUNET_PEERSTORE_IterateContext *ic, uint64_t limit)
Continue an iteration.
void GNUNET_PEERSTORE_store_cancel(struct GNUNET_PEERSTORE_StoreContext *sc)
Cancel a store request.
void GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h)
Disconnect from the PEERSTORE service.
struct GNUNET_PEERSTORE_Monitor * GNUNET_PEERSTORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, int iterate_first, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_SCHEDULER_TaskCallback sync_cb, void *sync_cb_cls, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Request watching a given key The monitoring can be filtered to contain only records matching peer and...
void(* GNUNET_PEERSTORE_hello_notify_cb)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *hello, const char *err_msg)
Function called by PEERSTORE when notifying a client about a changed hello.
struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the PEERSTORE service.
void GNUNET_PEERSTORE_monitor_next(struct GNUNET_PEERSTORE_Monitor *zm, uint64_t limit)
Calls the monitor processor specified in GNUNET_PEERSTORE_monitor_start for the next record(s).
GNUNET_PEERSTORE_StoreOption
Options for storing values in PEERSTORE.
void(* GNUNET_PEERSTORE_Processor)(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
Function called by PEERSTORE for each matching record.
void GNUNET_PEERSTORE_hello_add_cancel(struct GNUNET_PEERSTORE_StoreHelloContext *huc)
Cancel the request to add a hello.
struct GNUNET_PEERSTORE_StoreContext * GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Store a new entry in the PEERSTORE.
void(* GNUNET_PEERSTORE_Continuation)(void *cls, int success)
Continuation called with a status result.
void GNUNET_PEERSTORE_iteration_stop(struct GNUNET_PEERSTORE_IterateContext *ic)
Cancel an iteration.
struct GNUNET_PEERSTORE_StoreHelloContext * GNUNET_PEERSTORE_hello_add(struct GNUNET_PEERSTORE_Handle *h, const struct GNUNET_MessageHeader *msg, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Add hello to peerstore.
@ GNUNET_PEERSTORE_STOREOPTION_MULTIPLE
Possibly store multiple values under given key.
@ GNUNET_PEERSTORE_STOREOPTION_REPLACE
Delete any previous values for the given key before storing the given value.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
static unsigned int size
Size of the "table".
Definition peer.c:68
Header for all communications.
Handle to the PEERSTORE service.
Context for a iterate request.
char * sub_system
Which subsystem does the store?
void * callback_cls
Closure for callback.
GNUNET_PEERSTORE_Processor callback
Callback with each matching record.
struct GNUNET_PeerIdentity peer
Peer the store is for.
void * error_cb_cls
Closure for error_cb.
void * callback_cls
Closure for callback.
const struct GNUNET_PeerIdentity * peer
The peer we are watching for values, pointing at peer_buf, or NULL if we watch all peers.
int iterate_first
Iterate first flag.
GNUNET_PEERSTORE_Processor callback
Callback with each record received.
char * sub_system
The sub system requested the watch.
Context for the info handler.
size_t value_size
Size of value BLOB.
struct GNUNET_PeerIdentity peer
Peer Identity.
void * value
Record value BLOB.
struct GNUNET_TIME_Absolute expiry
Expiry time of entry.
char * sub_system
Responsible sub system string.
char * key
Record key string.
Context for a store request.
char * sub_system
Which subsystem does the store?
struct GNUNET_TIME_Absolute expiry
When does the value expire?
void * cont_cls
Closure for cont.
GNUNET_PEERSTORE_Continuation cont
Continuation called with service response.
struct GNUNET_PeerIdentity peer
Peer the store is for.
Context for a add hello uri request.
GNUNET_PEERSTORE_Continuation cont
Function to call with information.
void * cont_cls
Closure for callback.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.

◆ GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME

#define GNUNET_PEERSTORE_TRANSPORT_DVLEARN_MONOTIME    "transport-dv-learn-monotonic-time"

Key used to store sender's monotonic time from DV learn messages.

Definition at line 75 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE

#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE    "transport-tcp-communicator-handshake"

Key used to store sender's monotonic time from handshake message.

Definition at line 81 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE_ACK

#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE_ACK    "transport-tcp-communicator-handshake-ack"

Key used to store sender's monotonic time from handshake ack message.

Definition at line 87 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_REKEY

#define GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_REKEY    "transport-tcp-communicator-rekey"

Key used to store sender's monotonic time from rekey message.

Definition at line 93 of file gnunet_peerstore_service.h.

Typedef Documentation

◆ GNUNET_PEERSTORE_Continuation

typedef void(* GNUNET_PEERSTORE_Continuation) (void *cls, int success)

Continuation called with a status result.

Parameters
clsclosure
successGNUNET_OK or GNUNET_SYSERR

Definition at line 174 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_Processor

typedef void(* GNUNET_PEERSTORE_Processor) (void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)

Function called by PEERSTORE for each matching record.

A NULL record terminates the iteration, with or without an emsg: the ‘struct GNUNET_PEERSTORE_IterateContext’ has been released by the time this call returns. A handler must therefore drop its handle on a NULL record and must not call GNUNET_PEERSTORE_iteration_next() or GNUNET_PEERSTORE_iteration_stop() on it.

Parameters
clsclosure
recordpeerstore record information, NULL to end the iteration
emsgerror message, or NULL if no errors

Definition at line 196 of file gnunet_peerstore_service.h.

◆ GNUNET_PEERSTORE_hello_notify_cb

typedef void(* GNUNET_PEERSTORE_hello_notify_cb) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *hello, const char *err_msg)

Function called by PEERSTORE when notifying a client about a changed hello.

Parameters
clsclosure
hello_uriHello uri.

Definition at line 207 of file gnunet_peerstore_service.h.

Enumeration Type Documentation

◆ GNUNET_PEERSTORE_StoreOption

Options for storing values in PEERSTORE.

Enumerator
GNUNET_PEERSTORE_STOREOPTION_MULTIPLE 

Possibly store multiple values under given key.

GNUNET_PEERSTORE_STOREOPTION_REPLACE 

Delete any previous values for the given key before storing the given value.

Definition at line 100 of file gnunet_peerstore_service.h.

Function Documentation

◆ GNUNET_PEERSTORE_hello_add()

struct GNUNET_PEERSTORE_StoreHelloContext * GNUNET_PEERSTORE_hello_add ( struct GNUNET_PEERSTORE_Handle h,
const struct GNUNET_MessageHeader msg,
GNUNET_PEERSTORE_Continuation  cont,
void *  cont_cls 
)

Add hello to peerstore.

Parameters
hhandle for peerstore.
msgThe hello to add.
contThe continuation function to execute after storing.
cont_clsThe continuation function closure.
Returns
The context for storing.

Definition at line 1061 of file peerstore_api.c.

1065{
1068 const struct GNUNET_PeerIdentity *pid;
1070 struct GNUNET_TIME_Absolute hello_exp =
1072 struct GNUNET_TIME_Absolute huc_exp;
1073 uint16_t size_msg = ntohs (msg->size);
1074
1075 if (NULL == parser)
1076 return NULL;
1077 if (GNUNET_TIME_absolute_cmp (hello_exp, <, now))
1078 return NULL;
1079
1081 huc->h = h;
1082 huc->cont = cont;
1083 huc->cont_cls = cont_cls;
1084 huc->hello = GNUNET_malloc (size_msg);
1085 GNUNET_memcpy (huc->hello, msg, size_msg);
1086 huc_exp =
1088 pid = GNUNET_HELLO_parser_get_id (parser);
1089 huc->pid = *pid;
1091 "Adding hello for peer %s with expiration %s msg size %u\n",
1092 GNUNET_i2s (&huc->pid),
1094 size_msg);
1095
1096 huc->ic = GNUNET_PEERSTORE_iteration_start (h, "peerstore", &huc->pid,
1099 huc);
1100 GNUNET_HELLO_parser_free (parser);
1101 return huc;
1102}
void GNUNET_HELLO_parser_free(struct GNUNET_HELLO_Parser *parser)
Release resources of a builder.
Definition hello-uri.c:380
struct GNUNET_TIME_Absolute GNUNET_HELLO_get_expiration_time_from_msg(const struct GNUNET_MessageHeader *msg)
Get the expiration time for this HELLO.
Definition hello-uri.c:642
const struct GNUNET_PeerIdentity * GNUNET_HELLO_parser_get_id(const struct GNUNET_HELLO_Parser *parser)
Get the PeerIdentity for this builder.
Definition hello-uri.c:354
struct GNUNET_HELLO_Parser * GNUNET_HELLO_parser_from_msg(const struct GNUNET_MessageHeader *msg, const struct GNUNET_PeerIdentity *pid)
Parse msg.
Definition hello-uri.c:416
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_PEERSTORE_HELLO_KEY
Key used for storing HELLO in the peerstore.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition time.c:111
#define GNUNET_TIME_absolute_cmp(t1, op, t2)
Compare two absolute times.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
Definition strings.c:671
static void hello_add_iter(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
#define LOG(kind,...)
Context for parsing HELLOs.
Definition hello-uri.c:233
struct GNUNET_MessageHeader * hello
Hello uri which was request for storing.
struct GNUNET_PEERSTORE_Handle * h
Peerstore handle.
struct GNUNET_PEERSTORE_IterateContext * ic
The iteration for the merge.
struct GNUNET_PeerIdentity pid
The peer id for the hello.

References GNUNET_PEERSTORE_StoreHelloContext::cont, GNUNET_PEERSTORE_StoreHelloContext::cont_cls, GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELLO_get_expiration_time_from_msg(), GNUNET_HELLO_parser_free(), GNUNET_HELLO_parser_from_msg(), GNUNET_HELLO_parser_get_id(), GNUNET_i2s(), GNUNET_malloc, GNUNET_memcpy, GNUNET_new, GNUNET_PEERSTORE_HELLO_KEY, GNUNET_PEERSTORE_iteration_start(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_TIME_absolute_cmp, GNUNET_TIME_absolute_get(), h, GNUNET_PEERSTORE_StoreHelloContext::h, GNUNET_PEERSTORE_StoreHelloContext::hello, hello_add_iter(), GNUNET_PEERSTORE_StoreHelloContext::ic, LOG, msg, GNUNET_PEERSTORE_StoreHelloContext::pid, and GNUNET_MessageHeader::size.

Referenced by callback_download(), handle_hello(), pils_pid_change_cb(), pils_sign_hello_cb(), and run().

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

◆ GNUNET_PEERSTORE_hello_add_cancel()

void GNUNET_PEERSTORE_hello_add_cancel ( struct GNUNET_PEERSTORE_StoreHelloContext huc)

Cancel the request to add a hello.

Parameters
hucThe context for storing a hello.

Definition at line 1106 of file peerstore_api.c.

1108{
1109 if (NULL != huc->sc)
1111 if (NULL != huc->ic)
1113 GNUNET_free (huc->hello);
1114 GNUNET_free (huc);
1115}
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_PEERSTORE_StoreContext * sc
Store operation for the merge.

References GNUNET_free, GNUNET_PEERSTORE_iteration_stop(), GNUNET_PEERSTORE_store_cancel(), GNUNET_PEERSTORE_StoreHelloContext::hello, GNUNET_PEERSTORE_StoreHelloContext::ic, and GNUNET_PEERSTORE_StoreHelloContext::sc.

Referenced by cancel_address_store(), cleaning_task(), free_address_list_entry(), GNUNET_HOSTLIST_client_stop(), and shutdown_task().

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

◆ GNUNET_PEERSTORE_connect()

struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect ( const struct GNUNET_CONFIGURATION_Handle cfg)

Connect to the PEERSTORE service.

Returns
NULL on error
Parameters
cfgconfiguration to use
Returns
NULL on error

Definition at line 495 of file peerstore_api.c.

496{
498
500 h->cfg = cfg;
501 reconnect (h);
502 if (NULL == h->mq)
503 {
504 /* #reconnect() has scheduled a retry against @a h; freeing the handle
505 without cancelling it leaves the scheduler holding a pointer into
506 freed memory. */
507 if (NULL != h->reconnect_task)
508 {
510 h->reconnect_task = NULL;
511 }
512 GNUNET_free (h);
513 return NULL;
514 }
515 return h;
516}
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition scheduler.c:986
static void reconnect(void)
Adjust exponential back-off and reconnect to the service.
struct GNUNET_MQ_Handle * mq
Our connection to the ARM service.
Definition arm_api.c:107
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
Definition arm_api.c:112
struct GNUNET_SCHEDULER_Task * reconnect_task
ID of the reconnect task (if any).
Definition arm_api.c:147

References cfg, GNUNET_ARM_Handle::cfg, GNUNET_free, GNUNET_new, GNUNET_SCHEDULER_cancel(), h, GNUNET_ARM_Handle::mq, reconnect(), and GNUNET_ARM_Handle::reconnect_task.

Referenced by DHTU_gnunet_init(), GCH_init(), GNUNET_HOSTLIST_client_start(), GNUNET_HOSTLIST_server_start(), GNUNET_TRANSPORT_TESTING_start_peer(), GSF_connected_peer_init_(), run(), run(), run(), run(), run(), run(), and start_peer_run().

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

◆ GNUNET_PEERSTORE_disconnect()

void GNUNET_PEERSTORE_disconnect ( struct GNUNET_PEERSTORE_Handle h)

Disconnect from the PEERSTORE service.

Any pending ITERATE and WATCH and STORE requests will be canceled.

Parameters
hhandle to disconnect

Any pending ITERATE and STORE requests are released without invoking their callbacks.

Parameters
hhandle to disconnect

Definition at line 526 of file peerstore_api.c.

527{
528 LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnect initiated from client.\n");
529 if (NULL != h->reconnect_task)
530 {
532 h->reconnect_task = NULL;
533 }
534 /* Silently: the caller is tearing down and the closures behind these
535 callbacks may already be gone, so this is not the moment to invoke
536 them. #disconnect() asserts both lists are empty, and until now a
537 caller that still had anything in flight -- which, with the request-id
538 truncation, was every caller that had ever stored twice -- aborted here
539 instead of shutting down. */
541 disconnect (h);
542 GNUNET_free (h);
543}
@ GNUNET_NO
static void flush_pending_operations(struct GNUNET_PEERSTORE_Handle *h, int notify)
Terminate every operation still pending on h.
static void disconnect(struct GNUNET_PEERSTORE_Handle *h)
Disconnect from the peerstore service.

References disconnect(), flush_pending_operations(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_NO, GNUNET_SCHEDULER_cancel(), h, LOG, and GNUNET_ARM_Handle::reconnect_task.

Referenced by cleaning_task(), DHTU_gnunet_done(), do_shutdown(), do_shutdown(), do_shutdown(), GCH_shutdown(), GNUNET_HOSTLIST_client_stop(), GNUNET_HOSTLIST_server_stop(), GNUNET_TRANSPORT_TESTING_stop_peer(), GSF_connected_peer_done_(), shutdown_task(), shutdown_task(), and stop_peer_run().

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

◆ GNUNET_PEERSTORE_store()

struct GNUNET_PEERSTORE_StoreContext * GNUNET_PEERSTORE_store ( struct GNUNET_PEERSTORE_Handle h,
const char *  sub_system,
const struct GNUNET_PeerIdentity peer,
const char *  key,
const void *  value,
size_t  size,
struct GNUNET_TIME_Absolute  expiry,
enum GNUNET_PEERSTORE_StoreOption  options,
GNUNET_PEERSTORE_Continuation  cont,
void *  cont_cls 
)

Store a new entry in the PEERSTORE.

Note that stored entries can be lost in some cases such as power failure.

Parameters
hHandle to the PEERSTORE service
sub_systemname of the sub system
peerPeer Identity
keyentry key
valueentry value BLOB
sizesize of value
expiryabsolute time after which the entry is (possibly) deleted
optionsoptions specific to the storage operation
contContinuation function after the store request is sent
cont_clsClosure for cont

Definition at line 596 of file peerstore_api.c.

606{
607 struct GNUNET_MQ_Envelope *ev;
609
611 "Storing value (size: %llu) for subsystem `%s', peer `%s', key `%s'\n",
612 (unsigned long long) size,
615 key);
617 sc->rid = get_op_id (h);
618 sc->sub_system = GNUNET_strdup (sub_system);
619 GNUNET_assert (NULL != peer);
620 sc->peer = *peer;
621 sc->key = GNUNET_strdup (key);
622 sc->value = GNUNET_memdup (value, size);
623 sc->size = size;
624 sc->expiry = expiry;
625 sc->options = options;
626 sc->cont = cont;
627 sc->cont_cls = cont_cls;
628 sc->h = h;
629 ev =
632 peer,
633 key,
634 value,
635 size,
636 expiry,
637 options,
639
640 GNUNET_CONTAINER_DLL_insert_tail (h->store_head, h->store_tail, sc);
641 if (NULL == h->mq)
642 {
643 sc->env = ev;
644 }
645 else
646 {
647 GNUNET_MQ_send (h->mq, ev);
648 }
649 return sc;
650}
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_memdup(buf, size)
Allocate and initialize a block of memory.
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:337
#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE
Store request message.
static uint32_t get_op_id(struct GNUNET_PEERSTORE_Handle *h)
Get a fresh operation id to distinguish between namestore requests.
struct GNUNET_MQ_Envelope * PEERSTORE_create_record_mq_envelope(uint32_t rid, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t value_size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, uint16_t msg_type)
Creates a MQ envelope for a single record.
enum GNUNET_FS_SearchOptions options
Options for the search.
Definition fs_api.h:1611
struct GNUNET_FS_Handle * h
Handle to the global FS context.
Definition fs_api.h:1528

References GNUNET_PEERSTORE_StoreContext::cont, GNUNET_PEERSTORE_StoreContext::cont_cls, GNUNET_PEERSTORE_StoreContext::expiry, get_op_id(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_memdup, GNUNET_MESSAGE_TYPE_PEERSTORE_STORE, GNUNET_MQ_send(), GNUNET_new, GNUNET_strdup, h, GNUNET_FS_SearchContext::h, key, LOG, GNUNET_ARM_Handle::mq, options, GNUNET_FS_SearchContext::options, GNUNET_PEERSTORE_StoreContext::peer, PEERSTORE_create_record_mq_envelope(), sc, size, GNUNET_PEERSTORE_StoreContext::sub_system, and value.

Referenced by flush_respect(), handle_dv_learn(), handle_validation_response(), handshake_ack_monotime_cb(), handshake_ack_monotime_cb(), handshake_monotime_cb(), handshake_monotime_cb(), rekey_monotime_cb(), rekey_monotime_cb(), store_signed_address(), and update_backtalker_monotime().

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

◆ GNUNET_PEERSTORE_store_cancel()

void GNUNET_PEERSTORE_store_cancel ( struct GNUNET_PEERSTORE_StoreContext sc)

Cancel a store request.

Parameters
scStore request context

Definition at line 567 of file peerstore_api.c.

568{
570 "store cancel with sc %p \n",
571 sc);
574 "store cancel with sc %p is null\n",
575 sc);
576}
static void destroy_storecontext(struct GNUNET_PEERSTORE_StoreContext *sc)

References destroy_storecontext(), GNUNET_ERROR_TYPE_DEBUG, LOG, and sc.

Referenced by cancel_address_store(), free_address_list_entry(), free_backtalker(), free_neighbour(), free_validation_state(), handle_dv_learn(), queue_destroy(), queue_destroy(), and update_backtalker_monotime().

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

◆ GNUNET_PEERSTORE_iteration_start()

struct GNUNET_PEERSTORE_IterateContext * GNUNET_PEERSTORE_iteration_start ( struct GNUNET_PEERSTORE_Handle h,
const char *  sub_system,
const struct GNUNET_PeerIdentity peer,
const char *  key,
GNUNET_PEERSTORE_Processor  callback,
void *  callback_cls 
)

Iterate over peerstore entries.

The iteration can be filtered to contain only records matching peer and/or key. The sub_system to match must be provided. callback will be called with (each) matching record. GNUNET_PEERSTORE_iteration_next() must be invoked to continue processing until the end of the iteration is reached.

Parameters
hhandle to the PEERSTORE service
sub_systemname of sub system
peerPeer identity (can be NULL)
keyentry key string (can be NULL)
callbackfunction called with each matching record. The record will be NULL to indicate end.
callback_clsclosure for callback
Returns
Handle to iteration request

Definition at line 854 of file peerstore_api.c.

860{
861 struct GNUNET_MQ_Envelope *ev;
864 size_t ss_size;
865 size_t key_size;
866 size_t msg_size;
867 void *dummy;
868
870 ic->rid = get_op_id (h);
871
872 GNUNET_assert (NULL != sub_system);
873 ss_size = strlen (sub_system) + 1;
874 if (NULL == key)
875 key_size = 0;
876 else
877 key_size = strlen (key) + 1;
878 msg_size = ss_size + key_size;
879 ev = GNUNET_MQ_msg_extra (srm, msg_size,
881 srm->key_size = htons (key_size);
882 srm->rid = htonl (ic->rid);
883 srm->sub_system_size = htons (ss_size);
884 dummy = &srm[1];
885 GNUNET_memcpy (dummy, sub_system, ss_size);
886 dummy += ss_size;
887 GNUNET_memcpy (dummy, key, key_size);
888 ic->callback = callback;
890 ic->h = h;
892 if (NULL != peer)
893 {
894 ic->peer = *peer;
895 srm->peer_set = htons (GNUNET_YES);
896 srm->peer = *peer;
897 }
898 if (NULL != key)
899 ic->key = GNUNET_strdup (key);
900 GNUNET_CONTAINER_DLL_insert_tail (h->iterate_head, h->iterate_tail, ic);
902 "Sending an iterate request for sub system `%s'\n",
903 sub_system);
904 GNUNET_MQ_send (h->mq, ev);
905 return ic;
906}
static struct in_addr dummy
Target "dummy" address of the packet we pretend to respond to.
@ GNUNET_YES
#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_PEERSTORE_ITERATE_START
Iteration request (see also 828, 829)
char * key
Key for the store operation.
struct GNUNET_PEERSTORE_Handle * h
Handle to the PEERSTORE service.
Iteration start message.
Definition peerstore.h:202
uint16_t peer_set
GNUNET_YES if peer id value set, GNUNET_NO otherwise
Definition peerstore.h:221
struct GNUNET_PeerIdentity peer
Peer Identity.
Definition peerstore.h:211
uint32_t rid
Request id.
Definition peerstore.h:216
uint16_t sub_system_size
Size of the sub_system string Allocated at position 0 after this struct.
Definition peerstore.h:227
uint16_t key_size
Size of the key string Allocated at position 1 after this struct.
Definition peerstore.h:238

References GNUNET_PEERSTORE_IterateContext::callback, GNUNET_PEERSTORE_IterateContext::callback_cls, dummy, get_op_id(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_START, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_strdup, GNUNET_YES, h, GNUNET_PEERSTORE_IterateContext::h, key, GNUNET_PEERSTORE_IterateContext::key, PeerstoreIterationStartMessage::key_size, LOG, GNUNET_ARM_Handle::mq, PeerstoreIterationStartMessage::peer, GNUNET_PEERSTORE_IterateContext::peer, PeerstoreIterationStartMessage::peer_set, PeerstoreIterationStartMessage::rid, GNUNET_PEERSTORE_IterateContext::rid, GNUNET_PEERSTORE_IterateContext::sub_system, and PeerstoreIterationStartMessage::sub_system_size.

Referenced by decaps_dv_box_cont(), decrypt_and_check_tc(), decrypt_and_check_tc(), do_rekey(), do_rekey(), GNUNET_PEERSTORE_hello_add(), GNUNET_TRANSPORT_TESTING_restart_peer(), GSF_peer_connect_handler(), handle_add_queue_message(), queue_burst(), retrieve_hello(), retrieve_hello(), run(), try_handle_plaintext(), and try_handle_plaintext().

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

◆ GNUNET_PEERSTORE_iteration_next()

void GNUNET_PEERSTORE_iteration_next ( struct GNUNET_PEERSTORE_IterateContext ic,
uint64_t  limit 
)

Continue an iteration.

Do NOT call after the iterate request is done.

Parameters
icIterate request context as returned by GNUNET_PEERSTORE_iteration_start()
limithow many records to return max until #GNUNET_PEERSTORE_iterate_next() needs to be called again.

Continue an iteration.

Parameters
icIterate request context as returned by GNUNET_PEERSTORE_iterate()

Definition at line 806 of file peerstore_api.c.

808{
809 struct GNUNET_MQ_Envelope *ev;
811
813 "Sending PEERSTORE_ITERATION_NEXT message\n");
815 inm->rid = htonl (ic->rid);
816 inm->limit = GNUNET_htonll (limit);
817 if (NULL == ic->h->mq)
818 {
819 ic->env = ev;
820 }
821 else
822 {
823 GNUNET_MQ_send (ic->h->mq, ev);
824 }
825}
#define GNUNET_log(kind,...)
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_NEXT
Iteration request (see also 821, 829)
struct GNUNET_MQ_Handle * mq
Message queue.
struct GNUNET_MQ_Envelope * env
Temporary envelope.
Iteration next message.
Definition peerstore.h:248
uint32_t rid
Request id.
Definition peerstore.h:262
uint64_t limit
Number of records to return.
Definition peerstore.h:257

References GNUNET_PEERSTORE_IterateContext::env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_htonll(), GNUNET_log, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_PEERSTORE_IterateContext::h, PeerstoreIterationNextMessage::limit, GNUNET_PEERSTORE_Handle::mq, PeerstoreIterationNextMessage::rid, and GNUNET_PEERSTORE_IterateContext::rid.

Referenced by backtalker_monotime_cb(), handshake_ack_monotime_cb(), handshake_ack_monotime_cb(), handshake_ack_monotime_store_cb(), handshake_ack_monotime_store_cb(), handshake_monotime_cb(), handshake_monotime_cb(), handshake_monotime_store_cb(), handshake_monotime_store_cb(), hello_add_iter(), hello_iter(), neighbour_dv_monotime_cb(), peer_respect_cb(), rekey_monotime_cb(), rekey_monotime_cb(), rekey_monotime_store_cb(), and rekey_monotime_store_cb().

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

◆ GNUNET_PEERSTORE_iteration_stop()

void GNUNET_PEERSTORE_iteration_stop ( struct GNUNET_PEERSTORE_IterateContext ic)

Cancel an iteration.

Do NOT call after the iterate request is done

Parameters
icIterate request context as returned by GNUNET_PEERSTORE_iteration_start()

Cancel an iteration.

Parameters
icIterate request context as returned by GNUNET_PEERSTORE_iterate()

Definition at line 835 of file peerstore_api.c.

836{
837 struct GNUNET_MQ_Envelope *ev;
839
841 "Sending PEERSTORE_ITERATION_STOP message\n");
842 if (NULL != ic->h->mq)
843 {
845 ism->rid = htonl (ic->rid);
846 if (NULL != ic->h->mq)
847 GNUNET_MQ_send (ic->h->mq, ev);
848 }
850}
#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_STOP
Iteration request (see also 821, 828)
static void destroy_iteratecontext(struct GNUNET_PEERSTORE_IterateContext *ic)
uint32_t rid
Request id.
Definition peerstore.h:275

References destroy_iteratecontext(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_PEERSTORE_IterateContext::h, GNUNET_PEERSTORE_Handle::mq, PeerstoreIterationStopMessage::rid, and GNUNET_PEERSTORE_IterateContext::rid.

Referenced by check_for_burst_address(), free_backtalker(), free_neighbour(), free_virtual_link(), GNUNET_PEERSTORE_hello_add_cancel(), GNUNET_TRANSPORT_TESTING_restart_peer(), GNUNET_TRANSPORT_TESTING_stop_peer(), GSF_peer_disconnect_handler(), handle_iterate_result(), handshake_ack_monotime_cb(), handshake_ack_monotime_cb(), handshake_monotime_cb(), handshake_monotime_cb(), hello_add_iter(), hello_iter_cb(), hello_iter_cb(), peer_respect_cb(), queue_destroy(), queue_destroy(), rekey_monotime_cb(), rekey_monotime_cb(), shutdown_task(), and stop_peer_run().

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

◆ GNUNET_PEERSTORE_monitor_start()

struct GNUNET_PEERSTORE_Monitor * GNUNET_PEERSTORE_monitor_start ( const struct GNUNET_CONFIGURATION_Handle cfg,
int  iterate_first,
const char *  sub_system,
const struct GNUNET_PeerIdentity peer,
const char *  key,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_SCHEDULER_TaskCallback  sync_cb,
void *  sync_cb_cls,
GNUNET_PEERSTORE_Processor  callback,
void *  callback_cls 
)

Request watching a given key The monitoring can be filtered to contain only records matching peer and/or key.

The sub_system to match must be provided. callback will be called with (each) matching new record. GNUNET_PEERSTORE_monitor_next() must be invoked to continue processing until sync_cb is called, indicating that the caller should be up-to-date. The caller will be notified with any new values added to key through callback. If iterate_first is set to GNUNET_YES, the monitor will first iterate over all existing, matching records. In any case, after sync_cb is called the first time monitoring starts.

Parameters
hhandle to the PEERSTORE service
iterate_firstfirst iterated of all results if GNUNET_YES
sub_systemname of sub system
peerPeer identity
keyentry key string
error_cbfunction to call on error (i.e. disconnect); note that unlike the other error callbacks in this API, a call to this function does NOT destroy the monitor handle, it merely signals that monitoring is down. You need to still explicitly call GNUNET_PEERSTORE_monitor_stop().
error_cb_clsclosure for error_cb
sync_cbfunction called when we're in sync with the peerstore
sync_cb_clsclosure for sync_cb
callbackfunction called with each new value
callback_clsclosure for callback
Returns
Handle to watch request

Definition at line 253 of file peerstore_api_monitor.c.

265{
267
269 mc->callback = callback;
270 mc->callback_cls = callback_cls;
271 mc->sync_cb = sync_cb;
272 mc->sync_cb_cls = sync_cb_cls;
273 mc->error_cb = error_cb;
274 mc->error_cb_cls = error_cb_cls;
275 if (NULL != key)
276 mc->key = GNUNET_strdup (key);
277 if (NULL != peer)
278 {
279 mc->peer_buf = *peer;
280 mc->peer = &mc->peer_buf;
281 }
282 mc->iterate_first = iterate_first;
283 mc->sub_system = GNUNET_strdup (sub_system);
284 mc->cfg = cfg;
285 reconnect (mc);
286 if (NULL == mc->mq)
287 {
288 GNUNET_free (mc->sub_system);
289 GNUNET_free (mc->key);
290 GNUNET_free (mc);
291 return NULL;
292 }
293 return mc;
294}
static struct GNUNET_TESTBED_Controller * mc
Handle to the master controller.

References GNUNET_PEERSTORE_Monitor::callback, GNUNET_PEERSTORE_Monitor::callback_cls, cfg, error_cb(), GNUNET_PEERSTORE_Monitor::error_cb_cls, GNUNET_free, GNUNET_new, GNUNET_strdup, GNUNET_PEERSTORE_Monitor::iterate_first, key, mc, GNUNET_PEERSTORE_Monitor::peer, reconnect(), GNUNET_PEERSTORE_Monitor::sub_system, sync_cb(), and GNUNET_PEERSTORE_Monitor::sync_cb_cls.

Referenced by core_init_cb(), GCH_init(), handle_add_queue_message(), handle_suggest(), process_peer(), run(), start_notify(), start_notify(), and try_to_bring_link_up().

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

◆ GNUNET_PEERSTORE_monitor_next()

void GNUNET_PEERSTORE_monitor_next ( struct GNUNET_PEERSTORE_Monitor zm,
uint64_t  limit 
)

Calls the monitor processor specified in GNUNET_PEERSTORE_monitor_start for the next record(s).

This function is used to allow clients that merely monitor the NAMESTORE to still throttle namestore operations, so we can be sure that the monitors can keep up.

Note that GNUNET_PEERSTORE_store() only waits for this call if the previous limit set by the client was already reached. Thus, by using a limit greater than 1, monitors basically enable a queue of notifications to be processed asynchronously with some delay. Note that even with a limit of 1 the GNUNET_PEERSTORE_store() function will run asynchronously and the continuation may be invoked before the monitors completed (or even started) processing the notification. Thus, monitors will only closely track the current state of the peerstore, but not be involved in the transactions.

Parameters
zmthe monitor
limitnumber of records to return to the iterator in one shot (before GNUNET_PEERSTORE_monitor_next is to be called again)

Definition at line 317 of file peerstore_api_monitor.c.

319{
320 struct GNUNET_MQ_Envelope *env;
322
323 if (NULL == zm->mq)
324 {
325 /* Disconnected; #reconnect() re-sends MONITOR_START and the service
326 starts over, so there is nothing to ask for right now. */
327 return;
328 }
330 nm->limit = GNUNET_htonll (limit);
332}
struct GNUNET_MQ_Envelope * env
Definition 005.c:1
#define GNUNET_MESSAGE_TYPE_PEERSTORE_MONITOR_NEXT
Monitor next request.
struct GNUNET_MQ_Handle * mq
Handle to namestore service.
Iteration next message.
Definition peerstore.h:185
uint64_t limit
Number of records to return.
Definition peerstore.h:194

References env, GNUNET_htonll(), GNUNET_MESSAGE_TYPE_PEERSTORE_MONITOR_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), PeerstoreMonitorNextMessage::limit, GNUNET_NAMESTORE_ZoneMonitor::mq, and zm.

Referenced by check_for_global_natted(), got_hello(), handle_hello_for_client(), handle_hello_for_incoming(), peerinfo_cb(), process_notify(), process_peer(), and process_peerinfo_peers().

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

◆ GNUNET_PEERSTORE_monitor_stop()

void GNUNET_PEERSTORE_monitor_stop ( struct GNUNET_PEERSTORE_Monitor zm)

Stop monitoring.

Parameters
zmhandle to the monitor activity to stop

Definition at line 303 of file peerstore_api_monitor.c.

304{
305 if (NULL != zm->mq)
306 {
308 zm->mq = NULL;
309 }
310 GNUNET_free (zm->sub_system);
311 GNUNET_free (zm->key);
312 GNUNET_free (zm);
313}
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition mq.c:732

References GNUNET_free, GNUNET_MQ_destroy(), GNUNET_NAMESTORE_ZoneMonitor::mq, and zm.

Referenced by cleaning_task(), DHTU_gnunet_done(), free_incoming_request(), free_queue(), GCH_shutdown(), GNUNET_HOSTLIST_server_stop(), process_peer(), shutdown_task(), and stop_peer_request().

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