17 #define WIN32_LEAN_AND_MEAN
77 #define sendCmdAnswerTo(ke, rd, name, out_data, out_data_len) \
79 ksnLNullSendToL0(ke, \
80 rd->addr, rd->port, name, strlen(name) + 1, rd->cmd, \
81 out_data, out_data_len); \
83 ksnCoreSendCmdto(ke->kc, name, rd->cmd, \
84 out_data, out_data_len)
93 __SOCKADDR_ARG remaddr);
96 #define ksnCoreSetEventTime(kc) kc->last_check_event = ksnetEvMgrGetTime(kc->ke)
KSNet mesh core data.
Definition: net_core.h:38
const char * null_str
File: ev_mgr.h Author: Kirill Scherba kirill@scherba.ru
Definition: ev_mgr.c:39
File: net_arp.h Author: Kirill Scherba kirill@scherba.ru
Definition: net_arp.h:24
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
int ksnCoreParsePacket(void *packet, size_t packet_len, ksnCorePacketData *recv_data)
Parse received data to ksnCoreRecvData structure.
Definition: net_core.c:535
char * name
Host name.
Definition: net_core.h:40
void teoBroadcastSend(ksnCoreClass *kc, char *to, uint8_t cmd, void *data, size_t data_len)
Send brodcast command to peers by type.
Definition: net_core.c:358
trudpData * ku
TR-UDP class object.
Definition: net_core.h:49
double last_check_event
Last time of check host event.
Definition: net_core.h:46
ev_io host_w
Event Manager host (this host) watcher.
Definition: net_core.h:53
int port
Host IP port.
Definition: net_core.h:43
ksnetCrypt Class data
Definition: crypt.h:17
struct ksnCoreClass ksnCoreClass
KSNet mesh core data.
uint8_t name_len
Host name length.
Definition: net_core.h:41
KSNet core received data structure.
Definition: net_com.h:107
#define kc
Definition: hotkeys.c:72
char * addr
Host IP address.
Definition: net_core.h:42
void * ke
Pointer to Event manager class object.
Definition: net_core.h:54
ksnCommandClass * kco
Command class object.
Definition: net_core.h:48
ksnet_arp_data * ksnCoreSendCmdto(ksnCoreClass *kc, char *to, uint8_t cmd, void *data, size_t data_len)
Send command by name to peer.
Definition: net_core.c:389
KSNet command class data.
Definition: net_com.h:95
ksnCoreClass * ksnCoreInit(void *ke, char *name, int port, char *addr)
Initialize ksnet core.
Definition: net_core.c:108
int fd
Host socket file descriptor.
Definition: net_core.h:44
int ksnCoreBindRaw(int *port, int allow_port_increment_f)
Create and bind UDP socket for client/server.
Definition: net_core.c:197
void ksnCoreDestroy(ksnCoreClass *kc)
Close socket and free memory.
Definition: net_core.c:158
const char * localhost
KSNet mesh core module.
Definition: net_core.c:35
void ksnCoreCheckNewPeer(ksnCoreClass *kc, ksnCorePacketData *rd)
Check new peer.
Definition: net_core.c:695
void ksnCoreProcessPacket(void *kc, void *buf, size_t recvlen, __SOCKADDR_ARG remaddr)
Process teonet packet.
Definition: net_core.c:804
int ksnCoreSendto(ksnCoreClass *kc, char *addr, int port, uint8_t cmd, void *data, size_t data_len)
Send data to remote peer IP:Port.
Definition: net_core.c:247
ksnetArpClass * ka
Arp table class object.
Definition: net_core.h:47