SingingCat 0
application
routing_functions.h
Go to the documentation of this file.
1#include "main-header.h"
2
14#ifndef __ROUTINGFCT_H
15#define __ROUTINGFCT_H
16#include "routing.h"
17
18long get_my_node_id();
19
20void routing_init();
21struct hostroute *routing_find_host(const long nodeid);
22struct hostroute *routing_find_route(const long nodeid, const byte sourcedev);
24struct hostroute *routing_get_node_by_index(const int index);
25void routing_event_loop();
27void send_routing_update_now();
29byte got_new_packet(struct command *com, uint8_t signal_indicator);
30void set_routing_debug(byte b);
31byte get_routing_debug();
32void request_route(long host);
33void routing_request_reply(const struct command *com);
34
35int send_command_one_arg(int command, long target, const byte *arg1, int arg1len);
36
37void error_com(void *com);
38int is_command_valid(struct command *com);
40int is_device_online(int device);
41void routing_error(struct command *com, int errorcode);
42
43
44#endif
void routing_print_table()
print routing table
Definition: routing.c:539
struct hostroute * routing_find_route(const long nodeid, const byte sourcedev)
find specific hostroute to target or NULL if none known special case, if we ask for a route to server...
Definition: routing.c:286
void routing_init()
called when we power-up
Definition: routing.c:57
void remove_stale_routes()
"old" routes are being removed this is the route garbage collector
Definition: routing.c:264
struct hostroute * routing_find_host(const long nodeid)
find route to host or NULL if none known
Definition: routing.c:315
long get_my_node_id()
get the id of my node
long host
Definition: routing.h:21
struct hostroute * routing_get_node_by_index(const int index)
finds a nodeid by index. [0...n]
Definition: routing.c:219
int routing_count_nodes()
determine number of nodes known
Definition: routing.c:203
int is_device_online(int device)
return 1 if the specified device is online and routing
Definition: routing.c:63
byte got_new_packet(struct command *com, uint8_t signal_indicator)
stack received a new packet (signal indicator is a 0-255 byte value, interface specific)
Definition: routing.c:111
byte get_hops_to_server()
how many hops to the server?
Definition: routing.c:526
int send_command_one_arg(int command, long target, const byte *arg1, int arg1len)
helper function to quickly and easily send a command somewhere return 0 if ok, else errorcode
Definition: routing.c:567
void request_route(long host)
send an arp request (equivalent)
Definition: queue.c:776
void routing_request_reply(const struct command *com)
we call this when we receive a reply to a routing request this adds or updates a new route
Definition: routing.c:359
definitions of routing table structures