Guardtime KSI c SDK
net_async.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-2018 Guardtime, Inc.
3  *
4  * This file is part of the Guardtime client SDK.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License").
7  * You may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  * http://www.apache.org/licenses/LICENSE-2.0
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
13  * express or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  * "Guardtime" and "KSI" are trademarks or registered trademarks of
16  * Guardtime, Inc., and no license to trademarks is granted; Guardtime
17  * reserves and retains all trademark rights.
18  */
19 
20 #ifndef KSI_NET_ASYNC_H_
21 #define KSI_NET_ASYNC_H_
22 
23 #include "types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
50 
58 
72 
88 
102 
117 
119 
127  int KSI_AsyncHandle_setRequestCtx(KSI_AsyncHandle *o, void *reqCtx, void (*reqCtx_free)(void*));
128 
135  int KSI_AsyncHandle_getRequestCtx(const KSI_AsyncHandle *o, const void **reqCtx);
136 
145  int KSI_AsyncHandle_getState(const KSI_AsyncHandle *h, int *state);
146 
154  int KSI_AsyncHandle_getError(const KSI_AsyncHandle *h, int *error);
155 
164 
174 
184 
194  int KSI_AsyncHandle_getParentId(const KSI_AsyncHandle *h, size_t *parentId);
195 
203 
211 
221 
230 
242 
252 
261 
269 
270 
276 
286 
296 
315 
331  int KSI_AsyncService_run(KSI_AsyncService *service, KSI_AsyncHandle **handle, size_t *waiting);
332 
337  typedef enum KSI_AsyncHandleState_en {
340 
341  /*
342  * Handle internal states.
343  */
344 
349 
350 
351  /*
352  * Request final states.
353  */
354 
379 
380  /*
381  * Handle final states.
382  */
383 
415 
423 
432 
442  typedef int (*KSI_AsyncServiceCallback_ConnectState)(KSI_CTX *ctx, size_t id, void *userp, const char *host, int connected);
443 
454  typedef int (*KSI_AsyncServiceCallback_configConsolidate)(KSI_CTX *ctx, size_t id, void *userp, KSI_Config *haConfig, KSI_Config *respConfig);
455 
461  typedef enum KSI_AsyncOption_en {
462 
474 
486 
499 
507 
516 
528 
540 
550 
559 
565 
573 
576 
577 
590  int KSI_AsyncService_setOption(KSI_AsyncService *s, const int option, void *value);
591 
601  int KSI_AsyncService_getOption(const KSI_AsyncService *s, const int option, void *value);
602 
617  int KSI_AsyncService_setEndpoint(KSI_AsyncService *service, const char *uri, const char *loginId, const char *key);
618 
633  int KSI_AsyncService_addEndpoint(KSI_AsyncService *service, const char *uri, const char *loginId, const char *key);
634 
639 #ifdef __cplusplus
640 }
641 #endif
642 
643 #endif /* KSI_NET_ASYNC_H_ */
int KSI_AsyncHandle_getRequestId(const KSI_AsyncHandle *h, KSI_uint64_t *id)
int KSI_AsyncService_setOption(KSI_AsyncService *s, const int option, void *value)
int KSI_AsyncHandle_getConfig(const KSI_AsyncHandle *h, KSI_Config **config)
int KSI_AsyncExtendingHandle_new(KSI_CTX *ctx, const KSI_Signature *sig, const KSI_PublicationRecord *pubRec, KSI_AsyncHandle **o)
int KSI_AsyncHandle_getAggregationReq(const KSI_AsyncHandle *h, KSI_AggregationReq **req)
enum KSI_AsyncHandleState_en KSI_AsyncHandleState
void KSI_AsyncClient_free(KSI_AsyncClient *c)
int KSI_AsyncHandle_getError(const KSI_AsyncHandle *h, int *error)
enum KSI_AsyncOption_en KSI_AsyncOption
int(* KSI_AsyncServiceCallback_ConnectState)(KSI_CTX *ctx, size_t id, void *userp, const char *host, int connected)
Definition: net_async.h:442
int KSI_AsyncService_getOption(const KSI_AsyncService *s, const int option, void *value)
int KSI_SigningAsyncService_new(KSI_CTX *ctx, KSI_AsyncService **service)
int KSI_AsyncHandle_getAggregationResp(const KSI_AsyncHandle *h, KSI_AggregationResp **resp)
int KSI_AsyncService_getReceivedCount(KSI_AsyncService *s, size_t *count)
int KSI_AsyncService_run(KSI_AsyncService *service, KSI_AsyncHandle **handle, size_t *waiting)
int KSI_AsyncHandle_getErrorMessage(const KSI_AsyncHandle *h, KSI_Utf8String **msg)
int KSI_AbstractAsyncClient_new(KSI_CTX *ctx, KSI_AsyncClient **c)
void KSI_AsyncService_free(KSI_AsyncService *service)
int KSI_AbstractAsyncHandle_new(KSI_CTX *ctx, KSI_AsyncHandle **o)
int KSI_AsyncHandle_getExtError(const KSI_AsyncHandle *h, long *ext)
KSI_AsyncHandleState_en
Definition: net_async.h:337
int KSI_ExtendingAsyncService_new(KSI_CTX *ctx, KSI_AsyncService **service)
int KSI_AsyncHandle_getSignature(const KSI_AsyncHandle *h, KSI_Signature **signature)
int KSI_AsyncService_addEndpoint(KSI_AsyncService *service, const char *uri, const char *loginId, const char *key)
int KSI_AsyncHandle_getRequestCtx(const KSI_AsyncHandle *o, const void **reqCtx)
int KSI_AsyncExtendHandle_new(KSI_CTX *ctx, KSI_ExtendReq *req, KSI_AsyncHandle **o)
KSI_AsyncOption_en
Definition: net_async.h:461
int KSI_AsyncHandle_getExtendResp(const KSI_AsyncHandle *h, KSI_ExtendResp **resp)
int KSI_AsyncAggregationHandle_new(KSI_CTX *ctx, KSI_AggregationReq *req, KSI_AsyncHandle **o)
int KSI_AsyncService_setEndpoint(KSI_AsyncService *service, const char *uri, const char *loginId, const char *key)
int KSI_AsyncHandle_setRequestCtx(KSI_AsyncHandle *o, void *reqCtx, void(*reqCtx_free)(void *))
int KSI_AsyncHandle_getState(const KSI_AsyncHandle *h, int *state)
int(* KSI_AsyncServiceCallback_configConsolidate)(KSI_CTX *ctx, size_t id, void *userp, KSI_Config *haConfig, KSI_Config *respConfig)
Definition: net_async.h:454
int KSI_AsyncSigningHandle_new(KSI_CTX *ctx, KSI_DataHash *rootHash, KSI_uint64_t rootLevel, KSI_AsyncHandle **o)
void KSI_AsyncHandle_free(KSI_AsyncHandle *o)
int KSI_AsyncHandle_getParentId(const KSI_AsyncHandle *h, size_t *parentId)
int KSI_AsyncService_getPendingCount(KSI_AsyncService *s, size_t *count)
int KSI_AsyncHandle_getExtendReq(const KSI_AsyncHandle *h, KSI_ExtendReq **req)
int KSI_AsyncService_addRequest(KSI_AsyncService *service, KSI_AsyncHandle *handle)
@ KSI_ASYNC_STATE_ERROR
Definition: net_async.h:378
@ KSI_ASYNC_STATE_WAITING_FOR_DISPATCH
Definition: net_async.h:346
@ KSI_ASYNC_STATE_ERROR_NOTICE
Definition: net_async.h:413
@ KSI_ASYNC_STATE_WAITING_FOR_RESPONSE
Definition: net_async.h:348
@ KSI_ASYNC_STATE_RESPONSE_RECEIVED
Definition: net_async.h:363
@ KSI_ASYNC_STATE_PUSH_CONFIG_RECEIVED
Definition: net_async.h:370
@ KSI_ASYNC_STATE_UNDEFINED
Definition: net_async.h:339
@ __KSI_ASYNC_OPT_COUNT
Definition: net_async.h:574
@ KSI_ASYNC_OPT_HMAC_ALGORITHM
Definition: net_async.h:572
@ KSI_ASYNC_OPT_RCV_TIMEOUT
Definition: net_async.h:485
@ KSI_ASYNC_OPT_MAX_REQUEST_COUNT
Definition: net_async.h:515
@ KSI_ASYNC_OPT_REQUEST_CACHE_SIZE
Definition: net_async.h:506
@ KSI_ASYNC_OPT_SND_TIMEOUT
Definition: net_async.h:498
@ KSI_ASYNC_OPT_CALLBACK_USERDATA
Definition: net_async.h:564
@ KSI_ASYNC_OPT_PUSH_CONF_CALLBACK
Definition: net_async.h:527
@ KSI_ASYNC_OPT_HA_SUBSERVICE_LIST
Definition: net_async.h:549
@ KSI_ASYNC_OPT_CONF_CONSOLIDATE_CALLBACK
Definition: net_async.h:539
@ KSI_ASYNC_OPT_CON_TIMEOUT
Definition: net_async.h:473
@ KSI_ASYNC_OPT_CONNECTION_STATE_CALLBACK
Definition: net_async.h:558
struct KSI_CTX_st KSI_CTX
Definition: types_base.h:78
#define KSI_uint64_t
Definition: types_base.h:59
struct KSI_Utf8String_st KSI_Utf8String
Definition: types_base.h:104
struct KSI_DataHash_st KSI_DataHash
Definition: hash.h:52
struct KSI_ExtendReq_st KSI_ExtendReq
Definition: types.h:54
struct KSI_AsyncClient_st KSI_AsyncClient
Definition: types.h:126
struct KSI_ExtendResp_st KSI_ExtendResp
Definition: types.h:55
struct KSI_AsyncHandle_st KSI_AsyncHandle
Definition: types.h:127
struct KSI_AggregationResp_st KSI_AggregationResp
Definition: types.h:53
struct KSI_AggregationReq_st KSI_AggregationReq
Definition: types.h:51
struct KSI_PublicationRecord_st KSI_PublicationRecord
Definition: types.h:60
struct KSI_Config_st KSI_Config
Definition: types.h:50
struct KSI_AsyncService_st KSI_AsyncService
Definition: types.h:125
struct KSI_Signature_st KSI_Signature
Definition: types.h:67
#define KSI_DEFINE_REF(typ)
Definition: types_base.h:39