Contiki 2.5
Files | Functions
IP-ND discovery module

Files

file  discovery_ipnd.c
 IP-ND compliant discovery module IP-ND = http://tools.ietf.org/html/draft-irtf-dtnrg-ipnd-01.
 

Functions

void discovery_ipnd_refresh_neighbour (rimeaddr_t *neighbour)
 Checks if ''neighbours'' is already known Yes: refresh timestamp No: Create entry. More...
 
void discovery_ipnd_save_neighbour (rimeaddr_t *neighbour)
 Save neighbour to local cache. More...
 
 LIST (neighbour_list)
 List and memory blocks to save information about neighbours.
 
void discovery_ipnd_init ()
 IPND Discovery init function (called by agent)
 
uint8_t discovery_ipnd_is_neighbour (rimeaddr_t *dest)
 Checks if address is currently listed a neighbour. More...
 
void discovery_ipnd_enable ()
 Enable discovery functionality.
 
void discovery_ipnd_disable ()
 Disable discovery functionality Prevents outgoing packets from being sent.
 
uint8_t discovery_ipnd_parse_eid (uint32_t *eid, uint8_t *buffer, uint8_t length)
 Parses an incoming EID in an IPND frame. More...
 
uint8_t discovery_ipnd_parse_service_block (uint8_t *buffer, uint8_t length)
 Dummy function that could parse the IPND service block. More...
 
uint8_t discovery_ipnd_parse_bloomfilter (uint8_t *buffer, uint8_t length)
 Dummy function that could parse the IPND bloom filter. More...
 
void discovery_ipnd_receive (rimeaddr_t *source, uint8_t *payload, uint8_t length)
 DTN Network has received an incoming discovery packet. More...
 
void discovery_ipnd_send ()
 Send out IPND beacon. More...
 
void discovery_ipnd_delete_neighbour (rimeaddr_t *neighbour)
 Marks a neighbour as 'dead' after multiple transmission attempts have failed. More...
 
struct
discovery_neighbour_list_entry * 
discovery_ipnd_list_neighbours ()
 Returns the list of currently known neighbours. More...
 
void discovery_ipnd_stop_pending ()
 Stops pending discoveries.
 
 PROCESS_THREAD (discovery_process, ev, data)
 IPND Discovery Persistent Process. More...
 

Detailed Description

Function Documentation

void discovery_ipnd_delete_neighbour ( rimeaddr_t *  neighbour)

Marks a neighbour as 'dead' after multiple transmission attempts have failed.

Parameters
neighbourAddress of the neighbour

Definition at line 341 of file discovery_ipnd.c.

References entry, list_head(), list_remove(), memb_free(), NULL, rimeaddr_cmp(), and statistics_contacts_down().

Referenced by PROCESS_THREAD().

uint8_t discovery_ipnd_is_neighbour ( rimeaddr_t *  dest)

Checks if address is currently listed a neighbour.

Parameters
destAddress of potential neighbour
Returns
1 if neighbour, 0 otherwise

Definition at line 112 of file discovery_ipnd.c.

References entry, list_head(), NULL, and rimeaddr_cmp().

Referenced by discovery_ipnd_save_neighbour().

struct discovery_neighbour_list_entry* discovery_ipnd_list_neighbours ( )
read

Returns the list of currently known neighbours.

Returns
Pointer to list with neighbours

Definition at line 419 of file discovery_ipnd.c.

References list_head().

uint8_t discovery_ipnd_parse_bloomfilter ( uint8_t *  buffer,
uint8_t  length 
)

Dummy function that could parse the IPND bloom filter.

Parameters
bufferPointer to the filter
lengthLength of the filter
Returns
dummy

Definition at line 185 of file discovery_ipnd.c.

Referenced by discovery_ipnd_receive().

uint8_t discovery_ipnd_parse_eid ( uint32_t *  eid,
uint8_t *  buffer,
uint8_t  length 
)

Parses an incoming EID in an IPND frame.

Parameters
eidPointer where the EID will be stored
bufferPointer to the incoming EID
lengthLength of the Pointer
Returns
Length of the parsed EID

Definition at line 157 of file discovery_ipnd.c.

References eid_parse_host_length().

Referenced by discovery_ipnd_receive().

uint8_t discovery_ipnd_parse_service_block ( uint8_t *  buffer,
uint8_t  length 
)

Dummy function that could parse the IPND service block.

Parameters
bufferPointer to the block
lengthLength of the block
Returns
dummy

Definition at line 175 of file discovery_ipnd.c.

Referenced by discovery_ipnd_receive().

void discovery_ipnd_receive ( rimeaddr_t *  source,
uint8_t *  payload,
uint8_t  length 
)

DTN Network has received an incoming discovery packet.

Parameters
sourceSource address of the packet
payloadPayload pointer of the packet
lengthLength of the payload

Definition at line 195 of file discovery_ipnd.c.

References discovery_ipnd_parse_bloomfilter(), discovery_ipnd_parse_eid(), discovery_ipnd_parse_service_block(), discovery_ipnd_refresh_neighbour(), and flags.

void discovery_ipnd_refresh_neighbour ( rimeaddr_t *  neighbour)

Checks if ''neighbours'' is already known Yes: refresh timestamp No: Create entry.

Parameters
neighbourAddress of the neighbour that should be refreshed

Definition at line 299 of file discovery_ipnd.c.

References discovery_ipnd_save_neighbour(), entry, list_head(), NULL, and rimeaddr_cmp().

Referenced by discovery_ipnd_receive().

void discovery_ipnd_save_neighbour ( rimeaddr_t *  neighbour)

Save neighbour to local cache.

Parameters
neighbourAddress of the neighbour

Definition at line 376 of file discovery_ipnd.c.

References discovery_ipnd_is_neighbour(), entry, list_add(), memb_alloc(), NULL, process_post(), rimeaddr_copy(), and statistics_contacts_up().

Referenced by discovery_ipnd_refresh_neighbour().

void discovery_ipnd_send ( )

Send out IPND beacon.

Add node's EID

Add static Service block

Definition at line 244 of file discovery_ipnd.c.

References eid_create_host_length(), and sdnv_encode().

Referenced by PROCESS_THREAD().

PROCESS_THREAD ( discovery_process  ,
ev  ,
data   
)

IPND Discovery Persistent Process.

Regularly send out our discovery beacon

Definition at line 435 of file discovery_ipnd.c.

References CLOCK_SECOND, clock_time(), discovery_ipnd_delete_neighbour(), discovery_ipnd_send(), entry, etimer_expired(), etimer_restart(), etimer_set(), list_head(), NULL, PROCESS_BEGIN, PROCESS_END, and PROCESS_WAIT_EVENT.