invite: add proto field (UDP/TCP/BOTH) to invite link binary format
Format per v4 addr: family(1) + socketId(1) + proto(1) + addr(4) + port(2) = 9 bytes (was 8) Proto values: 0x01=UDP, 0x02=TCP, 0x03=BOTH Affects: invite_link_c.h/c (Android), invite_link.h/cpp (desktop), chat_sync.c, conn_mgr.c, joindialog.cpp, utun_node.cpp
This commit is contained in:
1 parent
5276c1288c
commit
d0cca27edd
23 files changed
+329
-61
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#include "../../lib/socket_compat.h"
|
||||
|
||||
#include "../db/db_manager.h"
|
||||
#include "../src/invite_link.h"
|
||||
|
||||
// === C headers ===
|
||||
extern "C" {
|
||||
@@ -157,6 +158,7 @@ QList<NodeAddr> UtunNode::getInviteAddresses(DbManager* db) {
|
||||
if (link->link_state == 3 && link->nat_type == NAT_TYPE_DIRECT) {
|
||||
NodeAddr a;
|
||||
a.socketId = link->conn ? (int)link->conn->sock_id : 0;
|
||||
a.protocol = INVITE_PROTO_UDP;
|
||||
struct sockaddr_storage* sa = &link->remote_addr;
|
||||
if (sa->ss_family == AF_INET) {
|
||||
struct sockaddr_in* sin = (struct sockaddr_in*)sa;
|
||||
@@ -190,6 +192,7 @@ QList<NodeAddr> UtunNode::getInviteAddresses(DbManager* db) {
|
||||
|
||||
NodeAddr a;
|
||||
a.socketId = (int)sock->sock_id;
|
||||
a.protocol = INVITE_PROTO_UDP;
|
||||
if (sa->ss_family == AF_INET) {
|
||||
struct sockaddr_in* sin = (struct sockaddr_in*)sa;
|
||||
a.family = 4;
|
||||
|
||||
Reference in new issue
Block a user