Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tcp_proxy.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <pbl.h>
#include <ev.h>
#include "config/conf.h"

Go to the source code of this file.

Data Structures

struct  ksnTCPProxyHeader
 TCP Proxy packet(message) header structure. More...
 
struct  ksnTCPProxyPacketData
 TCP Proxy packet data structure. More...
 
struct  ksnTCPProxyData
 ksnTCPProxyClass map data More...
 
struct  ksnTCPProxyClass
 TCP Proxy class data. More...
 

Typedefs

typedef struct ksnTCPProxyHeader ksnTCPProxyHeader
 TCP Proxy packet(message) header structure. More...
 
typedef struct
ksnTCPProxyPacketData 
ksnTCPProxyPacketData
 TCP Proxy packet data structure. More...
 
typedef struct ksnTCPProxyData ksnTCPProxyData
 ksnTCPProxyClass map data More...
 
typedef struct ksnTCPProxyClass ksnTCPProxyClass
 TCP Proxy class data. More...
 

Enumerations

enum  ksnTCPProxyBufferStage { WAIT_FOR_START, WAIT_FOR_END, PROCESS_PACKET }
 TCP Proxy buffer stage. More...
 
enum  ksnTCPProxyCommand { CMD_TCPP_PROXY }
 TCP Proxy protocol command. More...
 

Functions

ksnTCPProxyClassksnTCPProxyInit (void *ke)
 Initialize TCP Proxy module. More...
 
void ksnTCPProxyDestroy (ksnTCPProxyClass *tp)
 Destroy TCP Proxy module. More...
 
int ksnTCPProxyClientConnect (ksnTCPProxyClass *tp)
 Connect to TCP Proxy server. More...
 

Detailed Description

Author
Kirill Scherba kiril.nosp@m.l@sc.nosp@m.herba.nosp@m..ru

Teonet TCP Proxy module

Created on September 8, 2015, 2:00 AM

Typedef Documentation

TCP Proxy class data.

TCP Proxy packet(message) header structure.

TCP Proxy packet data structure.

Enumeration Type Documentation

TCP Proxy buffer stage.

Enumerator
WAIT_FOR_START 

Wait for begibbibg of the packet.

WAIT_FOR_END 

Wait for end of the packet.

PROCESS_PACKET 

Process the packet in buffer.

TCP Proxy protocol command.

Enumerator
CMD_TCPP_PROXY 

Resend packet to UDP Proxy client/server.

Function Documentation

int ksnTCPProxyClientConnect ( ksnTCPProxyClass tp)

Connect to TCP Proxy server.

Get address and port from teonet configuration and connect to R-Host TCP Server

Parameters
tpPointer to ksnTCPProxyClass
Returns
0 - Successfully connected

References ksnTCPProxyPacketData::buffer, cmd_tcppc_read_cb(), DEBUG, ksnTCPProxyClass::fd_client, ksnTCPProxyPacketData::header, kev, ksn_printf, ksnTcpClientCreate(), ksnTCPProxyPacketData::length, MODULE, ksnTCPProxyClass::packet, ksnTCPProxyPacketData::ptr, ksnTCPProxyPacketData::stage, ksnTCPProxyClass::w_client, and WAIT_FOR_START.

Referenced by connect_r_host_cb(), and ksnTCPProxyInit().

void ksnTCPProxyDestroy ( ksnTCPProxyClass tp)

Destroy TCP Proxy module.

Parameters
tpPointer to ksnTCPProxyClass

References free(), ksnTCPProxyClientStop(), ksnTCPProxyServerStop(), and ksnTCPProxyClass::map.

Referenced by modules_destroy(), test_5_1(), and test_5_2().

ksnTCPProxyClass* ksnTCPProxyInit ( void *  ke)