Guardtime KSI c SDK
|
Data Structures | |
struct | KSI_RequestHandleStatus_st |
Typedefs | |
typedef struct KSI_RequestHandleStatus_st | KSI_RequestHandleStatus |
This module contains two networking concepts used in this API:
typedef struct KSI_RequestHandleStatus_st KSI_RequestHandleStatus |
int KSI_AbstractAsyncService_new | ( | KSI_CTX * | ctx, |
KSI_AsyncService ** | service | ||
) |
Construct an abstract async service object.
[in] | ctx | KSI context. |
[out] | service | Pointer to the receiving pointer. |
int KSI_AbstractNetEndpoint_new | ( | KSI_CTX * | ctx, |
KSI_NetEndpoint ** | endp | ||
) |
Constructor for abstract network endpoint object. The implementations must be configured (
[in] | ctx | KSI context. |
[out] | endp | Pointer to the receiving network endpoint pointer. |
int KSI_AbstractNetworkClient_new | ( | KSI_CTX * | ctx, |
KSI_NetworkClient ** | client | ||
) |
Constructor for the abstract network client.
[in] | ctx | KSI context. |
[out] | client | Abstract network client. |
int KSI_convertAggregatorStatusCode | ( | const KSI_Integer * | statusCode | ) |
This function converts the aggregator response status code into a KSI status code.
int KSI_convertExtenderStatusCode | ( | const KSI_Integer * | statusCode | ) |
This function converts the extender response status code into a KSI status code.
void KSI_NetEndpoint_free | ( | KSI_NetEndpoint * | endp | ) |
Free network endpoint object.
[in] | endp | Network endpoint. |
int KSI_NetEndpoint_getPass | ( | const KSI_NetEndpoint * | endp, |
const char ** | ksi_pass | ||
) |
int KSI_NetEndpoint_getUser | ( | const KSI_NetEndpoint * | endp, |
const char ** | ksi_user | ||
) |
int KSI_NetEndpoint_setImplContext | ( | KSI_NetEndpoint * | endp, |
void * | implCtx, | ||
void(*)(void *) | implCtx_free | ||
) |
Setter for the implementation specific endpoint context.
[in] | endp | Endpoint. |
[in] | implCtx | Implementation specific context. |
[in] | implCtx_free | Pointer to the implementation specific network endpoint cleanup method. |
int KSI_NetEndpoint_setPass | ( | KSI_NetEndpoint * | endp, |
const char * | ksi_pass | ||
) |
int KSI_NetEndpoint_setUser | ( | KSI_NetEndpoint * | endp, |
const char * | ksi_user | ||
) |
void KSI_NetworkClient_free | ( | KSI_NetworkClient * | provider | ) |
Free network provider object.
[in] | provider | Network provider. |
int KSI_NetworkClient_getAggregatorEndpoint | ( | const KSI_NetworkClient * | net, |
KSI_NetEndpoint ** | endp | ||
) |
int KSI_NetworkClient_getAggregatorPass | ( | const KSI_NetworkClient * | net, |
const char ** | val | ||
) |
int KSI_NetworkClient_getAggregatorUser | ( | const KSI_NetworkClient * | net, |
const char ** | val | ||
) |
int KSI_NetworkClient_getExtenderEndpoint | ( | const KSI_NetworkClient * | net, |
KSI_NetEndpoint ** | endp | ||
) |
int KSI_NetworkClient_getExtenderPass | ( | const KSI_NetworkClient * | net, |
const char ** | val | ||
) |
int KSI_NetworkClient_getExtenderUser | ( | const KSI_NetworkClient * | net, |
const char ** | val | ||
) |
int KSI_NetworkClient_getPublicationsFileEndpoint | ( | const KSI_NetworkClient * | net, |
KSI_NetEndpoint ** | endp | ||
) |
int KSI_NetworkClient_sendExtendRequest | ( | KSI_NetworkClient * | provider, |
KSI_ExtendReq * | request, | ||
KSI_RequestHandle ** | handle | ||
) |
Sends a non-blocking extending request or initialize the handle.
[in] | provider | Network provider. |
[in] | request | Extend request. |
[in] | handle | Network handle. |
int KSI_NetworkClient_sendPublicationsFileRequest | ( | KSI_NetworkClient * | provider, |
KSI_RequestHandle ** | handle | ||
) |
Sends a non-blocking publicationsfile request or initialize the handle.
[in] | provider | Network provider. |
[in] | handle | Network handle. |
int KSI_NetworkClient_sendSignRequest | ( | KSI_NetworkClient * | provider, |
KSI_AggregationReq * | request, | ||
KSI_RequestHandle ** | handle | ||
) |
Sends a non-blocking signing request or initialize the handle.
[in] | provider | Network provider. |
[in] | request | Request object. |
[out] | handle | Network handle. |
int KSI_NetworkClient_setAggregatorEndpoint | ( | KSI_NetworkClient * | net, |
KSI_NetEndpoint * | endp | ||
) |
int KSI_NetworkClient_setAggregatorPass | ( | KSI_NetworkClient * | net, |
const char * | val | ||
) |
int KSI_NetworkClient_setAggregatorUser | ( | KSI_NetworkClient * | net, |
const char * | val | ||
) |
int KSI_NetworkClient_setExtenderEndpoint | ( | KSI_NetworkClient * | net, |
KSI_NetEndpoint * | endp | ||
) |
int KSI_NetworkClient_setExtenderPass | ( | KSI_NetworkClient * | net, |
const char * | val | ||
) |
int KSI_NetworkClient_setExtenderUser | ( | KSI_NetworkClient * | net, |
const char * | val | ||
) |
int KSI_NetworkClient_setNetCtx | ( | KSI_NetworkClient * | client, |
void * | netCtx, | ||
void(*)(void *) | netCtx_free | ||
) |
Setter for the implementation specific networking context.
[in] | client | Network client. |
[in] | netCtx | Implementation specific context. |
[in] | netCtx_free | Pointer to the implementation specific network context cleanup method. |
int KSI_NetworkClient_setPublicationsFileEndpoint | ( | KSI_NetworkClient * | net, |
KSI_NetEndpoint * | endp | ||
) |
int KSI_NetworkClient_setSendExtendRequestFn | ( | KSI_NetworkClient * | client, |
int(*)(KSI_NetworkClient *, KSI_ExtendReq *, KSI_RequestHandle **) | fn | ||
) |
Setter for sign request function.
[in] | client | Network client. |
[in] | fn | Pointer to extend request function. |
int KSI_NetworkClient_setSendPublicationRequestFn | ( | KSI_NetworkClient * | client, |
int(*)(KSI_NetworkClient *, KSI_RequestHandle **) | fn | ||
) |
Setter for sign request function.
[in] | client | Network client. |
[in] | fn | Pointer to publicationsfile request function. |
int KSI_NetworkClient_setSendSignRequestFn | ( | KSI_NetworkClient * | client, |
int(*)(KSI_NetworkClient *, KSI_AggregationReq *, KSI_RequestHandle **) | fn | ||
) |
Setter for sign request function.
[in] | client | Network client. |
[in] | fn | Pointer to sign request function. |
void KSI_RequestHandle_free | ( | KSI_RequestHandle * | handle | ) |
Free network handle object.
[in] | handle | Network handle. |
int KSI_RequestHandle_getAggregationResponse | ( | const KSI_RequestHandle * | handle, |
KSI_AggregationResp ** | resp | ||
) |
TODO!
KSI_CTX* KSI_RequestHandle_getCtx | ( | const KSI_RequestHandle * | handle | ) |
TODO!
int KSI_RequestHandle_getExtendResponse | ( | const KSI_RequestHandle * | handle, |
KSI_ExtendResp ** | resp | ||
) |
TODO!
int KSI_RequestHandle_getNetContext | ( | const KSI_RequestHandle * | handle, |
void ** | c | ||
) |
Getter method for the network request implementation context.
[in] | handle | Network handle. |
[out] | c | Pointer to the receiving pointer. |
int KSI_RequestHandle_getRequest | ( | const KSI_RequestHandle * | handle, |
const unsigned char ** | request, | ||
size_t * | request_len | ||
) |
Getter for the request. The request can be set only while creating the network handle object (
[in] | handle | Network handle. |
[out] | request | Pointer to the receiving pointer. |
[out] | request_len | Pointer to the receiving length value. |
int KSI_RequestHandle_getResponse | ( | const KSI_RequestHandle * | handle, |
const unsigned char ** | response, | ||
size_t * | response_len | ||
) |
A blocking function to read the response to the request. The function is blocking only for the first call on one handle. If the first call succeeds following calls output the same value.
[in] | handle | Network handle. |
[out] | response | Pointer to the receiving response pointer. |
[out] | response_len | Pointer to the receiving response length value. |
int KSI_RequestHandle_getResponseStatus | ( | const KSI_RequestHandle * | handle, |
const KSI_RequestHandleStatus ** | err | ||
) |
Returns the status of the handle.
[in] | handle | Network handle. |
[out] | err | Pointer to the status structure. |
int KSI_RequestHandle_new | ( | KSI_CTX * | ctx, |
const unsigned char * | request, | ||
size_t | request_length, | ||
KSI_RequestHandle ** | handle | ||
) |
Constructor for network handle object.
[in] | ctx | KSI context. |
[in] | request | Pointer to request. |
[in] | request_length | Length of the request. |
[out] | handle | Pointer to the receiving network handle pointer. |
request
value may be freed after a successful call to this function as its contents is copied internally. int KSI_RequestHandle_perform | ( | KSI_RequestHandle * | handle | ) |
Performs the request. This can be called on a handle several times - this is useful if the previous call was unsuccessful or the caller wishes to send the request again.
[in] | handle | Network handle. |
KSI_RequestHandle* KSI_RequestHandle_ref | ( | KSI_RequestHandle * | o | ) |
[in] | o | Pointer to KSI_RequestHandle * |
NULL
on error. * int KSI_RequestHandle_setImplContext | ( | KSI_RequestHandle * | handle, |
void * | netCtx, | ||
void(*)(void *) | netCtx_free | ||
) |
Setter for network request implementation context.
[in] | handle | Network handle. |
[in] | netCtx | Network implementation context. |
[in] | netCtx_free | Cleanup method for the network context. |
int KSI_RequestHandle_setReadResponseFn | ( | KSI_RequestHandle * | handle, |
int(*)(KSI_RequestHandle *) | fn | ||
) |
As network handles may be created by using several KSI contexts with different network providers and/or the network provider of a KSI context may be changed during runtime, it is necessary to state the function to be called to receive the response.
[in] | handle | Network handle. |
[in] | fn | Pointer to response reader function. |
int KSI_RequestHandle_setResponse | ( | KSI_RequestHandle * | handle, |
const unsigned char * | response, | ||
size_t | response_len | ||
) |
Response value setter. Should be called only by the actual network provider implementation.
[in] | handle | Network handle. |
[in] | response | Pointer to the response. |
[in] | response_len | Response length. |
response
memory may be freed after a successful call to this method, as the contents is copied internally. int KSI_UriSplitBasic | ( | const char * | uri, |
char ** | scheme, | ||
char ** | host, | ||
unsigned * | port, | ||
char ** | path | ||
) |
Function to split the given uri into three parts: schema, host and port. If the part is missing from the uri, the output parameter will receive NULL
or 0 for port
as the value. If the output pointers are set to NULL
, the value is not returned.
[in] | uri | Pointer to the URI. |
[out] | scheme | Pointer to the receiving pointer of the scheme (may be NULL ). |
[out] | host | Pointer to the receiving pointer of the host (may be NULL ). |
[out] | port | Pointer to the receiving variable (may be NULL ). |
[out] | path | Pointer to the receiving pointer of the path (may be NULL ). |