1#include "main-header.h"
3#include "espressif/esp8266_flash.h"
5#include "route_command.h"
23void set_forward_debug(
byte b) {
34 if (!config_get_flag(CONFIG_FLAGS_ROUTING_ENABLED)) {
35 printf(
"[forwarding] Forwarding of packets disabled\r\n");
40 printf(
"[forwarding] Forwarding packet...\r\n");
44 if (!is_command_valid(com)) {
53 printf(
"[forwarding] unconditionally push to server\r\n");
65 struct route *r = get_configured_route(com);
69 printf(
"[forwarding] no route configured for target %N\r\n", com->
target);
88 printf(
"[forwarding] No hostroute known for target (%N)\r\n", r->sendto);
94 printf(
"[forwarding] forwarding packet from %N to %N via %N on device %i\r\n", com->
sender, com->
target, r->sendto, r->out_device);
long nexthop
here the nodeif of the intermediary hop (the proxy)
int send_command(struct command *com)
send a command to another module (or broadcast)
struct hostroute * routing_find_host(const long nodeid)
find route to host or NULL if none known
byte get_hops_to_server()
how many hops to the server?
void command_print(struct command *com)
prints a command in human readable format to serial console
int forward_packet(struct command *com)
a command is forwarded to target based on our hostroutes
int send_command_fw_info(struct command *com, int err)
send a reply to a command
definitions of routing table structures