| 1 | /*=========================================================================== |
| 2 | * |
| 3 | * PUBLIC DOMAIN NOTICE |
| 4 | * National Center for Biotechnology Information |
| 5 | * |
| 6 | * This software/database is a "United States Government Work" under the |
| 7 | * terms of the United States Copyright Act. It was written as part of |
| 8 | * the author's official duties as a United States Government employee and |
| 9 | * thus cannot be copyrighted. This software/database is freely available |
| 10 | * to the public for use. The National Library of Medicine and the U.S. |
| 11 | * Government have not placed any restriction on its use or reproduction. |
| 12 | * |
| 13 | * Although all reasonable efforts have been taken to ensure the accuracy |
| 14 | * and reliability of the software and data, the NLM and the U.S. |
| 15 | * Government do not and cannot warrant the performance or results that |
| 16 | * may be obtained by using this software or data. The NLM and the U.S. |
| 17 | * Government disclaim all warranties, express or implied, including |
| 18 | * warranties of performance, merchantability or fitness for any particular |
| 19 | * purpose. |
| 20 | * |
| 21 | * Please cite the author in any work or product based on this material. |
| 22 | * |
| 23 | * =========================================================================== |
| 24 | * |
| 25 | */ |
| 26 | #ifndef _h_kns_mgr_priv_ |
| 27 | #define _h_kns_mgr_priv_cxx . . $ `interfaces/kns/kns-mgr-priv.h:27:9`! |
| 28 | |
| 29 | #ifndef _h_kns_extern_cxx . . $ `interfaces/kns/extern.h:28:9`! |
| 30 | #include <kns/extern.h> |
| 31 | #endif |
| 32 | |
| 33 | #ifndef _h_klib_defs_cxx . . $ `interfaces/klib/defs.h:28:9`! |
| 34 | #include <klib/defs.h> |
| 35 | #endif |
| 36 | |
| 37 | #ifndef _h_klib_text_cxx . . $ `interfaces/klib/text.h:28:9`! |
| 38 | #include <klib/text.h>cxx . . $ `<file>/interfaces/klib/text.h`/ |
| 39 | #endif |
| 40 | |
| 41 | #ifdef __cplusplus |
| 42 | extern "C" { |
| 43 | #endif |
| 44 | |
| 45 | struct KStreamcxx . . $ KStream#; |
| 46 | struct KHttpFilecxx . . $ KHttpFile#; |
| 47 | struct KNSManagercxx . . $ KNSManager#; |
| 48 | struct KFilecxx . . $ `interfaces/klib/defs.h:92:9`!; |
| 49 | struct KConfigcxx . . $ KConfig#; |
| 50 | struct KClientHttpRequestcxx . . $ KClientHttpRequest#; |
| 51 | |
| 52 | /************************** HTTP-retry-related stuff **************************/ |
| 53 | struct HttpRetrySchedulecxx . . $ HttpRetrySchedule#; |
| 54 | |
| 55 | struct HttpRetrySpecscxx . . $ HttpRetrySpecs# |
| 56 | { |
| 57 | struct HttpRetrySchedulecxx . . $ HttpRetrySchedule#** codescxx . . $ HttpRetrySpecs#codes.; |
| 58 | uint8_tcxx . . $ uint8_t# countcxx . . $ HttpRetrySpecs#count.; |
| 59 | }; |
| 60 | typedef struct HttpRetrySpecscxx . . $ HttpRetrySpecs# HttpRetrySpecscxx . . $ HttpRetrySpecs#; |
| 61 | |
| 62 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! HttpRetrySpecsDestroycxx . . $ HttpRetrySpecsDestroy(e754b5432b39d7c7). ( HttpRetrySpecscxx . . $ HttpRetrySpecs#* self ); |
| 63 | |
| 64 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! HttpRetrySpecsInitcxx . . $ HttpRetrySpecsInit(8dd76a6bcdaaef9b). ( HttpRetrySpecscxx . . $ HttpRetrySpecs#* self, struct KConfigcxx . . $ KConfig#* kfg); |
| 65 | |
| 66 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! HttpGetRetryCodescxx . . $ HttpGetRetryCodes(528040bb67a2a9b6). ( const HttpRetrySpecscxx . . $ HttpRetrySpecs#* self, uint16_tcxx . . $ uint16_t# code, uint8_tcxx . . $ uint8_t# * max_retries, const uint16_tcxx . . $ uint16_t# ** sleep_before_retry, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! * open_ended ); |
| 67 | |
| 68 | /* MakeConfig |
| 69 | * Create a manager instance using a custom configuration, for testing. |
| 70 | * Don't imitialize singleton. |
| 71 | * Same as KNSManagerMakeLocal for backward compatibility. |
| 72 | */ |
| 73 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakeConfigcxx . . $ KNSManagerMakeConfig(9a4655fd9aa8cb0a). ( struct KNSManagercxx . . $ KNSManager# **mgr, struct KConfigcxx . . $ KConfig# * kfg ); |
| 74 | |
| 75 | /* MakeWithConfig |
| 76 | * Create a manager instance using a custom configuration, for testing. |
| 77 | * Initialize singleton. |
| 78 | */ |
| 79 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakeWithConfigcxx . . $ KNSManagerMakeWithConfig(9a4655fd9aa8cb0a). ( struct KNSManagercxx . . $ KNSManager# ** mgr, |
| 80 | struct KConfigcxx . . $ KConfig# * kfg ); |
| 81 | |
| 82 | /* SetAdCaching |
| 83 | * Enable Caching to Accession as Directory in cwd |
| 84 | */ |
| 85 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! |
| 86 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerSetAdCachingcxx . . $ KNSManagerSetAdCaching(80e3ca75d2c26876).(struct KNSManagercxx . . $ KNSManager#* self, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! enabled); |
| 87 | |
| 88 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! |
| 89 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerGetAdCachingcxx . . $ KNSManagerGetAdCaching(61da576ddef2aca9).(const struct KNSManagercxx . . $ KNSManager#* self, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! * enabled); |
| 90 | |
| 91 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! |
| 92 | rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerGetResolveToCachecxx . . $ KNSManagerGetResolveToCache(61da576ddef2aca9).(const struct KNSManagercxx . . $ KNSManager#* self, |
| 93 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! * resolveToCache); |
| 94 | |
| 95 | /** MakeReliableHttpFile, KNSManagerMakeReliableClientRequest: |
| 96 | * Make HTTP file/request from a reliable URL: |
| 97 | * we will try harder to recover upon any error |
| 98 | * (make more retries) |
| 99 | */ |
| 100 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakeReliableHttpFilecxx . . $ KNSManagerMakeReliableHttpFile(84905c85b2ee9a57).( |
| 101 | struct KNSManagercxx . . $ KNSManager# const *self, struct KFilecxx . . $ `interfaces/klib/defs.h:92:9`! const **file, struct KStreamcxx . . $ KStream# *conn, ver_tcxx . . $ ver_t# vers, |
| 102 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! reliable, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! need_env_token, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! payRequired, |
| 103 | const char *url, ...); |
| 104 | |
| 105 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakeReliableClientRequestcxx . . $ KNSManagerMakeReliableClientRequest(e374fbc62b5a115e). ( |
| 106 | struct KNSManagercxx . . $ KNSManager# const *self, struct KClientHttpRequestcxx . . $ KClientHttpRequest# **req, |
| 107 | ver_tcxx . . $ ver_t# version, struct KStreamcxx . . $ KStream# *conn, const char *url, ... ); |
| 108 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakePaidHttpFilecxx . . $ KNSManagerMakePaidHttpFile(66d6bbfbca7911ab).(struct KNSManagercxx . . $ KNSManager# const *self, |
| 109 | struct KFilecxx . . $ `interfaces/klib/defs.h:92:9`! const **file, struct KStreamcxx . . $ KStream# *conn, ver_tcxx . . $ ver_t# vers, |
| 110 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! payRequired, const char *url, ...); |
| 111 | KNS_EXTERNcxx . . $ `interfaces/kns/extern.h:34:9`! rc_tcxx . . $ rc_t# CCcxx . . $ `interfaces/kfc/callconv.h:44:11`! KNSManagerMakePaidReliableHttpFilecxx . . $ KNSManagerMakePaidReliableHttpFile(66d6bbfbca7911ab).( |
| 112 | struct KNSManagercxx . . $ KNSManager# const *self, struct KFilecxx . . $ `interfaces/klib/defs.h:92:9`! const **file, |
| 113 | struct KStreamcxx . . $ KStream# *conn, ver_tcxx . . $ ver_t# vers, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! payRequired, const char *url, ...); |
| 114 | |
| 115 | typedef structcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0# { |
| 116 | const char *urlcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#url.; |
| 117 | |
| 118 | const struct KNSManagercxx . . $ KNSManager# * knscxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#kns.; /* used to retrieve HttpRetrySpecs */ |
| 119 | uint32_tcxx . . $ uint32_t# last_sleepcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#last_sleep.; |
| 120 | uint32_tcxx . . $ uint32_t# total_wait_mscxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#total_wait_ms.; |
| 121 | uint32_tcxx . . $ uint32_t# max_total_wait_mscxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#max_total_wait_ms.; |
| 122 | |
| 123 | uint32_tcxx . . $ uint32_t# last_statuscxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#last_status.; |
| 124 | |
| 125 | uint8_tcxx . . $ uint8_t# max_retriescxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#max_retries.; |
| 126 | uint8_tcxx . . $ uint8_t# retries_countcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_0#retries_count.; |
| 127 | } KHttpRetriercxx . . $ KHttpRetrier#; |
| 128 | |
| 129 | rc_tcxx . . $ rc_t# KHttpRetrierInitcxx . . $ KHttpRetrierInit(8d3ea501c65bb3fd). ( KHttpRetriercxx . . $ KHttpRetrier# * self, const char * url, const struct KNSManagercxx . . $ KNSManager# * kns ); |
| 130 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! KHttpRetrierWaitcxx . . $ KHttpRetrierWait(3fb3fd037ba1b210). ( KHttpRetriercxx . . $ KHttpRetrier# * self, uint32_tcxx . . $ uint32_t# status ); |
| 131 | rc_tcxx . . $ rc_t# KHttpRetrierDestroycxx . . $ KHttpRetrierDestroy(9caf02064325a049). ( KHttpRetriercxx . . $ KHttpRetrier# * self ); |
| 132 | |
| 133 | /*----------------------------------------------------------------------------*/ |
| 134 | |
| 135 | //typedef struct HttpProxy HttpProxy; |
| 136 | struct KNSProxiescxx . . $ KNSProxies# * KNSManagerGetProxiescxx . . $ KNSManagerGetProxies(bfcf9ed93078c0ac). ( const struct KNSManagercxx . . $ KNSManager# * self, |
| 137 | size_t * cnt ); |
| 138 | |
| 139 | /* N.B.: DO NOT WHACK THE RETURNED http_proxy String !!! */ |
| 140 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! KNSProxiesGetcxx . . $ KNSProxiesGet(451c5afeb34e85b4). ( struct KNSProxiescxx . . $ KNSProxies# * self, const Stringcxx . . $ String# ** http_proxy, |
| 141 | uint16_tcxx . . $ uint16_t# * http_proxy_port, size_t * cnt, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! * last ); |
| 142 | |
| 143 | /* allow to have multiple comma-separated proxies in a spec */ |
| 144 | #define MULTIPLE_PROXIEScxx . . $ `interfaces/kns/kns-mgr-priv.h:144:9`! 1 |
| 145 | |
| 146 | /*-------------------------------------------------------------------------- |
| 147 | * URLBlock |
| 148 | * RFC 3986 |
| 149 | */ |
| 150 | typedef enumcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_1# |
| 151 | { |
| 152 | st_NONEcxx . . $ st_NONE., |
| 153 | st_HTTPcxx . . $ st_HTTP., |
| 154 | st_HTTPScxx . . $ st_HTTPS., |
| 155 | st_S3cxx . . $ st_S3. |
| 156 | } SchemeTypecxx . . $ SchemeType#; |
| 157 | |
| 158 | typedef enumcxx . . $ $anonymous_type_3fd2e4d70abe7c8e_2# |
| 159 | { |
| 160 | ct_NONEcxx . . $ ct_NONE., |
| 161 | ct_S3cxx . . $ ct_S3., |
| 162 | } CloudTypecxx . . $ CloudType#; |
| 163 | |
| 164 | typedef struct URLBlockcxx . . $ URLBlock# URLBlockcxx . . $ URLBlock#; |
| 165 | struct URLBlockcxx . . $ URLBlock# |
| 166 | { |
| 167 | Stringcxx . . $ String# schemecxx . . $ URLBlock#scheme.; |
| 168 | Stringcxx . . $ String# hostcxx . . $ URLBlock#host.; |
| 169 | Stringcxx . . $ String# pathcxx . . $ URLBlock#path.; /* Path includes any parameter portion */ |
| 170 | Stringcxx . . $ String# querycxx . . $ URLBlock#query.; |
| 171 | Stringcxx . . $ String# fragmentcxx . . $ URLBlock#fragment.; |
| 172 | |
| 173 | uint32_tcxx . . $ uint32_t# portcxx . . $ URLBlock#port.; |
| 174 | |
| 175 | SchemeTypecxx . . $ SchemeType# scheme_typecxx . . $ URLBlock#scheme_type.; |
| 176 | CloudTypecxx . . $ CloudType# cloud_typecxx . . $ URLBlock#cloud_type.; |
| 177 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! tlscxx . . $ URLBlock#tls.; |
| 178 | |
| 179 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! port_dfltcxx . . $ URLBlock#port_dflt.; |
| 180 | }; |
| 181 | extern void URLBlockInitcxx . . $ URLBlockInit(75dcf558bc32d052). ( URLBlockcxx . . $ URLBlock# *self ); |
| 182 | extern rc_tcxx . . $ rc_t# ParseUrlcxx . . $ ParseUrl(aefb472101762896). ( URLBlockcxx . . $ URLBlock# * b, const char * url, size_t url_size ); |
| 183 | |
| 184 | #ifdef __cplusplus |
| 185 | } |
| 186 | #endif |
| 187 | |
| 188 | #endif /* _h_kns_mgr_priv_ */ |