#include "tcp.h"
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include "conntrackd.h"
#include "fds.h"
Macros | |
#define | SO_RCVBUFFORCE 33 |
#define | SO_SNDBUFFORCE 32 |
#define | TCP_CONNECT_TIMEOUT 1 |
Functions | |
struct tcp_sock * | tcp_server_create (struct tcp_conf *c) |
void | tcp_server_destroy (struct tcp_sock *m) |
struct tcp_sock * | tcp_client_create (struct tcp_conf *c) |
void | tcp_client_destroy (struct tcp_sock *m) |
int | tcp_accept (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_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 *client, struct tcp_sock *server) |
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) |
#define SO_RCVBUFFORCE 33 |
Referenced by tcp_server_create().
#define SO_SNDBUFFORCE 32 |
#define TCP_CONNECT_TIMEOUT 1 |
Referenced by tcp_send().
References tcp_sock::client_fd, tcp_sock::fd, NULL, tcp_sock::state, STATE, TCP_SERVER_ACCEPTING, TCP_SERVER_CONNECTED, and unregister_fd().
References tcp_sock::fd.
References tcp_sock::fd.
References tcp_sock::fd.
References tcp_sock::client_fd.
References tcp_sock::addr, tcp_stats::bytes, tcp_sock::client_fd, tcp_stats::error, tcp_stats::messages, tcp_sock::state, STATE, tcp_sock::stats, TCP_SERVER_ACCEPTING, TCP_SERVER_CONNECTED, and unregister_fd().
References add_alarm(), tcp_sock::addr, alarm_pending(), tcp_stats::bytes, tcp_sock::conf, tcp_stats::error, tcp_sock::fd, tcp_stats::messages, tcp_sock::sockaddr_len, tcp_sock::state, tcp_sock::stats, TCP_CLIENT_CONNECTED, TCP_CLIENT_DISCONNECTED, and TCP_CONNECT_TIMEOUT.
References tcp_sock::fd.
int tcp_snprintf_stats | ( | char * | buf, |
size_t | buflen, | ||
char * | ifname, | ||
struct tcp_sock * | client, | ||
struct tcp_sock * | server | ||
) |
References tcp_stats::bytes, tcp_stats::error, tcp_stats::messages, s, size, tcp_sock::state, tcp_sock::stats, TCP_CLIENT_CONNECTED, and TCP_SERVER_CONNECTED.
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 | ||
) |
References tcp_stats::bytes, tcp_stats::error, tcp_stats::messages, and size.