netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
tcp.h File Reference
#include <stdint.h>
#include <netinet/in.h>
Include dependency graph for tcp.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  tcp_conf
 
struct  tcp_stats
 
struct  tcp_sock
 

Enumerations

enum  tcp_sock_state {
  TCP_SERVER_ACCEPTING,
  TCP_SERVER_CONNECTED,
  TCP_CLIENT_DISCONNECTED,
  TCP_CLIENT_CONNECTED
}
 

Functions

struct tcp_socktcp_server_create (struct tcp_conf *conf)
 
void tcp_server_destroy (struct tcp_sock *m)
 
struct tcp_socktcp_client_create (struct tcp_conf *conf)
 
void tcp_client_destroy (struct tcp_sock *m)
 
ssize_t tcp_send (struct tcp_sock *m, const void *data, int size)
 
ssize_t tcp_recv (struct tcp_sock *m, void *data, int size)
 
int tcp_accept (struct tcp_sock *m)
 
int tcp_get_fd (struct tcp_sock *m)
 
int tcp_isset (struct tcp_sock *m, fd_set *readfds)
 
int tcp_accept_isset (struct tcp_sock *m, fd_set *readfds)
 
int tcp_snprintf_stats (char *buf, size_t buflen, char *ifname, struct tcp_sock *s, struct tcp_sock *r)
 
int tcp_snprintf_stats2 (char *buf, size_t buflen, const char *ifname, const char *status, int active, struct tcp_stats *s, struct tcp_stats *r)
 

Enumeration Type Documentation

Enumerator
TCP_SERVER_ACCEPTING 
TCP_SERVER_CONNECTED 
TCP_CLIENT_DISCONNECTED 
TCP_CLIENT_CONNECTED 

Function Documentation

int tcp_accept ( struct tcp_sock m)

References tcp_sock::client_fd, tcp_sock::fd, NULL, tcp_sock::state, STATE, TCP_SERVER_ACCEPTING, TCP_SERVER_CONNECTED, and unregister_fd().

Here is the call graph for this function:

int tcp_accept_isset ( struct tcp_sock m,
fd_set *  readfds 
)

References tcp_sock::fd.

struct tcp_sock* tcp_client_create ( struct tcp_conf conf)

Referenced by tcp_client_start().

Here is the caller graph for this function:

void tcp_client_destroy ( struct tcp_sock m)

References tcp_sock::fd.

int tcp_get_fd ( struct tcp_sock m)

References tcp_sock::fd.

int tcp_isset ( struct tcp_sock m,
fd_set *  readfds 
)

References tcp_sock::client_fd.

ssize_t tcp_recv ( struct tcp_sock m,
void *  data,
int  size 
)
struct tcp_sock* tcp_server_create ( struct tcp_conf conf)

Referenced by tcp_server_start().

Here is the caller graph for this function:

void tcp_server_destroy ( struct tcp_sock m)

References tcp_sock::fd.

int tcp_snprintf_stats ( char *  buf,
size_t  buflen,
char *  ifname,
struct tcp_sock s,
struct tcp_sock r 
)
int tcp_snprintf_stats2 ( char *  buf,
size_t  buflen,
const char *  ifname,
const char *  status,
int  active,
struct tcp_stats s,
struct tcp_stats r 
)