NCBI C++ ToolKit
|
Search Toolkit Book for SSOCK_ApproveInfo
User-level connection approval hook. More...
#include <connect/ncbi_socket.h>
Public Attributes | |
const char * | host |
Textual hostname if provided for outgoing. More... | |
unsigned int | addr |
IPv4 (or -1 if unknown / broadcast), never 0. More... | |
unsigned short | port |
Port number, host byte order, never 0. More... | |
ESOCK_Side | side |
eSOCK_Client (out) / eSOCK_Server (in) More... | |
ESOCK_Type | type |
eSOCK_Socket (conn) / eSOCK_Datagram (packet) More... | |
User-level connection approval hook.
The hook (when installed) gets called for any attempt to establish an outgoing(eSOCK_Client) or incoming(eSOCK_Server) connection(eSOCK_Socket), or to send(eSOCK_Client) or receive(eSOCK_Server) a message packet in a datagram socket(eSOCK_Datagram). The peer end is always identified by the "addr:port" pair (which is non-0 in both parts). Optionally for outgoing transaction, a textual hostname("host") can be provided (to which "addr" corresponds). If the action was requested by a plain IP address, the "host" field is set to NULL.
The hook is expected to return eIO_Success to approve the action, or any other status code to deny. Note that either eIO_Timeout or eIO_Closed returned from the hook, will get converted to eIO_Unknown; and other codes will get passed through to the caller "as is".
Definition at line 343 of file ncbi_socket.h.