bool tinc_stop();
+bool route_meshlink(node_t *source,vpn_packet_t *packet) {
+
+ printf("data %s\n",packet->data);
+ printf("data 11%s\n",packet->data+11);
+ printf("data 32%s\n",packet->data+32);
+ node_t* owner = NULL;
+
+ tincpackethdr* hdr = (tincpackethdr*)packet->data;
+ owner = lookup_node(hdr->destination);
+
+ if (owner == NULL) {
+ //Lookup failed
+ printf("NULL\n");
+ return false;
+ }
+ printf("lookupnode %s\n",owner->name);
+
+ if(!owner->status.reachable) {
+ //Do some here
+ return false;
+ }
+
+ //TODO: I skipped here a lot of checks !
+
+ send_packet(owner,packet);
+
+}
// can be called from any thread
bool tinc_send_packet(node_t *receiver, const char* buf, unsigned int len) {
myself->in_packets++;
myself->in_bytes += packet.len;
- route(myself, &packet);
+ route_meshlink(myself, &packet);
return true;
}
}
void route(node_t *source, vpn_packet_t *packet) {
-
- if (/*libmeshlink*/ 1) {
- printf("%s\n",packet->data);
- return;
- }
-
if(pcap)
send_pcap(packet);