libopm
0.1
|
Main header for libopm. More...
#include "opm_common.h"
Data Structures | |
struct | _OPM_CALLBACK |
struct | _OPM_CONFIG |
struct | _OPM |
struct | _OPM_REMOTE |
Macros | |
#define | USE_VAR(var) static char sizeof##var = sizeof(sizeof##var) + sizeof(var) |
#define | RCSID(x) static char rcsid[] = x; USE_VAR(rcsid); |
Typedefs | |
typedef struct _OPM_CONFIG | OPM_CONFIG_T |
typedef struct _OPM | OPM_T |
typedef struct _OPM_REMOTE | OPM_REMOTE_T |
typedef struct _OPM_CALLBACK | OPM_CALLBACK_T |
typedef int | OPM_ERR_T |
typedef void | OPM_CALLBACK_FUNC(OPM_T *, OPM_REMOTE_T *, int, void *) |
Functions | |
OPM_T * | opm_create (void) |
void | opm_free (OPM_T *) |
OPM_REMOTE_T * | opm_remote_create (const char *) |
void | opm_remote_free (OPM_REMOTE_T *) |
OPM_ERR_T | opm_config (OPM_T *, int, void *) |
OPM_ERR_T | opm_scan (OPM_T *, OPM_REMOTE_T *) |
void | opm_end (OPM_T *, OPM_REMOTE_T *) |
void | opm_endscan (OPM_T *, OPM_REMOTE_T *) |
OPM_ERR_T | opm_addtype (OPM_T *, int, unsigned short int) |
OPM_ERR_T | opm_remote_addtype (OPM_REMOTE_T *, int, unsigned short int) |
OPM_ERR_T | opm_callback (OPM_T *, int, OPM_CALLBACK_FUNC *, void *) |
void | opm_cycle (OPM_T *) |
size_t | opm_active (OPM_T *) |
#define USE_VAR | ( | var | ) | static char sizeof##var = sizeof(sizeof##var) + sizeof(var) |
#define RCSID | ( | x | ) | static char rcsid[] = x; USE_VAR(rcsid); |
typedef struct _OPM_CONFIG OPM_CONFIG_T |
typedef struct _OPM_REMOTE OPM_REMOTE_T |
typedef struct _OPM_CALLBACK OPM_CALLBACK_T |
typedef int OPM_ERR_T |
typedef void OPM_CALLBACK_FUNC(OPM_T *, OPM_REMOTE_T *, int, void *) |
OPM_T* opm_create | ( | void | ) |
References _OPM::callbacks, CBLEN, _OPM::config, _OPM_CALLBACK::data, _OPM::fd_use, _OPM_CALLBACK::func, libopm_config_create(), libopm_list_create(), MyMalloc, _OPM::protocols, _OPM::queue, and _OPM::scans.
Referenced by main().
void opm_free | ( | OPM_T * | ) |
References _OPM::callbacks, _OPM::config, _libopm_node::data, _libopm_list::head, libopm_config_free(), libopm_list_free(), libopm_list_remove(), libopm_node_free(), LIST_FOREACH_SAFE, MyFree, _OPM::protocols, _OPM::queue, and _OPM::scans.
Referenced by main().
OPM_REMOTE_T* opm_remote_create | ( | const char * | ) |
References _OPM_REMOTE::bytes_read, _OPM_REMOTE::data, _OPM_REMOTE::ip, libopm_list_create(), MyMalloc, _OPM_REMOTE::port, _OPM_REMOTE::protocol, and _OPM_REMOTE::protocols.
Referenced by main().
void opm_remote_free | ( | OPM_REMOTE_T * | ) |
References _OPM::config, and libopm_config_set().
Referenced by main().
OPM_ERR_T opm_scan | ( | OPM_T * | , |
OPM_REMOTE_T * | |||
) |
References _OPM_SCAN::addr, _OPM::config, inet_pton(), _OPM_REMOTE::ip, libopm_config(), libopm_list_add(), libopm_node_create(), LIST_SIZE, OPM_CONFIG_FD_LIMIT, OPM_ERR_BADADDR, OPM_ERR_NOPROTOCOLS, OPM_SUCCESS, _OPM::protocols, _OPM_REMOTE::protocols, _OPM::queue, and _opm_sockaddr::sa4.
Referenced by main().
void opm_end | ( | OPM_T * | , |
OPM_REMOTE_T * | |||
) |
References _OPM_SCAN::connections, _libopm_node::data, _libopm_list::head, libopm_list_remove(), libopm_node_free(), LIST_FOREACH_SAFE, OPM_CALLBACK_END, opm_endscan(), _OPM::queue, and _OPM_SCAN::remote.
Referenced by open_proxy().
void opm_endscan | ( | OPM_T * | , |
OPM_REMOTE_T * | |||
) |
References _OPM_SCAN::connections, _libopm_node::data, _libopm_list::head, LIST_FOREACH, OPM_STATE_CLOSED, _OPM_SCAN::remote, _OPM::scans, and _OPM_CONNECTION::state.
Referenced by opm_end().
References libopm_list_add(), libopm_node_create(), OPM_ERR_BADPROTOCOL, OPM_SUCCESS, _OPM_PROTOCOL_CONFIG::port, _OPM::protocols, and _OPM_PROTOCOL_CONFIG::type.
Referenced by main().
OPM_ERR_T opm_remote_addtype | ( | OPM_REMOTE_T * | , |
int | , | ||
unsigned short | int | ||
) |
OPM_ERR_T opm_callback | ( | OPM_T * | , |
int | , | ||
OPM_CALLBACK_FUNC * | , | ||
void * | |||
) |
References _OPM::callbacks, CBLEN, _OPM_CALLBACK::data, _OPM_CALLBACK::func, OPM_ERR_CBNOTFOUND, and OPM_SUCCESS.
Referenced by main().
void opm_cycle | ( | OPM_T * | ) |
References _OPM_SCAN::addr, _OPM_CONNECTION::bytes_read, _OPM_REMOTE::bytes_read, _OPM::callbacks, CBLEN, _OPM::config, _OPM_SCAN::connections, _OPM_CONNECTION::creation, _libopm_node::data, _OPM_CALLBACK::data, _OPM_CONNECTION::fd, _OPM::fd_use, _OPM_CALLBACK::func, _libopm_list::head, libopm_config(), libopm_list_add(), libopm_list_remove(), libopm_node_free(), LIST_FOREACH, LIST_FOREACH_SAFE, LIST_SIZE, MyFree, MyMalloc, OPM_CALLBACK_END, OPM_CALLBACK_ERROR, OPM_CALLBACK_NEGFAIL, OPM_CALLBACK_OPENPROXY, OPM_CALLBACK_TIMEOUT, OPM_CONFIG_BIND_IP, OPM_CONFIG_FD_LIMIT, OPM_CONFIG_MAX_READ, OPM_CONFIG_TARGET_STRING, OPM_CONFIG_TIMEOUT, OPM_ERR_BIND, OPM_ERR_MAX_READ, OPM_ERR_NOFD, OPM_STATE_CLOSED, OPM_STATE_ESTABLISHED, OPM_STATE_NEGSENT, OPM_STATE_UNESTABLISHED, _OPM_CONNECTION::port, _OPM_REMOTE::port, _OPM_CONNECTION::protocol, _OPM_REMOTE::protocol, _OPM::queue, _OPM_PROTOCOL::read_function, _OPM_CONNECTION::readbuf, READBUFLEN, _OPM_CONNECTION::readlen, _OPM_SCAN::remote, _opm_sockaddr::sa4, _OPM::scans, _OPM_CONNECTION::state, timeout(), _OPM_PROTOCOL::type, and _OPM_PROTOCOL::write_function.
Referenced by main().
size_t opm_active | ( | OPM_T * | ) |
References _OPM_SCAN::addr, _OPM_CONNECTION::bytes_read, _OPM_SCAN::connections, _libopm_node::data, _OPM_CONNECTION::fd, _libopm_list::head, libopm_list_add(), libopm_list_create(), libopm_list_free(), libopm_list_remove(), libopm_node_create(), libopm_node_free(), LIST_FOREACH, LIST_FOREACH_SAFE, LIST_SIZE, MyFree, MyMalloc, OPM_STATE_UNESTABLISHED, _OPM_CONNECTION::port, _OPM_CONNECTION::protocol, _OPM::protocols, _OPM_REMOTE::protocols, _OPM::queue, _OPM_CONNECTION::readlen, _OPM_SCAN::remote, _OPM::scans, _OPM_CONNECTION::state, and _OPM_PROTOCOL::type.