kinetic-c  v0.12.0
Seagate Kinetic Protocol Client Library for C
Data Structures | Macros | Typedefs | Enumerations | Functions
kinetic_types.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
#include <sys/time.h>
#include "byte_array.h"
#include <unistd.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  KineticVersionInfo
 kinetic-c library version info (returned from KineticClient_Version()) More...
 
struct  KineticSessionConfig
 Structure used to specify the configuration for a session. More...
 
struct  KineticCompletionData
 Completion data which will be provided to KineticCompletionClosure for asynchronous operations. More...
 
struct  KineticCompletionClosure
 Closure which can be specified for operations which support asynchronous mode. More...
 
struct  KineticEntry
 Kinetic object instance. More...
 
struct  KineticKeyRange
 Kinetic Key Range request structure. More...
 
struct  KineticLogInfo_Utilization
 Log info untilization entry. More...
 
struct  KineticLogInfo_Temperature
 Log info temperature entry. More...
 
struct  KineticLogInfo_Capacity
 Log info capacity entry. More...
 
struct  KineticLogInfo_Interface
 Log info network interface entry. More...
 
struct  KineticLogInfo_Configuration
 Log info device configuration. More...
 
struct  KineticLogInfo_Statistics
 Log info statistics entry. More...
 
struct  KineticLogInfo_Limits
 Log info device limits. More...
 
struct  KineticLogInfo_Device
 Log info device name (used as a key for device-specific log data) More...
 
struct  KineticLogInfo
 Base log info structure which is allocated by client and passed to KineticAdminClient_GetLog. More...
 
struct  KineticP2P_Peer
 Configuration of remote peer for a PEER2PEERPUSH operation. More...
 
struct  KineticP2P_OperationData
 Peer-to-peer operation data structure. More...
 
struct  KineticP2P_Operation
 Peer-to-peer opearation instance. More...
 
struct  KineticClientConfig
 Configuration values for the KineticClient connection. More...
 

Macros

#define KINETIC_SOCKET_INVALID   (-1)
 Invalid socket file descriptor value. More...
 
#define KINETIC_PORT   (8123)
 Default kinetic port. More...
 
#define KINETIC_TLS_PORT   (8443)
 Default kinetic TLS port. More...
 
#define KINETIC_HMAC_SHA1_LEN   (SHA_DIGEST_LENGTH)
 HMAC secure hash length. More...
 
#define KINETIC_HMAC_MAX_LEN   (KINETIC_HMAC_SHA1_LEN)
 HMAC max length. More...
 
#define KINETIC_PIN_MAX_LEN   (1024)
 Max PIN length. More...
 
#define KINETIC_DEFAULT_KEY_LEN   (1024)
 Default key length. More...
 
#define KINETIC_MAX_KEY_LEN   (4096)
 Max key length. More...
 
#define KINETIC_OBJ_SIZE   (1024 * 1024)
 Max object/value size. More...
 
#define _BSD_SOURCE
 
#define HOST_NAME_MAX   256
 
#define KINETIC_P2P_OPERATION_LIMIT   100000
 Limit for P2P operations. More...
 
#define KINETIC_P2P_MAX_NESTING   1000
 Limit for P2P operation nesting. More...
 
#define KINETIC_CLIENT_DEFAULT_LOG_LEVEL   0
 Default values for the KineticClientConfig struct, which will be used if the corresponding field in the struct is 0. More...
 
#define KINETIC_CLIENT_DEFAULT_READER_THREADS   4
 
#define KINETIC_CLIENT_DEFAULT_MAX_THREADPOOL_THREADS   8
 

Typedefs

typedef void(* KineticCompletionCallback )(KineticCompletionData *kinetic_data, void *client_data)
 Operation completion callback function prototype. More...
 

Enumerations

enum  KineticAlgorithm
 Enumeration of encryption/checksum key algorithms. More...
 
enum  KineticSynchronization
 Enumeration of synchronization types for an operation on a KineticEntry. More...
 
enum  KineticStatus
 Kinetic status codes. More...
 
enum  KineticLogInfo_Type
 Log info type. More...
 
