- x = send_request(c, "%d %x %s %s %s %s %x %d", ADD_EDGE, rand(),
- e->from->name, e->to->name, address, port,
- e->options, e->weight);
+ if(e->from->submesh) {
+ from_submesh = e->from->submesh->name;
+ } else {
+ from_submesh = CORE_MESH;
+ }
+
+ if(e->to->submesh) {
+ to_submesh = e->to->submesh->name;
+ } else {
+ to_submesh = CORE_MESH;
+ }
+
+ if(e->from->submesh) {
+ s = e->from->submesh;
+ } else {
+ s = e->to->submesh;
+ }
+
+ x = send_request(mesh, c, s, "%d %x %s %d %s %s %s %s %d %s %x %d %d %x", ADD_EDGE, prng(mesh, UINT_MAX),
+ e->from->name, e->from->devclass, from_submesh, e->to->name, address, port,
+ e->to->devclass, to_submesh, OPTION_PMTU_DISCOVERY, e->weight, contradictions, e->from->session_id);