Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teol0cli.c File Reference
#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
 

Detailed Description

Macro Definition Documentation

#define TL0C_VERSION   "0.0.1"
Examples:
teol0cli.c.

Referenced by main().

Function Documentation

void event_cb ( ksnetEvMgrClass ke,
ksnetEvMgrEvents  event,
void *  data,
size_t  data_len,
void *  user_data 
)

Teonet Events callback.

Parameters
kePointer to ksnetEvMgrClass
eventTeonet Event (ksnetEvMgrEvents)
dataEvents data
data_lenData length
user_dataSome user data (may be set in ksnetEvMgrInitPort())
Examples:
teol0cli.c.

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.

Parameters
argcNumber of arguments
argvArguments array
Returns
Examples:
teol0cli.c.

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

Parameters
loopEvent manager loop
wPointer to watcher
reventsEvents
Examples:
teol0cli.c.

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().

Variable Documentation

ev_io w
Examples:
teol0cli.c, and teotcp.c.

Referenced by event_cb(), stdin_cb(), and teoLogReaderOpenCbPP().