37 #define NULL_STR (void*) null_str
39 #define CHECK_EVENTS_AFTER 11.5
328 #define EVENT_MANAGER_OBJECT(X) _Generic((X), \
329 ksnCommandClass* : __ke_from_command_class, \
330 ksnLNullClass * : __ke_from_L0_class) (X)
332 #define ARP_TABLE_OBJECT(X) _Generic((X), \
333 ksnCommandClass* : __arp_from_command_class) (X)
339 void *
data,
size_t data_len,
void *user_data);
360 int argc,
char** argv,
366 int argc,
char** argv,
KSNet mesh core data.
Definition: net_core.h:38
#0x8000 Teonet based Applications events
Definition: ev_mgr.h:225
#15 After stream connected
Definition: ev_mgr.h:187
teoAsyncClass * ta
Async calls module.
Definition: ev_mgr.h:268
void * n_next
Next network.
Definition: ev_mgr.h:295
ksnetEvMgrClass * __ke_from_L0_class(ksnLNullClass *X)
Definition: ev_mgr.c:46
size_t net_count
Count of networks.
Definition: ev_mgr.h:296
const char * teoGetLibteonetVersion()
Get teonet library version.
Definition: ev_mgr.c:249
File: net_arp.h Author: Kirill Scherba kirill@scherba.ru
Definition: net_arp.h:24
#4 A peer was disconnected from host
Definition: ev_mgr.h:114
int argc
Applications argc.
Definition: ev_mgr.h:314
#25 UNIX socket received data event, data - data received from unix socket, user_data - pointer to th...
Definition: ev_mgr.h:201
#23 New clients visit event to all subscribers (equal to L0_CONNECTED but send number of visits) ...
Definition: ev_mgr.h:197
ksnVpnClass * kvpn
VPN class.
Definition: ev_mgr.h:251
double last_custom_timer
Last time the custom timer called.
Definition: ev_mgr.h:287
ev_idle idle_w
Idle TIMER watcher.
Definition: ev_mgr.h:280
const char * teoGetAppType(ksnetEvMgrClass *ke)
Get current application type.
Definition: ev_mgr.c:214
char * teoGetFullAppTypeFromHostInfo(host_info_data *hid)
Definition: ev_mgr.c:219
double ksnetEvMgrGetTime(ksnetEvMgrClass *ke)
Get KSNet event manager time.
Definition: ev_mgr.c:701
void ksnetEvMgrStop(ksnetEvMgrClass *ke)
Stop event manager.
Definition: ev_mgr.c:259
ksnCQueClass * kq
Callback QUEUE class.
Definition: ev_mgr.h:257
EventManagerStatus
Definition: ev_mgr.h:41
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
struct stdin_idle_data stdin_idle_data
STDIN idle watcher data.
#29 LogReader read data.
Definition: ev_mgr.h:223
ev_idle idle_async_w
Async signal idle watcher.
Definition: ev_mgr.h:284
ksnetEvMgrClass * ksnetEvMgrInitPort(int argc, char **argv, ksn_event_cb_type event_cb, int options, int port, void *user_data)
Initialize KSNet Event Manager and network and set new default port.
Definition: ev_mgr.c:104
#13 After terminal started (in place to define commands
Definition: ev_mgr.h:171
int ksnetEvMgrRestart(int argc, char **argv)
Restart application.
Definition: ev_mgr.c:1093
struct ksnetEvMgrClass ksnetEvMgrClass
KSNet event manager functions data.
int runEventMgr
Run even manages (stop if 0)
Definition: ev_mgr.h:272
int ksnetAllowAckEvent(ksnetEvMgrClass *ke, int allow)
Allow or disallow send ACK event (EV_K_RECEIVED_ACK) to teonet event loop.
Definition: tr-udp.c:38
ev_signal sigkill_w
Signal SIGKILL watcher.
Definition: ev_mgr.h:305
#21 New L0 client connected to L0 server
Definition: ev_mgr.h:195
struct ev_loop * ev_loop
Event loop.
Definition: ev_mgr.h:277
#19 Subscribe answer command received
Definition: ev_mgr.h:192
ksnetEvMgrClass * ke
Definition: ev_mgr.h:346
teoMetricClass * tm
Metric send module.
Definition: ev_mgr.h:270
bool is_rhost
This host is rhost flag.
Definition: ev_mgr.h:320
double custom_timer_interval
Custom timer interval.
Definition: ev_mgr.h:286
#12 Async event
Definition: ev_mgr.h:158
void(* event_cb_t)(ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data)
Event callback type.
Definition: ev_mgr.h:338
#22 A L0 client was disconnected from L0 server
Definition: ev_mgr.h:196
#16 Connection timeout
Definition: ev_mgr.h:188
PblList * async_queue
Async data queue.
Definition: ev_mgr.h:289
ev_signal sigabrt_w
Signal SIGABRT watcher.
Definition: ev_mgr.h:302
#18 Input stream has a data
Definition: ev_mgr.h:190
teonet_cfg teo_cfg
KSNet configuration.
Definition: ev_mgr.h:261
ev_signal sigterm_w
Signal SIGTERM watcher.
Definition: ev_mgr.h:300
ksnCQue Class structure definition
Definition: cque.h:18
File: teodb.h Author: Kirill Scherba kirill@scherba.ru
Definition: teodb.h:18
ksnLNullClass * kl
L0 Server class.
Definition: ev_mgr.h:253
void ksnetEvMgrSetCustomTimer(ksnetEvMgrClass *ke, double time_interval)
Set custom timer interval.
Definition: ev_mgr.c:559
Stream module class structure.
Definition: stream.h:78
ev_signal sigsegv_w
Signal SIGSEGV watcher.
Definition: ev_mgr.h:301
void * n_prev
Previouse network.
Definition: ev_mgr.h:294
int app_argc
Definition: ev_mgr.h:234
Teonet Async class data definition.
Definition: async_calls.h:16
#5 This host Received a data
Definition: ev_mgr.h:128
Application parameters user data.
Definition: ev_mgr.h:232
ksnTermClass * kter
Terminal class.
Definition: ev_mgr.h:256
ev_io * stdin_w
Definition: ev_mgr.h:348
#28 Logging server event, like EV_K_RECEIVED: data Pointer to ksnCorePacketData, data_len Size of ksn...
Definition: ev_mgr.h:221
int ksnetEvMgrFree(ksnetEvMgrClass *ke, int free_async)
Free ksnetEvMgrClass after run.
Definition: ev_mgr.c:474
void event_cb(ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data)
Teonet event handler.
Definition: app/teodb.c:348
teoLoggingClientClass * lc
Logging client class // move it up after testing.
Definition: ev_mgr.h:264
ev_idle idle_activity_w
Idle Check activity watcher.
Definition: ev_mgr.h:281
void * user_data
Pointer to user data or NULL if absent.
Definition: ev_mgr.h:309
void * teo_class
Pointer to Teonet c++ Class (in c++ wrapper)
Definition: ev_mgr.h:310
#3 New peer connected to host event
Definition: ev_mgr.h:101
ev_signal sigstop_w
Signal SIGSTOP watcher.
Definition: ev_mgr.h:306
#2 Calls after event manager stopped
Definition: ev_mgr.h:88
char * app_version
Application version.
Definition: ev_mgr.h:318
int ksnetEvMgrRun(ksnetEvMgrClass *ke)
Start KSNet Event Manager and network communication.
Definition: ev_mgr.c:301
#20 A peer subscribed to event at this host
Definition: ev_mgr.h:193
size_t net_idx
Network index.
Definition: ev_mgr.h:293
ksnStreamClass * ks
Stream class.
Definition: ev_mgr.h:259
#24 HTTP WebSocket server event, data - depends of event, user data - poiter to hws_event ...
Definition: ev_mgr.h:199
const char ** app_argv
Definition: ev_mgr.h:235
KSNet terminal module class data definition.
Definition: net_term.h:23
uint32_t idle_count
Idle callback count.
Definition: ev_mgr.h:274
ksnetEvMgrClass * ksnetEvMgrInit(int argc, char **argv, ksn_event_cb_type event_cb, int options)
Initialize KSNet Event Manager and network.
Definition: ev_mgr.c:79
Teonet Logging client class data definition.
Definition: logging_client.h:16
pthread_mutex_t async_mutex
Async data queue mutex.
Definition: ev_mgr.h:290
ksnetArpClass * __arp_from_command_class(ksnCommandClass *X)
Definition: ev_mgr.c:48
ksnetHotkeysClass * kh
Hotkeys class.
Definition: ev_mgr.h:250
Hot keys class data.
Definition: hotkeys.h:81
int remove_peer_addr(ksnetEvMgrClass *ke, __CONST_SOCKADDR_ARG addr)
Remove peer by address.
Definition: ev_mgr.c:812
void teoSetAppType(ksnetEvMgrClass *ke, char *type)
Set Teonet application type.
Definition: ev_mgr.c:192
#10 Hotkey event
Definition: ev_mgr.h:156
void * data
Definition: ev_mgr.h:347
ksnetEvMgrEvents
KSNet event manager events.
Definition: ev_mgr.h:49
teoLoggingServerClass * ls
Logging server class // move it up after testing.
Definition: ev_mgr.h:263
ksnTDBClass * kf
PBL KeyFile class.
Definition: ev_mgr.h:258
#14 Teonet Callback QUEUE event
Definition: ev_mgr.h:185
void(* event_cb)(struct ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data)
Definition: ev_mgr.h:276
#1 Calls before event manager stopped
Definition: ev_mgr.h:75
struct cli_def * cli
Definition: ev_mgr.h:312
pthread_mutex_t printf_mutex
Printf data queue mutex.
Definition: ev_mgr.h:291
#0 Calls immediately after event manager starts
Definition: ev_mgr.h:62
KSNet event manager functions data.
Definition: ev_mgr.h:245
ksnTunClass * ktun
Tunnel class.
Definition: ev_mgr.h:255
uint32_t timer_val
Event loop timer value.
Definition: ev_mgr.h:273
#8 Idle check host events (after 11.5 after last host send or receive data)
Definition: ev_mgr.h:142
void teoSetAppVersion(ksnetEvMgrClass *ke, char *version)
Set Teonet application version.
Definition: ev_mgr.c:203
KSNet command class data.
Definition: net_com.h:95
File: net_tun.h Author: Kirill Scherba.
Definition: net_tun.h:18
teoLogReaderClass * lr
Log reader class.
Definition: ev_mgr.h:266
char * app_type
Application type.
Definition: ev_mgr.h:317
ksnCoreClass * kc
KSNet core class.
Definition: ev_mgr.h:249
ksnTCPProxyClass * tp
TCP Proxy class.
Definition: ev_mgr.h:254
#9 Timer event
Definition: ev_mgr.h:143
ev_async sig_async_w
Async signal watcher.
Definition: ev_mgr.h:283
int ksnetEvMgrStatus(ksnetEvMgrClass *ke)
Definition: ev_mgr.c:263
#7 This host Received ACK to sent data
Definition: ev_mgr.h:141
void(* ksn_event_cb_type)(ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data)
Definition: ev_mgr.h:352
ksnTcpClass * kt
TCP Client/Server class.
Definition: ev_mgr.h:252
uint32_t idle_activity_count
Idle activity callback count.
Definition: ev_mgr.h:275
#26 Database updated
Definition: ev_mgr.h:203
ksnetEvMgrClass * __ke_from_command_class(ksnCommandClass *X)
Definition: ev_mgr.c:45
void * km
Pointer to multi net class.
Definition: ev_mgr.h:248
struct ksnetEvMgrAppParam ksnetEvMgrAppParam
Application parameters user data.
host_info_data * teoGetHostInfo(ksnetEvMgrClass *ke, size_t *hd_len)
Get host info data.
Definition: ev_mgr.c:584
const char * null_str
File: ev_mgr.h Author: Kirill Scherba kirill@scherba.ru
Definition: ev_mgr.c:39
#27 Angular interval event happened
Definition: ev_mgr.h:219
ksnLNull Class structure definition
Definition: l0-server.h:41
TCP Proxy class data.
Definition: tcp_proxy.h:87
ev_signal sigint_w
Signal SIGINT watcher.
Definition: ev_mgr.h:299
ev_timer timer_w
Timer watcher.
Definition: ev_mgr.h:282
char * ksnetEvMgrGetHostName(ksnetEvMgrClass *ke)
Return host name.
Definition: ev_mgr.c:571
File: vpn.h Author: Kirill Scherba.
Definition: vpn.h:22
Teonet Logging server class data definition.
Definition: logging_server.h:16
const char ** app_descr
Definition: ev_mgr.h:236
const char * teoGetAppVersion(ksnetEvMgrClass *ke)
Get current application version.
Definition: ev_mgr.c:239
#17 After stream disconnected
Definition: ev_mgr.h:189
char ** argv
Applications argv.
Definition: ev_mgr.h:315
ev_signal sigquit_w
Signal SIGQUIT watcher.
Definition: ev_mgr.h:304
#11 User press A hotkey
Definition: ev_mgr.h:157
Definition: log_reader.h:24
File: net_tcp.h Author: Kirill Scherba.
Definition: net_tcp.h:20
#6 Wrong packet received
Definition: ev_mgr.h:129
STDIN idle watcher data.
Definition: ev_mgr.h:344
void ksnetEvMgrAsync(ksnetEvMgrClass *ke, void *data, size_t data_len, void *user_data)
Async call to Event manager.
Definition: ev_mgr.c:672