#include <stdint.h>
#include <netinet/in.h>
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_sock * | tcp_server_create (struct tcp_conf *conf) |
void | tcp_server_destroy (struct tcp_sock *m) |
struct tcp_sock * | tcp_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) |
enum tcp_sock_state |
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 * | s, | ||
struct tcp_sock * | r | ||
) |
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.