1 #ifndef CONNECT___NCBI_CONNUTIL__H
2 #define CONNECT___NCBI_CONNUTIL__H
92 #define CONN_PORT_FTP 21
93 #define CONN_PORT_SSH 22
94 #define CONN_PORT_SMTP 25
95 #define CONN_PORT_HTTP 80
96 #define CONN_PORT_HTTPS 443
99 #define CONN_USER_LEN 63
100 #define CONN_PASS_LEN 63
101 #define CONN_HOST_LEN 255
102 #define CONN_PATH_LEN 4095
234 #define DEF_CONN_REG_SECTION "CONN"
236 #define REG_CONN_REQ_METHOD "REQ_METHOD"
237 #define DEF_CONN_REQ_METHOD "ANY"
239 #define REG_CONN_USER "USER"
240 #define DEF_CONN_USER ""
242 #define REG_CONN_PASS "PASS"
243 #define DEF_CONN_PASS ""
245 #define REG_CONN_HOST "HOST"
246 #define DEF_CONN_HOST "www.ncbi.nlm.nih.gov"
248 #define REG_CONN_PORT "PORT"
249 #define DEF_CONN_PORT 0
251 #define REG_CONN_PATH "PATH"
252 #define DEF_CONN_PATH "/Service/dispd.cgi"
254 #define REG_CONN_ARGS "ARGS"
255 #define DEF_CONN_ARGS ""
257 #define REG_CONN_HTTP_PROXY_HOST "HTTP_PROXY_HOST"
258 #define DEF_CONN_HTTP_PROXY_HOST ""
260 #define REG_CONN_HTTP_PROXY_PORT "HTTP_PROXY_PORT"
261 #define DEF_CONN_HTTP_PROXY_PORT ""
263 #define REG_CONN_HTTP_PROXY_USER "HTTP_PROXY_USER"
264 #define DEF_CONN_HTTP_PROXY_USER ""
266 #define REG_CONN_HTTP_PROXY_PASS "HTTP_PROXY_PASS"
267 #define DEF_CONN_HTTP_PROXY_PASS ""
269 #define REG_CONN_HTTP_PROXY_LEAK "HTTP_PROXY_LEAK"
270 #define DEF_CONN_HTTP_PROXY_LEAK ""
272 #define REG_CONN_HTTP_PROXY_SKIP "HTTP_PROXY_SKIP"
273 #define DEF_CONN_HTTP_PROXY_SKIP ""
275 #define REG_CONN_HTTP_PUSH_AUTH "HTTP_PUSH_AUTH"
276 #define DEF_CONN_HTTP_PUSH_AUTH ""
278 #define REG_CONN_TIMEOUT "TIMEOUT"
279 #define DEF_CONN_TIMEOUT 30.0
281 #define REG_CONN_MAX_TRY "MAX_TRY"
282 #define DEF_CONN_MAX_TRY 3
284 #define REG_CONN_EXTERNAL "EXTERNAL"
285 #define DEF_CONN_EXTERNAL ""
287 #define REG_CONN_FIREWALL "FIREWALL"
288 #define DEF_CONN_FIREWALL ""
290 #define REG_CONN_STATELESS "STATELESS"
291 #define DEF_CONN_STATELESS ""
293 #define REG_CONN_LB_DISABLE "LB_DISABLE"
294 #define DEF_CONN_LB_DISABLE ""
296 #define REG_CONN_HTTP_VERSION "HTTP_VERSION"
297 #define DEF_CONN_HTTP_VERSION 0
299 #define REG_CONN_DEBUG_PRINTOUT "DEBUG_PRINTOUT"
300 #define DEF_CONN_DEBUG_PRINTOUT ""
302 #define REG_CONN_HTTP_USER_HEADER "HTTP_USER_HEADER"
303 #define DEF_CONN_HTTP_USER_HEADER ""
305 #define REG_CONN_HTTP_REFERER "HTTP_REFERER"
306 #define DEF_CONN_HTTP_REFERER 0
309 #define REG_CONN_LOCAL_ENABLE "LOCAL_ENABLE"
310 #define REG_CONN_LBSMD_DISABLE "LBSMD_DISABLE"
311 #define REG_CONN_LBDNS_ENABLE "LBDNS_ENABLE"
312 #define REG_CONN_LINKERD_ENABLE "LINKERD_ENABLE"
313 #define REG_CONN_NAMERD_ENABLE "NAMERD_ENABLE"
314 #define REG_CONN_DISPD_DISABLE "DISPD_DISABLE"
317 #define REG_CONN_IMPLICIT_SERVER_TYPE "IMPLICIT_SERVER_TYPE"
320 #define REG_CONN_SERVICE_NAME DEF_CONN_REG_SECTION "_" "SERVICE_NAME"
323 #define REG_CONN_LOCAL_SERVICES DEF_CONN_REG_SECTION "_" "LOCAL_SERVICES"
324 #define REG_CONN_LOCAL_SERVER DEF_CONN_REG_SECTION "_" "LOCAL_SERVER"
327 #define REG_CONN_LBDNS_DOMAIN DEF_CONN_REG_SECTION "_" "LBDNS_DOMAIN"
328 #define REG_CONN_LBDNS_DEBUG DEF_CONN_REG_SECTION "_" "LBDNS_DEBUG"
329 #define REG_CONN_LBDNS_HOST DEF_CONN_REG_SECTION "_" "LBDNS_HOST"
330 #define REG_CONN_LBDNS_PORT DEF_CONN_REG_SECTION "_" "LBDNS_PORT"
334 #define DEF_CONN_LOCAL_IPS "LOCAL_IPS"
335 #define REG_CONN_LOCAL_IPS DEF_CONN_REG_SECTION "_" DEF_CONN_LOCAL_IPS
336 #define DEF_CONN_LOCAL_IPS_DISABLE "NONE"
366 (
const char* service,
370 const char* def_value
640 #define ConnNetInfo_PostOverrideUserHeader ConnNetInfo_OverrideUserHeader
826 size_t content_length,
829 const char* user_header,
859 #ifndef NCBI_DEPRECATED
860 # define NCBI_CONNUTIL_DEPRECATED
862 # define NCBI_CONNUTIL_DEPRECATED NCBI_DEPRECATED
870 size_t content_length,
873 const char* user_header,
940 (
const void* src_buf,
957 (
const void* src_buf,
963 const char* allow_symbols
979 (
const void* src_buf,
995 (
const void* src_buf,
1000 size_t* dst_written,
1001 const char* allow_symbols
1070 #define CONN_CONTENT_TYPE_LEN 63
1072 #define MAX_CONTENT_TYPE_LEN (CONN_CONTENT_TYPE_LEN+1)
static CS_CONNECTION * conn
static const char * str(char *buf, int n)
unsigned int TSOCK_Flags
bitwise "OR" of ESOCK_Flags
ELOG_Level
Log severity level.
int ConnNetInfo_ExtendUserHeader(SConnNetInfo *net_info, const char *header)
const char * host
SSL host id (aka SNI) (if differs from "host")
EIO_Status URL_ConnectEx(const char *host, unsigned short port, const char *path, const char *args, TReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_header, SURLExtra *extra, TSOCK_Flags flags, SOCK *sock)
int ConnNetInfo_AddPath(SConnNetInfo *net_info, const char *path)
int ConnNetInfo_SetupStandardArgs(SConnNetInfo *net_info, const char *service)
unsigned short http_proxy_port
int ConnNetInfo_SetTimeout(SConnNetInfo *net_info, const STimeout *timeout)
int ConnNetInfo_OverrideUserHeader(SConnNetInfo *net_info, const char *header)
void ConnNetInfo_DeleteAllArgs(SConnNetInfo *net_info, const char *args)
int ConnNetInfo_PreOverrideUserHeader(SConnNetInfo *net_info, const char *header)
int ConnNetInfo_ParseURL(SConnNetInfo *net_info, const char *url)
char * MIME_ComposeContentTypeEx(EMIME_Type type, EMIME_SubType subtype, EMIME_Encoding encoding, char *buf, size_t bufsize)
int ConnNetInfo_SetArgs(SConnNetInfo *net_info, const char *args)
int ConnNetInfo_AppendUserHeader(SConnNetInfo *net_info, const char *header)
SConnNetInfo * ConnNetInfo_Clone(const SConnNetInfo *net_info)
int ConnNetInfo_AppendArg(SConnNetInfo *net_info, const char *arg, const char *val)
const char * ConnNetInfo_GetValue(const char *service, const char *param, char *value, size_t value_size, const char *def_value)
EIO_Status CONN_StripToPattern(CONN conn, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
Discard all input data before (and including) the first occurrence of a "pattern".
int URL_Decode(const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)
const char * ConnNetInfo_GetArgs(const SConnNetInfo *net_info)
int ConnNetInfo_PreOverrideArg(SConnNetInfo *net_info, const char *arg, const char *val)
SOCK URL_Connect(const char *host, unsigned short port, const char *path, const char *args, EReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_header, int encode_args, TSOCK_Flags flags)
char * ConnNetInfo_URL(const SConnNetInfo *net_info)
int ConnNetInfo_PostOverrideArg(SConnNetInfo *net_info, const char *arg, const char *val)
int ConnNetInfo_PrependUserHeader(SConnNetInfo *net_info, const char *header)
int ConnNetInfo_SetUserHeader(SConnNetInfo *net_info, const char *header)
int MIME_ParseContentTypeEx(const char *str, EMIME_Type *type, EMIME_SubType *subtype, EMIME_Encoding *encoding)
void ConnNetInfo_DeleteUserHeader(SConnNetInfo *net_info, const char *header)
void URL_EncodeEx(const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)
NCBI_CRED cred
SSL credentials (if any)
void ConnNetInfo_Log(const SConnNetInfo *net_info, ELOG_Level sev, LOG log)
const char * http_user_header
EBProxyType http_proxy_mask
int ConnNetInfo_DeleteArg(SConnNetInfo *net_info, const char *arg)
EIO_Status SOCK_StripToPattern(SOCK sock, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
SConnNetInfo * ConnNetInfo_Create(const char *service)
int ConnNetInfo_PrependArg(SConnNetInfo *net_info, const char *arg, const char *val)
void URL_Encode(const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)
#define NCBI_CONNUTIL_DEPRECATED
int ConnNetInfo_Boolean(const char *str)
EBDebugPrintout debug_printout
int URL_DecodeEx(const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)
int ConnNetInfo_SetPath(SConnNetInfo *net_info, const char *path)
const char * http_referer
void ConnNetInfo_Destroy(SConnNetInfo *net_info)
int ConnNetInfo_SetFrag(SConnNetInfo *net_info, const char *frag)
EIO_Status BUF_StripToPattern(BUF buffer, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
@ fProxy_None
No $http_proxy / $https_proxy used.
@ fProxy_Http
$http_proxy used
@ fProxy_Https
$https_proxy used
@ eFWMode_Legacy
Relay, no firewall.
@ eFWMode_Firewall
Regular firewall ports only, no fallback.
@ eFWMode_Adaptive
Regular firewall ports first, then fallback.
@ eFWMode_Fallback
Fallback ports only (w/o trying any regular)
#define NCBI_XCONNECT_EXPORT
const GenericPointer< typename T::ValueType > T2 value
static PCRE2_SIZE bufsize