libopm
0.1
|
#include "setup.h"
#include "config.h"
#include "libopm.h"
#include "malloc.h"
#include "opm_error.h"
#include "opm_types.h"
#include "opm_common.h"
#include "list.h"
#include "inet.h"
#include "proxy.h"
#include <errno.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
Functions | |
OPM_T * | opm_create () |
OPM_REMOTE_T * | opm_remote_create (const char *ip) |
void | opm_remote_free (OPM_REMOTE_T *remote) |
OPM_ERR_T | opm_callback (OPM_T *scanner, int type, OPM_CALLBACK_FUNC *function, void *data) |
void | opm_free (OPM_T *scanner) |
OPM_ERR_T | opm_config (OPM_T *scanner, int key, void *value) |
OPM_ERR_T | opm_addtype (OPM_T *scanner, int type, unsigned short int port) |
OPM_ERR_T | opm_remote_addtype (OPM_REMOTE_T *remote, int type, unsigned short int port) |
OPM_ERR_T | opm_scan (OPM_T *scanner, OPM_REMOTE_T *remote) |
void | opm_end (OPM_T *scanner, OPM_REMOTE_T *remote) |
void | opm_endscan (OPM_T *scanner, OPM_REMOTE_T *remote) |
size_t | opm_active (OPM_T *scanner) |
void | opm_cycle (OPM_T *scanner) |
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().
OPM_REMOTE_T* opm_remote_create | ( | const char * | ip | ) |
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 * | remote | ) |
OPM_ERR_T opm_callback | ( | OPM_T * | scanner, |
int | type, | ||
OPM_CALLBACK_FUNC * | function, | ||
void * | data | ||
) |
References _OPM::callbacks, CBLEN, _OPM_CALLBACK::data, _OPM_CALLBACK::func, OPM_ERR_CBNOTFOUND, and OPM_SUCCESS.
Referenced by main().
void opm_free | ( | OPM_T * | scanner | ) |
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().
References _OPM::config, and libopm_config_set().
Referenced by main().
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 * | remote, |
int | type, | ||
unsigned short int | port | ||
) |
OPM_ERR_T opm_scan | ( | OPM_T * | scanner, |
OPM_REMOTE_T * | remote | ||
) |
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 * | scanner, |
OPM_REMOTE_T * | remote | ||
) |
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 * | scanner, |
OPM_REMOTE_T * | remote | ||
) |
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().
size_t opm_active | ( | OPM_T * | scanner | ) |
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.
void opm_cycle | ( | OPM_T * | scanner | ) |
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().