enum  KineticMessageType
 Log info message types. More...
 

Functions

const char * Kinetic_GetStatusDescription (KineticStatus status)
 Provides a string representation for a KineticStatus code. More...
 
const char * KineticMessageType_GetName (KineticMessageType type)
 Provides a string representation for a Kinetic message type. More...
 

Macro Definition Documentation

#define KINETIC_SOCKET_INVALID   (-1)

Invalid socket file descriptor value.

Definition at line 39 of file kinetic_types.h.

#define KINETIC_PORT   (8123)

Default kinetic port.

Definition at line 40 of file kinetic_types.h.

#define KINETIC_TLS_PORT   (8443)

Default kinetic TLS port.

Definition at line 41 of file kinetic_types.h.

#define KINETIC_HMAC_SHA1_LEN   (SHA_DIGEST_LENGTH)

HMAC secure hash length.

Definition at line 42 of file kinetic_types.h.

#define KINETIC_HMAC_MAX_LEN   (KINETIC_HMAC_SHA1_LEN)

HMAC max length.

Definition at line 43 of file kinetic_types.h.

#define KINETIC_PIN_MAX_LEN   (1024)

Max PIN length.

Definition at line 44 of file kinetic_types.h.

#define KINETIC_DEFAULT_KEY_LEN   (1024)

Default key length.

Definition at line 45 of file kinetic_types.h.

#define KINETIC_MAX_KEY_LEN   (4096)

Max key length.

Definition at line 46 of file kinetic_types.h.

#define KINETIC_OBJ_SIZE   (1024 * 1024)

Max object/value size.

Definition at line 47 of file kinetic_types.h.

#define _BSD_SOURCE

Definition at line 52 of file kinetic_types.h.

#define HOST_NAME_MAX   256

Definition at line 57 of file kinetic_types.h.

#define KINETIC_P2P_OPERATION_LIMIT   100000

Limit for P2P operations.

Definition at line 479 of file kinetic_types.h.

#define KINETIC_P2P_MAX_NESTING   1000

Limit for P2P operation nesting.

Definition at line 484 of file kinetic_types.h.

#define KINETIC_CLIENT_DEFAULT_LOG_LEVEL   0

Default values for the KineticClientConfig struct, which will be used if the corresponding field in the struct is 0.

Definition at line 490 of file kinetic_types.h.

#define KINETIC_CLIENT_DEFAULT_READER_THREADS   4

Definition at line 491 of file kinetic_types.h.

#define KINETIC_CLIENT_DEFAULT_MAX_THREADPOOL_THREADS   8

Definition at line 492 of file kinetic_types.h.

Typedef Documentation

typedef void(* KineticCompletionCallback)(KineticCompletionData *kinetic_data, void *client_data)

Operation completion callback function prototype.

Parameters
kinetic_dataKineticCompletionData provided by kinetic-c.
client_dataOptional pointer to arbitrary client-supplied data.

Definition at line 219 of file kinetic_types.h.

Enumeration Type Documentation

Enumeration of encryption/checksum key algorithms.

Enumerator
KINETIC_ALGORITHM_INVALID 

Invalid algorithm value.

KINETIC_ALGORITHM_SHA1 

SHA1.

KINETIC_ALGORITHM_SHA2 

SHA2.

KINETIC_ALGORITHM_SHA3 

SHA3.

KINETIC_ALGORITHM_CRC32 

CRC32.

KINETIC_ALGORITHM_CRC64 

CRC64.

Definition at line 73 of file kinetic_types.h.

Enumeration of synchronization types for an operation on a KineticEntry.

Enumerator
KINETIC_SYNCHRONIZATION_INVALID 

Invalid synchronization value.

KINETIC_SYNCHRONIZATION_WRITETHROUGH 

This request is made persistent before returning.

This does not effect any other pending operations.

KINETIC_SYNCHRONIZATION_WRITEBACK 

They can be made persistent when the drive chooses, or when a subsequent FLUSH is sent to the drive.

KINETIC_SYNCHRONIZATION_FLUSH 

All pending information that has not been written is pushed to the disk and the command that specifies FLUSH is written last and then returned.

