27 #include <sys/param.h>
32 #include <openssl/sha.h>
35 const char key[] =
"key";
38 const uint8_t value[] =
"value\x01\x02\x03\x04";
49 .value = put_value_buf,
68 .tag = delete_tag_buf,
82 int main(
int argc,
char** argv)
88 KineticSession* session;
94 if (client == NULL) {
return 1; }
95 const char HmacKeyString[] =
"asdfasdf";
105 fprintf(stderr,
"Failed connecting to the Kinetic device w/status: %s\n",
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.
Structure used to specify the configuration for a session.
KineticStatus KineticClient_DestroySession(KineticSession *const session)
Closes the connection to a host.
KineticStatus KineticClient_Delete(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a DELETE operation to delete an entry from the Kinetic Device.
int main(int argc, char **argv)
ByteArray array
ByteArray holding allocated array w/length = allocated size.
char host[256]
Host name/IP address of Kinetic Device.
const char * Kinetic_GetStatusDescription(KineticStatus status)
Provides a string representation for a KineticStatus code.
#define KINETIC_PORT
Default kinetic port.
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
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
static void do_put_and_delete(KineticSession *session)
void ByteBuffer_Free(ByteBuffer buffer)
ByteArray ByteArray_CreateWithCString(const char *str)