Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

udp_transceiver.c File Reference


Detailed Description

Needs short description here.

Author:
Jeroen Asselman
Date:
2004

#include "../common.h"
#include <math.h>
#include <glib.h>

Data Structures

struct  fragment_s

Typedefs

typedef fragment_s fragment_t

Functions

void udp_transceiver_timer (time_t now)
gboolean udp_transceiver_can_handle_received_fragment (char *buf, int length)
 Wether the udp transceiver might be able to handle this received fragment.

void udp_transceiver_put_send_fragment (fragment_t *fragment)
 Put fragment in the to send list.

void udp_transceiver_send_fragment (fragment_t *fragment, gboolean deflate, gboolean acknowledge)
 Send the fragment.

void udp_transceiver_free_fragment (fragment_t *fragment)
 Free the fragment and all its associated memory.

fragment_tudp_transceiver_build_fragment (char *buffer, int length, int sequencenumber, int partnumber, int fragments, gboolean deflate, gboolean acknowledge)
 Build a fragment.

void udp_transceiver_send (char *buffer, int length, gboolean deflate, gboolean acknowledge, guint32 address, guint16 port)
 Send a fragment to the specified address.

int udp_transceiver_get_sequencenumber (fragment_t *fragment)
 Get the sequence number from a fragment.

int udp_transceiver_get_partnumber (fragment_t *fragment)
 Get the part number from a fragment.

int udp_transceiver_get_fragments (fragment_t *fragment)
 Get the number of fragments from a datagram fragment.

GSList * udp_transceiver_lookup_fragments_by_sequencenumber_source (fragment_t *fragment)
 Gets previously received fragments from the given source with matching sequencenumber.

void udp_transceiver_put_received_fragment (fragment_t *fragment)
 Puts a received datagram fragment in a to handle list.

gboolean udp_transceiver_put_received_datagram (char *buf, int length, guint32 ip, guint16 port)
 Parses a datagram and if it is a fragment it will be handed over to udp_transceiver_put_received_fragment.

gboolean udp_transceiver_receive (char **buffer, int *length)
 Handle receiving of data.


Variables

int sequencenumber = 0
int header_length = 8
int MTU = 1500
int transmit_retransmit_interval = 10
 seconds

int transmit_packet_timeout = 26
 seconds

int receive_packet_expiry = 30
 seconds

GSList * receiving_fragments_list
GSList * received_fragments_list


Typedef Documentation

typedef struct fragment_s fragment_t
 


Function Documentation

fragment_t* udp_transceiver_build_fragment char *  buffer,
int  length,
int  sequencenumber,
int  partnumber,
int  fragments,
gboolean  deflate,
gboolean  acknowledge
 

Build a fragment.

gboolean udp_transceiver_can_handle_received_fragment char *  buf,
int  length
 

Wether the udp transceiver might be able to handle this received fragment.

void udp_transceiver_free_fragment fragment_t fragment  ) 
 

Free the fragment and all its associated memory.

int udp_transceiver_get_fragments fragment_t fragment  )  [inline]
 

Get the number of fragments from a datagram fragment.

int udp_transceiver_get_partnumber fragment_t fragment  )  [inline]
 

Get the part number from a fragment.

int udp_transceiver_get_sequencenumber fragment_t fragment  )  [inline]
 

Get the sequence number from a fragment.

GSList* udp_transceiver_lookup_fragments_by_sequencenumber_source fragment_t fragment  )  [static]
 

Gets previously received fragments from the given source with matching sequencenumber.

gboolean udp_transceiver_put_received_datagram char *  buf,
int  length,
guint32  ip,
guint16  port
[static]
 

Parses a datagram and if it is a fragment it will be handed over to udp_transceiver_put_received_fragment.

void udp_transceiver_put_received_fragment fragment_t fragment  )  [static]
 

Puts a received datagram fragment in a to handle list.

void udp_transceiver_put_send_fragment fragment_t fragment  )  [static]
 

Put fragment in the to send list.

gboolean udp_transceiver_receive char **  buffer,
int *  length
 

Handle receiving of data.

void udp_transceiver_send char *  buffer,
int  length,
gboolean  deflate,
gboolean  acknowledge,
guint32  address,
guint16  port
 

Send a fragment to the specified address.

void udp_transceiver_send_fragment fragment_t fragment,
gboolean  deflate,
gboolean  acknowledge
[static]
 

Send the fragment.

void udp_transceiver_timer time_t  now  ) 
 


Variable Documentation

int header_length = 8 [static]
 

int MTU = 1500 [static]
 

int receive_packet_expiry = 30
 

seconds

GSList* received_fragments_list
 

GSList* receiving_fragments_list
 

int sequencenumber = 0
 

int transmit_packet_timeout = 26
 

seconds

int transmit_retransmit_interval = 10
 

seconds


Generated on Sun Feb 12 10:50:08 2006 for Gtk-Gnutella by doxygen 1.3.6