All WRITEBACK writes that have received ending status will be guaranteed to be written before the FLUSH operation is returned completed.

Definition at line 86 of file kinetic_types.h.

Kinetic status codes.

Enumerator
KINETIC_STATUS_INVALID 

Status not available (no reponse/status available)

KINETIC_STATUS_NOT_ATTEMPTED 

No operation has been attempted.

KINETIC_STATUS_SUCCESS 

Operation successful.

KINETIC_STATUS_SESSION_EMPTY 

Session was NULL in request.

KINETIC_STATUS_SESSION_INVALID 

Session configuration was invalid or NULL.

KINETIC_STATUS_HOST_EMPTY 

Host was empty in request.

KINETIC_STATUS_HMAC_REQUIRED 

HMAC key is empty or NULL.

KINETIC_STATUS_NO_PDUS_AVAVILABLE 

All PDUs for the session have been allocated.

KINETIC_STATUS_DEVICE_BUSY 

Device busy (retry later)

KINETIC_STATUS_CONNECTION_ERROR 

No connection/disconnected.

KINETIC_STATUS_INVALID_REQUEST 

Something about the request is invalid.

KINETIC_STATUS_OPERATION_INVALID 

Operation was invalid.

KINETIC_STATUS_OPERATION_FAILED 

Device reported an operation error.

KINETIC_STATUS_OPERATION_TIMEDOUT 

Device did not respond to the operation in time.

KINETIC_STATUS_CLUSTER_MISMATCH 

Specified cluster version does not match device.

KINETIC_STATUS_VERSION_MISMATCH 

The specified object version info for a PUT/GET do not match stored object.

KINETIC_STATUS_DATA_ERROR 

Device reported data error, no space or HMAC failure.

KINETIC_STATUS_NOT_FOUND 

The requested object does not exist.

KINETIC_STATUS_BUFFER_OVERRUN 

One or more of byte buffers did not fit all data.

KINETIC_STATUS_MEMORY_ERROR 

Failed allocating/deallocating memory.

KINETIC_STATUS_SOCKET_TIMEOUT 

A timeout occurred while waiting for a socket operation.

KINETIC_STATUS_SOCKET_ERROR 

An I/O error occurred during a socket operation.

KINETIC_STATUS_MISSING_KEY 

An operation is missing a required key.

KINETIC_STATUS_MISSING_VALUE_BUFFER 

An operation is missing a required value buffer.

KINETIC_STATUS_MISSING_PIN 

An operation is missing a PIN.

KINETIC_STATUS_SSL_REQUIRED 

The operation requires an SSL connection and the specified connection is non-SSL.

KINETIC_STATUS_DEVICE_LOCKED 

The operation failed because the device is securely locked. An UNLOCK must be issued to unlock for use.

KINETIC_STATUS_ACL_ERROR 

A security operation failed due to bad ACL(s)

KINETIC_STATUS_NOT_AUTHORIZED 

Authorization failure.

KINETIC_STATUS_INVALID_FILE 

Specified file does not exist or could not be read/writtten.

KINETIC_STATUS_REQUEST_REJECTED 

No request was attempted.

KINETIC_STATUS_DEVICE_NAME_REQUIRED 

A device name is required, but was empty.

KINETIC_STATUS_INVALID_LOG_TYPE 

The device log type specified was invalid.

KINETIC_STATUS_HMAC_FAILURE 

An HMAC validation error was detected.

KINETIC_STATUS_SESSION_TERMINATED 

The session has been terminated by the Kinetic device.

KINETIC_STATUS_COUNT 

Number of status codes in KineticStatusDescriptor.

Definition at line 155 of file kinetic_types.h.

Log info type.

Enumerator
KINETIC_DEVICE_INFO_TYPE_UTILIZATIONS 
KINETIC_DEVICE_INFO_TYPE_TEMPERATURES 
KINETIC_DEVICE_INFO_TYPE_CAPACITIES 
KINETIC_DEVICE_INFO_TYPE_CONFIGURATION 
KINETIC_DEVICE_INFO_TYPE_STATISTICS 
KINETIC_DEVICE_INFO_TYPE_MESSAGES 
KINETIC_DEVICE_INFO_TYPE_LIMITS 

