98 uint16_t msize = ntohs (iim->
header.
size) -
sizeof(*iim);
152 "Failed to receive response from `%s' service (error code is %d).\n",
191 _ (
"Failed to not connect to `%s' service.\n"),
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
shared definitions for the FS library
static void handle_index_info(void *cls, const struct IndexInfoMessage *iim)
Function called on each response from the FS service with information about indexed files.
static void mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static int check_index_info(void *cls, const struct IndexInfoMessage *iim)
Check validity of response from the FS service with information about indexed files.
static void handle_index_info_end(void *cls, const struct GNUNET_MessageHeader *msg)
Function called on each response from the FS service with information about indexed files.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_FS_GetIndexedContext * gic
Handle for the index listing operation.
API for file sharing via GNUnet.
Constants for network protocols.
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
struct GNUNET_FS_GetIndexedContext * GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h, GNUNET_FS_IndexedFileProcessor iterator, void *iterator_cls)
Iterate over all indexed files.
void GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic)
Cancel iteration over all indexed files.
int(* GNUNET_FS_IndexedFileProcessor)(void *cls, const char *filename, const struct GNUNET_HashCode *file_id)
Type of a function called by GNUNET_FS_get_indexed_files.
#define GNUNET_log(kind,...)
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET
Request from client for list of indexed files.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY
Reply to client with an indexed file name.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END
Reply to client indicating end of list.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
Context for GNUNET_FS_get_indexed_files().
void * cont_cls
Closure for cont.
void * iterator_cls
Closure for iterator.
GNUNET_SCHEDULER_TaskCallback cont
Continuation to trigger at the end.
GNUNET_FS_IndexedFileProcessor iterator
Function to call for each indexed file.
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Master context for most FS operations.
Handle to a message queue.
Message handler for a specific message type.
Message send by FS service in response to a request asking for a list of all indexed files.
struct GNUNET_HashCode file_id
Hash of the indexed file.
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.