18 #include "teonet_l0_client.h"
90 #define CMD_TRUDP_CHECK(CMD) (!CMD || CMD == CMD_CONNECT || (CMD >= CMD_64_RESERVED && CMD < CMD_192_RESERVED))
142 char *addr, uint32_t port);
146 ksnet_arp_data_ext *arp,
void *data);
148 ksnet_arp_data_ext *arp,
void *data);
#86 Request number of peers, allow JSON in request
Definition: net_com.h:56
File: net_arp.h Author: Kirill Scherba kirill@scherba.ru
Definition: net_arp.h:24
ksnCommandClass * ksnCommandInit(void *kc)
Initialize ksnet command class.
Definition: net_com.c:63
ksnet_arp_data_ext * arp
Pointer to extended ARP Table data.
Definition: net_com.h:123
void * data
Received data.
Definition: net_com.h:117
#102 Request public IPs, which set by l0_public_ipv4, l0_public_ipv6 parameters
Definition: net_com.h:74
#68 Group of packets (Splited packets)
Definition: net_com.h:38
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
uint8_t cmd
Command ID.
Definition: net_com.h:115
#3 Reserver for future use
Definition: net_com.h:26
size_t data_len
Received data length.
Definition: net_com.h:118
int mtu
Remote mtu.
Definition: net_com.h:111
#64 Reserver for future use
Definition: net_com.h:34
#95 TR-UDP info answer
Definition: net_com.h:65
char * from
Remote peer name.
Definition: net_com.h:112
#98 LOGGING command
Definition: net_com.h:69
ksnCMD
File: net_com.c Author: Kirill Scherba kirill@scherba.ru
Definition: net_com.h:20
#6 Inform peer about disconnected peer
Definition: net_com.h:29
#72 Get peers, allow JSON in request
Definition: net_com.h:42
#101 Send data to all L0 clients
Definition: net_com.h:72
void * kr
Pointer to KSNet reconnect class.
Definition: net_com.h:99
size_t raw_data_len
Received packet length.
Definition: net_com.h:121
#193 User command
Definition: net_com.h:84
#82 UnSubscribe from event
Definition: net_com.h:52
#90 Request host info, allow JSON in request
Definition: net_com.h:60
#73 Get peers answer
Definition: net_com.h:43
#71 Command to L0 Client
Definition: net_com.h:41
#76 Reconnect answer command
Definition: net_com.h:46
#96 L0 server auth request answer command
Definition: net_com.h:67
#83 Subscribe answer
Definition: net_com.h:53
#1 Reserver for future use
Definition: net_com.h:24
#92 L0 server info request
Definition: net_com.h:62
#89 LO server statistic
Definition: net_com.h:59
uint8_t from_len
Remote peer name length.
Definition: net_com.h:113
#99 L0 client reset command
Definition: net_com.h:70
KSNet core received data structure.
Definition: net_com.h:107
#75 Reconnect command
Definition: net_com.h:45
struct ksnCommandClass ksnCommandClass
KSNet command class data.
#255 Last command Reserved for future use
Definition: net_com.h:87
#5 Inform peer about connected peer
Definition: net_com.h:28
void * ks
Pointer to KSNet split class.
Definition: net_com.h:98
#define kc
Definition: hotkeys.c:72
#87 Number of peers answer
Definition: net_com.h:57
#129 User command
Definition: net_com.h:79
void ksnCommandDestroy(ksnCommandClass *kco)
Destroy ksnet command class.
Definition: net_com.c:78
#147 Confirm auth
Definition: net_com.h:80
#0 Common command
Definition: net_com.h:23
int ksnCommandSendCmdConnect(ksnCommandClass *kco, char *to, char *name, char *addr, uint32_t port)
Send CMD_CONNECT command to peer.
Definition: net_com.c:310
#80 Clients list
Definition: net_com.h:50
#195
Definition: net_com.h:85
#65 Echo test message: auto replay test message command
Definition: net_com.h:35
#4 A Peer want connect to r-host
Definition: net_com.h:27
struct ksnCorePacketData ksnCorePacketData
KSNet core received data structure.
#88 Get LO server statistic request, allow JSON in request
Definition: net_com.h:58
#103 Public IPs answer
Definition: net_com.h:75
void * ksnCommandEchoBuffer(ksnCommandClass *kco, void *data, size_t data_len, size_t *data_t_len)
Create ECHO command buffer.
Definition: net_com.c:260
#70 Command from L0 Client
Definition: net_com.h:40
#78 Auth answer command
Definition: net_com.h:48
#85 Clients number
Definition: net_com.h:55
KSNet command class data.
Definition: net_com.h:95
#8 Reset command, data: byte or char 0 - soft reset; 1 - hard reset
Definition: net_com.h:31
int ksnCommandCheck(ksnCommandClass *kco, ksnCorePacketData *rd)
Check and process command.
Definition: net_com.c:91
void * ksscr
Pointer to teoSScrClass.
Definition: net_com.h:100
void * raw_data
Received packet data.
Definition: net_com.h:120
#84 Request clients number, allow JSON in request
Definition: net_com.h:54
#81 Subscribe to event
Definition: net_com.h:51
#196
Definition: net_com.h:86
#192 Reserver for future use
Definition: net_com.h:83
#77 Auth command
Definition: net_com.h:47
int l0_f
L0 command flag (from set to l0 client name)
Definition: net_com.h:125
#94 TR-UDP info request
Definition: net_com.h:64
int send_cmd_connect_cb_b(ksnetArpClass *ka, char *peer_name, ksnet_arp_data_ext *arp, void *data)
Send connect command.
Definition: net_com.c:1115
int cmd_disconnected_cb(ksnCommandClass *kco, ksnCorePacketData *rd)
Process CMD_DISCONNECTED command.
Definition: net_com.c:1303
#67 Tunnel command
Definition: net_com.h:37
#69 Stream command
Definition: net_com.h:39
#128 Reserver for future use
Definition: net_com.h:78
int send_cmd_connect_cb(ksnetArpClass *ka, char *peer_name, ksnet_arp_data_ext *arp, void *data)
Send connect command.
Definition: net_com.c:1094
#93 L0 server info answer
Definition: net_com.h:63
int ksnCommandSendCmdEcho(ksnCommandClass *kco, char *to, void *data, size_t data_len)
Send ECHO command to peer.
Definition: net_com.c:283
#66 Answer to auto replay message command
Definition: net_com.h:36
#97 AM application command
Definition: net_com.h:68
#2 Reserver for future use
Definition: net_com.h:25
#91 Host info amswer
Definition: net_com.h:61
void * kc
Pointer to KSNet core class object.
Definition: net_com.h:97
#79 Request clients list
Definition: net_com.h:49
#74 Resend command
Definition: net_com.h:44
int port
Remote peer port.
Definition: net_com.h:110
#7 VPN command
Definition: net_com.h:30
#100 Subscribe command extension. (Send answer for one random peer by type)
Definition: net_com.h:71
char * addr
Remote peer IP address.
Definition: net_com.h:109