57
57
/* Iterator structure
59
59
struct SSERV_IterTag {
60
const char* name; /* requested service name, private storage */
61
TSERV_Type type; /* requested server type(s), specials stripped */
62
unsigned int host; /* preferred host to select, network b.o. */
63
unsigned short port; /* preferred port to select, host b.o. */
64
double pref; /* range [0..100] %% */
65
size_t n_skip; /* actual number of servers in the array */
66
size_t a_skip; /* number of allocated slots in the array */
67
SSERV_Info** skip; /* servers to skip (w/names) */
68
const SSERV_Info* last; /* last server info taken out */
70
const SSERV_VTable* op; /* table of virtual functions */
72
void* data; /* private data field */
73
unsigned ismask:1; /* whether the name is to be treated as a mask */
74
unsigned promiscuous:1; /* as taken from.. */
75
unsigned reverse_dns:1; /* ..types passed.. */
76
unsigned stateless:1; /* .. in SERV_*() calls */
77
unsigned external:1; /* whether this is an external request */
78
const char* arg; /* argument to match; original pointer */
79
size_t arglen; /* == 0 for NULL pointer above */
80
const char* val; /* value to match; original pointer */
81
size_t vallen; /* == 0 for NULL pointer above */
82
TNCBI_Time time; /* the time of call */
60
const char* name; /* requested service name, private storage */
61
TSERV_Type type; /* requested server type(s), specials stripped */
62
unsigned int host; /* preferred host to select, network b.o. */
63
unsigned short port; /* preferred port to select, host b.o. */
64
double pref; /* range [0..100] %% */
65
size_t n_skip; /* actual number of servers in the array */
66
size_t a_skip; /* number of allocated slots in the array */
67
SSERV_Info** skip; /* servers to skip (w/names) */
68
const SSERV_Info* last; /* last server info taken out */
69
const SSERV_VTable* op; /* table of virtual functions */
71
void* data; /* private data field */
72
unsigned ismask:1; /* whether the name is to be treated as a mask */
73
unsigned ok_down:1; /* as taken.. */
74
unsigned ok_suppressed:1; /* ..from types.. */
75
unsigned reverse_dns:1; /* ..as passed into.. */
76
unsigned stateless:1; /* ..SERV_*() calls */
77
unsigned external:1; /* whether this is an external request */
78
const char* arg; /* argument to match; original pointer */
79
size_t arglen; /* == 0 for NULL pointer above */
80
const char* val; /* value to match; original pointer */
81
size_t vallen; /* == 0 for NULL pointer above */
82
TNCBI_Time time; /* the time of call */
86
/* Control whether to skip using registry/environment when opening iterators,
87
* and doing fast track lookups. Default is eOff.
89
extern NCBI_XCONNECT_EXPORT ESwitch SERV_DoFastOpens(ESwitch on);
86
92
/* Modified "fast track" routine for obtaining of a server info in one-shot.
87
93
* Please see <connect/ncbi_service.h> for explanations [SERV_GetInfoEx()].
196
202
} /* extern "C" */
201
* --------------------------------------------------------------------------
202
* $Log: ncbi_servicep.h,v $
203
* Revision 6.40 2006/06/07 20:06:02 lavr
204
* SERV_Print() to set referer (if absent) via its second argument
206
* Revision 6.39 2006/03/06 20:28:37 lavr
209
* Revision 6.38 2006/03/05 17:47:55 lavr
210
* +SERV_ITER::time, new VT::Update proto, SERV_OpenP() to return HINFO
212
* Revision 6.37 2006/01/11 16:26:10 lavr
213
* SERV_Update() and SERV_ITER's VT::Update() have got addt'l "code" argument
215
* Revision 6.36 2005/12/23 18:12:15 lavr
216
* New bitfields in SERV_ITER (corresponding to special service flags)
217
* SERV_OpenP() special requirements for "skip" entries documented
219
* Revision 6.35 2005/12/14 22:04:01 lavr
220
* ESERV_SpecialType reinstated public
222
* Revision 6.34 2005/12/14 21:27:49 lavr
223
* SERV_GetInfoP() and SERV_OpenP(): New signatures (changed parameteres)
225
* Revision 6.33 2005/07/11 18:49:11 lavr
226
* Hashed preference generation algorithm retired (proven to fail often)
228
* Revision 6.32 2005/07/11 18:15:10 lavr
229
* Revised to allow wildcard searches thru service iterator
231
* Revision 6.31 2005/05/04 16:14:57 lavr
234
* Revision 6.30 2005/05/02 16:04:52 lavr
235
* Added export prefixes for most of internal API calls
237
* Revision 6.29 2005/04/25 18:47:29 lavr
238
* Private API to accept SConnNetInfo* for network dispatching to work too
240
* Revision 6.28 2005/04/19 16:33:00 lavr
241
* More comments on how things work (SERV_{GetInfo|Open}P)
243
* Revision 6.27 2005/03/05 21:05:07 lavr
244
* +SERV_ITER::current; +SERV_GetCurrentName()
246
* Revision 6.26 2005/01/31 17:09:34 lavr
247
* Argument affinity moved into service iterator
249
* Revision 6.25 2004/08/19 15:48:04 lavr
250
* SERV_ITER::type renamed into SERV_ITER::types to reflect its bitmask nature
252
* Revision 6.23 2003/06/26 15:19:56 lavr
253
* Additional parameter "external" for SERV_{Open|GetInfo}P()
255
* Revision 6.22 2003/06/09 19:53:11 lavr
258
* Revision 6.21 2003/03/07 22:21:55 lavr
259
* Explain what is "preference" for SERV_GetInfoP()
261
* Revision 6.20 2003/02/28 14:49:09 lavr
262
* SERV_Preference(): redeclare last argument 'unsigned'
264
* Revision 6.19 2003/02/13 21:37:28 lavr
265
* Comment SERV_Preference(), change last argument
267
* Revision 6.18 2003/01/31 21:19:41 lavr
270
* Revision 6.17 2002/10/28 20:16:00 lavr
271
* Take advantage of host info API
273
* Revision 6.16 2002/10/11 19:48:25 lavr
275
* const dropped in return value of SERV_ServiceName()
277
* Revision 6.15 2002/09/19 18:08:43 lavr
278
* Header file guard macro changed; log moved to end
280
* Revision 6.14 2002/05/06 19:17:04 lavr
281
* +SERV_ServiceName() - translation of service name
283
* Revision 6.13 2001/09/28 20:50:41 lavr
284
* Update VT method changed - now called on per-line basis
286
* Revision 6.12 2001/09/24 20:23:39 lavr
287
* Reset() method added to VT
289
* Revision 6.11 2001/06/25 15:38:00 lavr
290
* Heap of services is now not homogeneous, but can
291
* contain entries of different types. As of now,
292
* Service and Host entry types are introduced and defined
294
* Revision 6.10 2001/05/11 15:30:02 lavr
295
* Correction in comment
297
* Revision 6.9 2001/04/26 14:18:45 lavr
298
* SERV_MapperName moved to the private header
300
* Revision 6.8 2001/04/24 21:33:58 lavr
301
* Added members of mapper V-table: penalize(method) and name(data).
302
* Service iterator has got new field 'last' to keep the latest given info.
304
* Revision 6.7 2001/03/06 23:57:49 lavr
305
* Minor beautifications
307
* Revision 6.6 2000/12/29 18:12:51 lavr
308
* SERV_Print added to private interface
310
* Revision 6.5 2000/12/06 22:21:27 lavr
311
* SERV_Print added to private interface
313
* Revision 6.4 2000/10/20 17:22:55 lavr
314
* VTable changed to have 'Update' method
315
* 'SERV_Update' added to private interface
317
* Revision 6.3 2000/10/05 21:37:51 lavr
318
* Mapper-specific private data field added
320
* Revision 6.2 2000/05/22 16:53:12 lavr
321
* Rename service_info -> server_info everywhere (including
322
* file names) as the latter name is more relevant
324
* Revision 6.1 2000/05/12 18:38:16 lavr
325
* First working revision
327
* ==========================================================================
330
205
#endif /* CONNECT___NCBI_SERVICEP__H */