Contiki 2.5
|
Files | |
file | routing_epidemic.c |
implementation of flood routing | |
file | routing_flooding.c |
implementation of flood routing | |
Macros | |
#define | EPIDEMIC_ROUTE_RETURN_OK 1 |
Internally used return values. | |
#define | FLOOD_ROUTE_RETURN_OK 1 |
Internally used return values. | |
Functions | |
PROCESS (routing_process,"Epidemic ROUTE process") | |
Routing process. | |
void | routing_epidemic_init (void) |
called by agent at startup | |
void | routing_epidemic_schedule_resubmission (void) |
Poll our process, so that we can resubmit bundles. | |
struct neighbour_list_entry_t * | routing_epidemic_get_neighbour (rimeaddr_t *dest) |
checks for a neighbour in the neighbour list More... | |
void | routing_epidemic_new_neighbour (rimeaddr_t *dest) |
checks if there are bundle to send to dest More... | |
int | routing_epidemic_send_bundle (uint32_t bundle_number, rimeaddr_t *neighbour) |
Send bundle to neighbour. More... | |
int | routing_epidemic_send_to_local (struct routing_entry_t *entry) |
Deliver a bundle to a local service. More... | |
int | routing_epidemic_forward (struct routing_entry_t *entry) |
Forward a bundle to the next hop. More... | |
void | routing_epidemic_send_to_known_neighbours (void) |
iterate through all bundles and forward bundles More... | |
void | routing_epidemic_resubmit_bundles () |
Wrapper function for agent calls to resubmit bundles for already known neighbours. | |
int | routing_epidemic_new_bundle (uint32_t *bundle_number) |
Adds a new bundle to the list of bundles. More... | |
void | routing_epidemic_delete_bundle (uint32_t bundle_number) |
deletes bundle from list More... | |
void | routing_epidemic_bundle_sent (struct transmit_ticket_t *ticket, uint8_t status) |
Callback function informing us about the status of a sent bundle. More... | |
void | routing_epidemic_bundle_delivered_locally (struct mmem *bundlemem) |
Incoming notification, that service has finished processing bundle. More... | |
PROCESS_THREAD (routing_process, ev, data) | |
Routing persistent process. | |
PROCESS (routing_process,"FLOOD ROUTE process") | |
Routing process. | |
void | routing_flooding_send_to_known_neighbours (void) |
iterate through all bundles and forward bundles More... | |
void | routing_flooding_check_keep_bundle (uint32_t bundle_number) |
Checks whether a bundle still has to be kept or can be deleted. More... | |
int | routing_flooding_blacklist_add (rimeaddr_t *neighbour) |
Adds (or refreshes) the entry of 'neighbour' on the blacklist. More... | |
void | routing_flooding_blacklist_delete (rimeaddr_t *neighbour) |
Deletes a neighbour from the blacklist. More... | |
void | routing_flooding_init (void) |
called by agent at startup | |
void | routing_flooding_schedule_resubmission (void) |
Poll our process, so that we can resubmit bundles. | |
void | routing_flooding_new_neighbour (rimeaddr_t *dest) |
checks if there are bundle to send to dest More... | |
int | routing_flooding_send_bundle (uint32_t bundle_number, rimeaddr_t *neighbour) |
Send bundle to neighbour. More... | |
int | routing_flooding_send_to_local (struct routing_entry_t *entry) |
Deliver a bundle to a local service. More... | |
int | routing_flooding_forward_directly (struct routing_entry_t *entry) |
Forward a bundle to its destination. More... | |
int | routing_flooding_forward_normal (struct routing_entry_t *entry) |
Forward a bundle to the next hop. More... | |
void | routing_flooding_resubmit_bundles () |
Wrapper function for agent calls to resubmit bundles for already known neighbours. | |
int | routing_flooding_new_bundle (uint32_t *bundle_number) |
Adds a new bundle to the list of bundles. More... | |
void | routing_flooding_delete_bundle (uint32_t bundle_number) |
deletes bundle from list More... | |
void | routing_flooding_bundle_sent (struct transmit_ticket_t *ticket, uint8_t status) |
Callback function informing us about the status of a sent bundle. More... | |
void | routing_flooding_bundle_delivered_locally (struct mmem *bundlemem) |
Incoming notification, that service has finished processing bundle. More... | |
Variables | |
rimeaddr_t | neighbour_list_entry_t::neighbour |
address of the neighbour | |
uint32_t | neighbour_list_entry_t::bundles [ROUTING_BUNDLES_PER_NEIGHBOUR] |
bundles that have been sent to the neighbour | |
uint8_t | neighbour_list_entry_t::bundles_pointer |
Point to where to next bundle number will be stored. | |
struct routing_entry_t * | routing_entry_t::next |
Pointer to the next entry. | |
uint32_t | routing_entry_t::bundle_number |
number of the bundle | |
uint8_t | routing_entry_t::flags |
bundle flags | |
uint32_t | routing_entry_t::destination_node |
destination node More... | |
struct routing_list_entry_t * | routing_list_entry_t::next |
pointer to the next entry | |
struct mmem | routing_list_entry_t::entry |
pointer to MMEM containing the routing_entry_t | |
struct routing_list_entry_t * | next |
pointer to the next entry | |
struct mmem | entry |
pointer to MMEM containing the routing_entry_t | |
uint8_t | routing_entry_t::send_to |
number of nodes the bundle has been sent to already | |
rimeaddr_t | routing_entry_t::neighbours [ROUTING_NEI_MEM] |
addresses of nodes this bundle was sent to | |
uint32_t | routing_entry_t::source_node |
bundle source | |
rimeaddr_t | routing_entry_t::received_from_node |
neighbour from which we have received the bundle | |
uint32_t | bundle_number |
number of the bundle | |
uint8_t | flags |
bundle flags | |
uint8_t | send_to |
number of nodes the bundle has been sent to already | |
rimeaddr_t | neighbours [ROUTING_NEI_MEM] |
addresses of nodes this bundle was sent to | |
uint32_t | destination_node |
bundle destination | |
uint32_t | source_node |
bundle source | |
rimeaddr_t | received_from_node |
neighbour from which we have received the bundle | |
void routing_epidemic_bundle_delivered_locally | ( | struct mmem * | bundlemem | ) |
Incoming notification, that service has finished processing bundle.
bundlemem | Pointer to the MMEM struct of the bundle |
Definition at line 558 of file routing_epidemic.c.
References bundle_decrement(), delivery_unblock_service(), list_head(), list_item_next(), MMEM_PTR, NULL, rimeaddr_node_addr, routing_epidemic_schedule_resubmission(), and ROUTING_FLAG_IN_DELIVERY.
void routing_epidemic_bundle_sent | ( | struct transmit_ticket_t * | ticket, |
uint8_t | status | ||
) |
Callback function informing us about the status of a sent bundle.
ticket | CL transmit ticket of the bundle |
status | status code |
Definition at line 495 of file routing_epidemic.c.
References list_head(), list_item_next(), NULL, routing_epidemic_schedule_resubmission(), and statistics_bundle_outgoing().
void routing_epidemic_delete_bundle | ( | uint32_t | bundle_number | ) |
deletes bundle from list
bundle_number | bundle number of the bundle |
Definition at line 463 of file routing_epidemic.c.
References list_head(), list_item_next(), list_remove(), memb_free(), and NULL.
int routing_epidemic_forward | ( | struct routing_entry_t * | entry | ) |
Forward a bundle to the next hop.
entry | Pointer to the routing entry of the bundle |
Definition at line 271 of file routing_epidemic.c.
References EPIDEMIC_ROUTE_RETURN_OK, list_head(), list_item_next(), NULL, and routing_epidemic_send_bundle().
Referenced by routing_epidemic_send_to_known_neighbours().
|
read |
checks for a neighbour in the neighbour list
dest | pointer to the address of the neighbor |
Definition at line 107 of file routing_epidemic.c.
References entry, list_head(), list_item_next(), NULL, and rimeaddr_cmp().
int routing_epidemic_new_bundle | ( | uint32_t * | bundle_number | ) |
Adds a new bundle to the list of bundles.
bundle_number | bundle number of the bundle |
Definition at line 359 of file routing_epidemic.c.
References bundle_decrement(), bundle_get_attr(), bundle_number, BUNDLE_STORAGE, convert_eid_to_rime(), list_add(), list_head(), list_item_next(), memb_alloc(), memb_free(), MMEM_PTR, NULL, registration_is_local(), routing_epidemic_schedule_resubmission(), source_node, and statistics_bundle_incoming().
void routing_epidemic_new_neighbour | ( | rimeaddr_t * | dest | ) |
checks if there are bundle to send to dest
dest | pointer to the address of the new neighbor |
Definition at line 208 of file routing_epidemic.c.
int routing_epidemic_send_bundle | ( | uint32_t | bundle_number, |
rimeaddr_t * | neighbour | ||
) |
Send bundle to neighbour.
bundle_number | Number of the bundle |
neighbour | Address of the neighbour |
Definition at line 220 of file routing_epidemic.c.
References bundle_number, NULL, and rimeaddr_copy().
Referenced by routing_epidemic_forward().
void routing_epidemic_send_to_known_neighbours | ( | void | ) |
iterate through all bundles and forward bundles
It is likely, that we will have less neighbours than bundles - therefore, we want to to go through bundles only once
Definition at line 309 of file routing_epidemic.c.
References EPIDEMIC_ROUTE_RETURN_OK, list_head(), list_item_next(), NULL, routing_epidemic_forward(), and routing_epidemic_send_to_local().
Referenced by PROCESS_THREAD().
int routing_epidemic_send_to_local | ( | struct routing_entry_t * | entry | ) |
Deliver a bundle to a local service.
entry | Pointer to the routing entry of the bundle |
Definition at line 246 of file routing_epidemic.c.
References BUNDLE_STORAGE, delivery_deliver_bundle(), EPIDEMIC_ROUTE_RETURN_OK, NULL, and ROUTING_FLAG_IN_DELIVERY.
Referenced by routing_epidemic_send_to_known_neighbours().
int routing_flooding_blacklist_add | ( | rimeaddr_t * | neighbour | ) |
Adds (or refreshes) the entry of 'neighbour' on the blacklist.
neighbour | Address of the neighbour |
Definition at line 111 of file routing_flooding.c.
References CLOCK_SECOND, clock_time(), entry, list_add(), list_head(), list_item_next(), memb_alloc(), NULL, rimeaddr_cmp(), and rimeaddr_copy().
Referenced by routing_flooding_bundle_sent().
void routing_flooding_blacklist_delete | ( | rimeaddr_t * | neighbour | ) |
Deletes a neighbour from the blacklist.
neighbour | Address of the neighbour |
Definition at line 157 of file routing_flooding.c.
References entry, list_head(), list_item_next(), list_remove(), memb_free(), NULL, and rimeaddr_cmp().
Referenced by routing_flooding_bundle_sent().
void routing_flooding_bundle_delivered_locally | ( | struct mmem * | bundlemem | ) |
Incoming notification, that service has finished processing bundle.
bundlemem | Pointer to the MMEM struct of the bundle |
Definition at line 766 of file routing_flooding.c.
References bundle_decrement(), delivery_unblock_service(), entry, list_head(), list_item_next(), MMEM_PTR, NULL, rimeaddr_copy(), rimeaddr_node_addr, ROUTING_FLAG_IN_DELIVERY, routing_flooding_check_keep_bundle(), routing_flooding_schedule_resubmission(), and ROUTING_NEI_MEM.
void routing_flooding_bundle_sent | ( | struct transmit_ticket_t * | ticket, |
uint8_t | status | ||
) |
Callback function informing us about the status of a sent bundle.
ticket | CL transmit ticket of the bundle |
status | status code |
Definition at line 653 of file routing_flooding.c.
References bundle_number, convert_eid_to_rime(), DISCOVERY, entry, list_head(), list_item_next(), MMEM_PTR, NULL, rimeaddr_cmp(), rimeaddr_copy(), routing_flooding_blacklist_add(), routing_flooding_blacklist_delete(), routing_flooding_check_keep_bundle(), routing_flooding_schedule_resubmission(), ROUTING_NEI_MEM, and statistics_bundle_outgoing().
void routing_flooding_check_keep_bundle | ( | uint32_t | bundle_number | ) |
Checks whether a bundle still has to be kept or can be deleted.
bundle_number | Number of the bundle |
Definition at line 462 of file routing_flooding.c.
References BUNDLE_STORAGE, entry, list_head(), list_item_next(), MMEM_PTR, and NULL.
Referenced by routing_flooding_bundle_delivered_locally(), routing_flooding_bundle_sent(), and routing_flooding_send_to_local().
void routing_flooding_delete_bundle | ( | uint32_t | bundle_number | ) |
deletes bundle from list
bundle_number | bundle number of the bundle |
Definition at line 611 of file routing_flooding.c.
References entry, list_head(), list_item_next(), list_remove(), memb_free(), mmem_free(), MMEM_PTR, and NULL.
int routing_flooding_forward_directly | ( | struct routing_entry_t * | entry | ) |
Forward a bundle to its destination.
entry | Pointer to the routing entry of the bundle |
Definition at line 272 of file routing_flooding.c.
References convert_eid_to_rime(), DISCOVERY, FLOOD_ROUTE_RETURN_OK, list_item_next(), NULL, rimeaddr_cmp(), and routing_flooding_send_bundle().
Referenced by routing_flooding_send_to_known_neighbours().
int routing_flooding_forward_normal | ( | struct routing_entry_t * | entry | ) |
Forward a bundle to the next hop.
entry | Pointer to the routing entry of the bundle |
Definition at line 320 of file routing_flooding.c.
References convert_eid_to_rime(), DISCOVERY, FLOOD_ROUTE_RETURN_OK, list_item_next(), NULL, rimeaddr_cmp(), routing_flooding_send_bundle(), ROUTING_NEI_MEM, and source_node.
Referenced by routing_flooding_send_to_known_neighbours().
int routing_flooding_new_bundle | ( | uint32_t * | bundle_number | ) |
Adds a new bundle to the list of bundles.
bundle_number | bundle number of the bundle |
Definition at line 496 of file routing_flooding.c.
References bundle_decrement(), bundle_get_attr(), bundle_number, BUNDLE_STORAGE, entry, list_add(), list_head(), list_item_next(), memb_alloc(), memb_free(), mmem_alloc(), mmem_free(), MMEM_PTR, NULL, registration_is_local(), rimeaddr_copy(), routing_flooding_schedule_resubmission(), and statistics_bundle_incoming().
void routing_flooding_new_neighbour | ( | rimeaddr_t * | dest | ) |
checks if there are bundle to send to dest
dest | pointer to the address of the new neighbor |
Definition at line 194 of file routing_flooding.c.
References routing_flooding_schedule_resubmission().
int routing_flooding_send_bundle | ( | uint32_t | bundle_number, |
rimeaddr_t * | neighbour | ||
) |
Send bundle to neighbour.
bundle_number | Number of the bundle |
neighbour | Address of the neighbour |
Definition at line 205 of file routing_flooding.c.
References bundle_number, NULL, and rimeaddr_copy().
Referenced by routing_flooding_forward_directly(), and routing_flooding_forward_normal().
void routing_flooding_send_to_known_neighbours | ( | void | ) |
iterate through all bundles and forward bundles
It is likely, that we will have less neighbours than bundles - therefore, we want to to go through bundles only once
Definition at line 387 of file routing_flooding.c.
References entry, FLOOD_ROUTE_RETURN_OK, list_head(), list_item_next(), MMEM_PTR, NULL, routing_flooding_forward_directly(), routing_flooding_forward_normal(), and routing_flooding_send_to_local().
int routing_flooding_send_to_local | ( | struct routing_entry_t * | entry | ) |
Deliver a bundle to a local service.
entry | Pointer to the routing entry of the bundle |
Definition at line 231 of file routing_flooding.c.
References BUNDLE_STORAGE, delivery_deliver_bundle(), FLOOD_ROUTE_RETURN_OK, NULL, ROUTING_FLAG_IN_DELIVERY, routing_flooding_check_keep_bundle(), and routing_flooding_schedule_resubmission().
Referenced by routing_flooding_send_to_known_neighbours().
uint32_t routing_entry_t::destination_node |