Teonet library
0.4.7
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ev.h>
#include "ev_mgr.h"
Macros | |
#define | TL0C_VERSION "0.0.1" |
Functions | |
void | tcp_read_cb (struct ev_loop *loop, struct ev_io *w, int revents) |
TCP client callback. More... | |
void | event_cb (ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data) |
Teonet Events callback. More... | |
int | main (int argc, char **argv) |
Main L0 Client example function. More... | |
Variables | |
int | fd |
ev_io | w |
#define TL0C_VERSION "0.0.1" |
Referenced by main().
void event_cb | ( | ksnetEvMgrClass * | ke, |
ksnetEvMgrEvents | event, | ||
void * | data, | ||
size_t | data_len, | ||
void * | user_data | ||
) |
Teonet Events callback.
ke | Pointer to ksnetEvMgrClass |
event | Teonet Event (ksnetEvMgrEvents) |
data | Events data |
data_len | Data length |
user_data | Some user data (may be set in ksnetEvMgrInitPort()) |
References teonet_cfg::app_argv, CMD_ECHO, CMD_PEERS, DEBUG, EV_K_STARTED, ksnetEvMgrClass::ev_loop, fd, ke, KSN_BUFFER_SIZE, ksnet_printf(), ksnetEvMgrGetHostName(), ksnTcpClientCreate(), ksnetEvMgrClass::kt, tcp_read_cb(), ksnetEvMgrClass::teo_cfg, and w.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main L0 Client example function.
argc | Number of arguments |
argv | Arguments array |
References ksnetEvMgrAppParam::app_argc, ksnetEvMgrAppParam::app_argv, ksnetEvMgrAppParam::app_descr, APP_PARAM, event_cb(), ke, ksnetEvMgrInitPort(), ksnetEvMgrRun(), READ_CONFIGURATION, READ_OPTIONS, TL0C_VERSION, and VERSION.
void tcp_read_cb | ( | struct ev_loop * | loop, |
struct ev_io * | w, | ||
int | revents | ||
) |
TCP client callback.
Get packet from L0 Server
loop | Event manager loop |
w | Pointer to watcher |
revents | Events |
References CMD_ECHO_ANSWER, CMD_PEERS_ANSWER, data, DEBUG, free(), ke, KSN_BUFFER_DB_SIZE, ksnet_printf(), ksnetArpShowHeader(), ksnetArpShowLine(), and ksnetEvMgrClass::teo_cfg.
Referenced by event_cb().
int fd |
Referenced by event_cb(), ksnCoreBind(), ksnCoreSendCmdto(), ksnTCPProxyServerClientConnect(), ksnTCPProxyServerStart(), ksnTCPProxyServerStop(), main(), tcp_server_receive_cb(), teoLogReaderOpenCbPP(), tuntap_start(), and tuntap_sys_start().
ev_io w |
Referenced by event_cb(), stdin_cb(), and teoLogReaderOpenCbPP().