24 #include <openssl/sha.h>
28 KineticSemaphore * sem;
34 int main(
int argc,
char** argv)
40 KineticSession* session;
46 if (client == NULL) {
return 1; }
47 const char HmacKeyString[] =
"asdfasdf";
57 fprintf(stderr,
"Failed connecting to the Kinetic device w/status: %s\n",
65 PutStatus put_status = {
71 uint8_t value_data[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
75 uint8_t key_data[] = {0x00, 0x01, 0x02, 0x03, 0x04};
99 .clientData = &put_status,
115 printf(
"PUT completed successfully!\n");
131 PutStatus * put_status = clientData;
134 put_status->status = kinetic_data->
status;
ByteBuffer * ByteBuffer_Append(ByteBuffer *buffer, const void *data, size_t len)
Structure for an embedded ByteArray as a buffer.
This request is made persistent before returning.
ByteBuffer ByteBuffer_Malloc(size_t size)
KineticStatus KineticClient_CreateSession(KineticSessionConfig *const config, KineticClient *const client, KineticSession **session)
Creates a session with the Kinetic Device per specified configuration.
static void put_finished(KineticCompletionData *kinetic_data, void *clientData)
Structure used to specify the configuration for a session.
int main(int argc, char **argv)
KineticStatus KineticClient_DestroySession(KineticSession *const session)
Closes the connection to a host.
ByteArray array
ByteArray holding allocated array w/length = allocated size.
Closure which can be specified for operations which support asynchronous mode.
char host[256]
Host name/IP address of Kinetic Device.
void KineticSemaphore_WaitForSignalAndDestroy(KineticSemaphore *sem)
Blocks until the given semaphore is signaled.
const char * Kinetic_GetStatusDescription(KineticStatus status)
Provides a string representation for a KineticStatus code.
#define KINETIC_PORT
Default kinetic port.
void KineticSemaphore_Signal(KineticSemaphore *sem)
Signals KineticSemaphore.
Completion data which will be provided to KineticCompletionClosure for asynchronous operations...
const char * logFile
Path to log file. Specify 'stdout' to log to STDOUT or NULL to disable logging.
ByteBuffer key
Key associated with the object stored on disk.
uint8_t * data
Pointer to an allocated array of data bytes.
KineticStatus status
Resultant status of the operation.
Status not available (no reponse/status available)
KineticStatus
Kinetic status codes.
KineticStatus KineticClient_Put(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a PUT operation to store/update an entry on the Kinetic Device.
ByteBuffer ByteBuffer_MallocAndAppend(const void *data, size_t len)
Configuration values for the KineticClient connection.
void KineticClient_Shutdown(KineticClient *const client)
Performs shutdown/cleanup of the kinetic-c client library.
KineticClient * KineticClient_Init(KineticClientConfig *config)
Initializes the Kinetic API and configures logging.
size_t bytesUsed
Reflects the number of bytes used from the array
KineticSemaphore * KineticSemaphore_Create(void)
Creates a KineticSemaphore.
void ByteBuffer_Free(ByteBuffer buffer)
ByteArray ByteArray_CreateWithCString(const char *str)