Definition at line 289 of file kinetic_types.h.

Log info message types.

Enumerator
KINETIC_MESSAGE_TYPE_INVALID 
KINETIC_MESSAGE_TYPE_GET_RESPONSE 

GET_RESPONSE.

KINETIC_MESSAGE_TYPE_GET 

GET.

KINETIC_MESSAGE_TYPE_PUT_RESPONSE 

PUT_RESPONSE.

KINETIC_MESSAGE_TYPE_PUT 

PUT.

KINETIC_MESSAGE_TYPE_DELETE_RESPONSE 

DELETE_RESPONSE.

KINETIC_MESSAGE_TYPE_DELETE 

DELETE.

KINETIC_MESSAGE_TYPE_GETNEXT_RESPONSE 

GETNEXT_RESPONSE.

KINETIC_MESSAGE_TYPE_GETNEXT 

GETNEXT.

KINETIC_MESSAGE_TYPE_GETPREVIOUS_RESPONSE 

GETPREVIOUS_RESPONSE.

KINETIC_MESSAGE_TYPE_GETPREVIOUS 

GETPREVIOUS.

KINETIC_MESSAGE_TYPE_GETKEYRANGE_RESPONSE 

GETKEYRANGE_RESPONSE.

KINETIC_MESSAGE_TYPE_GETKEYRANGE 

GETKEYRANGE.

KINETIC_MESSAGE_TYPE_GETVERSION_RESPONSE 

GETVERSION_RESPONSE.

KINETIC_MESSAGE_TYPE_GETVERSION 

GETVERSION.

KINETIC_MESSAGE_TYPE_SETUP_RESPONSE 

SETUP_RESPONSE.

KINETIC_MESSAGE_TYPE_SETUP 

SETUP.

KINETIC_MESSAGE_TYPE_GETLOG_RESPONSE 

GETLOG_RESPONSE.

KINETIC_MESSAGE_TYPE_GETLOG 

GETLOG.

KINETIC_MESSAGE_TYPE_SECURITY_RESPONSE 

SECURITY_RESPONSE.

KINETIC_MESSAGE_TYPE_SECURITY 

SECURITY.

KINETIC_MESSAGE_TYPE_PEER2PEERPUSH_RESPONSE 

PEER2PEERPUSH_RESPONSE.

KINETIC_MESSAGE_TYPE_PEER2PEERPUSH 

PEER2PEERPUSH.

KINETIC_MESSAGE_TYPE_NOOP_RESPONSE 

NOOP_RESPONSE.

KINETIC_MESSAGE_TYPE_NOOP 

NOOP.

KINETIC_MESSAGE_TYPE_FLUSHALLDATA_RESPONSE 

FLUSHALLDATA_RESPONSE.

KINETIC_MESSAGE_TYPE_FLUSHALLDATA 

FLUSHALLDATA.

KINETIC_MESSAGE_TYPE_PINOP_RESPONSE 

PINOP_RESPONSE.

KINETIC_MESSAGE_TYPE_PINOP 

PINOP.

KINETIC_MESSAGE_TYPE_MEDIASCAN_RESPONSE 

MEDIASCAN_RESPONSE.

KINETIC_MESSAGE_TYPE_MEDIASCAN 

MEDIASCAN.

KINETIC_MESSAGE_TYPE_MEDIAOPTIMIZE_RESPONSE 

MEDIAOPTIMIZE_RESPONSE.

KINETIC_MESSAGE_TYPE_MEDIAOPTIMIZE 

MEDIAOPTIMIZE.

Definition at line 359 of file kinetic_types.h.

Function Documentation

const char* Kinetic_GetStatusDescription ( KineticStatus  status)

Provides a string representation for a KineticStatus code.

Parameters
statusThe status enumeration value.
Returns
Pointer to the appropriate string representation for the specified status.

Definition at line 67 of file kinetic_types.c.

References KINETIC_STATUS_COUNT, KineticStatusDescriptor, and KineticStatusInvalid.

const char* KineticMessageType_GetName ( KineticMessageType  type)