Contiki 2.5
|
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... | |
void discovery_ipnd_delete_neighbour | ( | rimeaddr_t * | neighbour | ) |
Marks a neighbour as 'dead' after multiple transmission attempts have failed.
neighbour | Address 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.
dest | Address of potential neighbour |
Definition at line 112 of file discovery_ipnd.c.
References entry, list_head(), NULL, and rimeaddr_cmp().
Referenced by discovery_ipnd_save_neighbour().
|
read |
Returns the list of currently known 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.
buffer | Pointer to the filter |
length | Length of the filter |
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.
eid | Pointer where the EID will be stored |
buffer | Pointer to the incoming EID |
length | Length of the Pointer |
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.
buffer | Pointer to the block |
length | Length of the block |
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.
source | Source address of the packet |
payload | Payload pointer of the packet |
length | Length 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.
neighbour | Address 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.
neighbour | Address 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.