37 #ifndef GNUNET_FRAGMENTATION_LIB_H
38 #define GNUNET_FRAGMENTATION_LIB_H
struct GNUNET_MessageHeader * msg
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
static struct GNUNET_FS_DownloadContext * dc
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
API to create, modify and access statistics.
const char * GNUNET_FRAGMENT_print_ack(const struct GNUNET_MessageHeader *ack)
Convert an ACK message to a printable format suitable for logging.
int GNUNET_DEFRAGMENT_process_fragment(struct GNUNET_DEFRAGMENT_Context *dc, const struct GNUNET_MessageHeader *msg)
We have received a fragment.
void GNUNET_FRAGMENT_context_transmission_done(struct GNUNET_FRAGMENT_Context *fc)
Continuation to call from the 'proc' function after the fragment has been transmitted (and hence the ...
int GNUNET_FRAGMENT_process_ack(struct GNUNET_FRAGMENT_Context *fc, const struct GNUNET_MessageHeader *msg)
Process an acknowledgement message we got from the other side (to control re-transmits).
void GNUNET_DEFRAGMENT_context_destroy(struct GNUNET_DEFRAGMENT_Context *dc)
Destroy the given defragmentation context.
struct GNUNET_DEFRAGMENT_Context * GNUNET_DEFRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, uint16_t mtu, unsigned int num_msgs, void *cls, GNUNET_FRAGMENT_MessageProcessor proc, GNUNET_DEFRAGMENT_AckProcessor ackp)
Create a defragmentation context.
void(* GNUNET_FRAGMENT_MessageProcessor)(void *cls, const struct GNUNET_MessageHeader *msg)
Function that is called with messages created by the fragmentation module.
void(* GNUNET_DEFRAGMENT_AckProcessor)(void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg)
Function that is called with acknowledgement messages created by the fragmentation module.
void GNUNET_FRAGMENT_context_destroy(struct GNUNET_FRAGMENT_Context *fc, struct GNUNET_TIME_Relative *msg_delay, struct GNUNET_TIME_Relative *ack_delay)
Destroy the given fragmentation context (stop calling 'proc', free resources).
struct GNUNET_FRAGMENT_Context * GNUNET_FRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, uint16_t mtu, struct GNUNET_BANDWIDTH_Tracker *tracker, struct GNUNET_TIME_Relative msg_delay, struct GNUNET_TIME_Relative ack_delay, const struct GNUNET_MessageHeader *msg, GNUNET_FRAGMENT_MessageProcessor proc, void *proc_cls)
Create a fragmentation context for the given message.
Struct to track available bandwidth.
Defragmentation context (one per connection).
uint16_t mtu
Maximum message size for each fragment.
GNUNET_DEFRAGMENT_AckProcessor ackp
Function to call with acknowledgements.
GNUNET_FRAGMENT_MessageProcessor proc
Function to call with defragmented messages.
unsigned int num_msgs
num_msgs how many fragmented messages to we defragment at most at the same time?
void * cls
Closure for proc and ackp.
struct GNUNET_TIME_Relative ack_delay
Current expected delay for ACKs.
GNUNET_FRAGMENT_MessageProcessor proc
Function to call for transmissions.
struct GNUNET_TIME_Relative msg_delay
Current expected delay between messages.
void * proc_cls
Closure for proc.
uint16_t mtu
Target fragment size.
struct GNUNET_BANDWIDTH_Tracker * tracker
Tracker for flow control.
Time for relative time used by GNUnet, in microseconds.