56 #define ksnMultiGet(X, Y) _Generic((Y), \
57 int : teoMultiGetByNumber, \
58 char* : teoMultiGetByNetwork) \
66 uint8_t cmd,
void *
data,
size_t data_len);
void ksnMultiDestroy(ksnMultiClass *km)
Destroy ksnMultiClass object and running networks.
Definition: net_multi.c:144
ksn_event_cb_type event_cb
Definition: net_multi.h:32
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
int run
Run inside init.
Definition: net_multi.h:39
int argc
Applications argc.
Definition: net_multi.h:30
void teoMultiRemoveNet(ksnMultiClass *km, const char *network)
Remove network.
Definition: net_multi.c:125
bool teoMultiIsNetworkExist(ksnMultiClass *km, int number)
Check if network with input number is exist.
Definition: net_multi.c:218
ksnMultiClass * ksnMultiInit(ksnMultiData *md, void *user_data)
Initialize ksnMultiClass object.
Definition: net_multi.c:27
struct ksnMultiClass ksnMultiClass
File: net_multi.h Author: Kirill Scherba kirill@scherba.ru
ksnMultiClass initialize input data
Definition: net_multi.h:28
File: net_multi.h Author: Kirill Scherba kirill@scherba.ru
Definition: net_multi.h:16
ksnetEvMgrClass * teoMultiGetByNumber(ksnMultiClass *km, int number)
Get network by number.
Definition: net_multi.c:176
const char ** names
Names arrays.
Definition: net_multi.h:36
char * ksnMultiShowListStr(ksnMultiClass *km)
Show list of networks.
Definition: net_multi.c:292
const int * ports
Ports arrays.
Definition: net_multi.h:35
ksnetEvMgrClass * teoMultiGetByNetwork(ksnMultiClass *km, char *network_name)
Get network by network name.
Definition: net_multi.c:204
void teoMultiAddNet(ksnMultiClass *km, ksn_event_cb_type e_cb, const char *host, int port, const char *network, void *user_data)
Add new network.
Definition: net_multi.c:87
PblMap * list
Pointer to network list.
Definition: net_multi.h:18
KSNet event manager functions data.
Definition: ev_mgr.h:245
struct ksnMultiData ksnMultiData
ksnMultiClass initialize input data
ksnet_arp_data * teoMultiSendCmdToNet(ksnMultiClass *km, char *peer, char *network, uint8_t cmd, void *data, size_t data_len)
Send command by name (or type) and by network.
Definition: net_multi.c:350
const char ** networks
Networks arrays.
Definition: net_multi.h:37
size_t num
Number of networks.
Definition: net_multi.h:34
void teoMultiRun(ksnMultiClass *km)
Start teonet event loop (for all functions added with ksnMultiInit)
Definition: net_multi.c:72
void(* ksn_event_cb_type)(ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data)
Definition: ev_mgr.h:352
size_t net_count
Number of networks.
Definition: net_multi.h:19
size_t last_net_idx
Last network index.
Definition: net_multi.h:20
ksnet_arp_data * ksnMultiSendCmdTo(ksnMultiClass *km, char *to, uint8_t cmd, void *data, size_t data_len)
: It will be new function for broadcast sending Send command by name to peer
Definition: net_multi.c:372
char ** argv
Applications argv.
Definition: net_multi.h:31