lsm_datatypes.hpp File Reference

#include "libstoragemgmt/libstoragemgmt_plug_interface.h"
#include "libstoragemgmt/libstoragemgmt_common.h"
#include "libxml/uri.h"
#include <glib.h>
#include "lsm_ipc.hpp"
Include dependency graph for lsm_datatypes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _lsm_volume
struct  _lsm_pool
struct  _lsm_access_group
struct  _lsm_nfs_export
struct  _lsm_block_range
struct  _lsm_storage_capabilities
struct  _lsm_system
struct  _lsm_plugin
struct  _lsm_connect
struct  _lsm_error
struct  _lsm_string_list
struct  _lsm_fs
struct  _lsm_fs_ss
struct  _lsm_disk
struct  _lsm_hash
struct  _lsm_target_port

Defines

#define MEMBER_FUNC_GET(return_type, name, param_sig,x, validation, member, error)
#define MAGIC_CHECK(obj, m)
#define LSM_DEL_MAGIC(obj)   ((obj & 0x0FFFFFFF) | 0xD0000000)
#define LSM_VOL_MAGIC   0xAA7A0000
#define LSM_IS_VOL(obj)   MAGIC_CHECK(obj, LSM_VOL_MAGIC)
#define LSM_FLAG_UNUSED_CHECK(x)   ( x != 0 )
#define LSM_FLAG_GET_VALUE(x)   x["flags"].asUint64_t()
#define LSM_FLAG_EXPECTED_TYPE(x)   (Value::numeric_t == x["flags"].valueType())
#define LSM_POOL_MAGIC   0xAA7A0001
#define LSM_IS_POOL(obj)   MAGIC_CHECK(obj, LSM_POOL_MAGIC)
#define LSM_ACCESS_GROUP_MAGIC   0xAA7A0003
#define LSM_IS_ACCESS_GROUP(obj)   MAGIC_CHECK(obj, LSM_ACCESS_GROUP_MAGIC)
#define LSM_NFS_EXPORT_MAGIC   0xAA7A0006
#define LSM_IS_NFS_EXPORT(obj)   MAGIC_CHECK(obj, LSM_NFS_EXPORT_MAGIC)
#define LSM_BLOCK_RANGE_MAGIC   0xAA7A0007
#define LSM_IS_BLOCK_RANGE(obj)   MAGIC_CHECK(obj, LSM_BLOCK_RANGE_MAGIC)
#define LSM_CAPABILITIES_MAGIC   0xAA7A0008
#define LSM_IS_CAPABILITIY(obj)   MAGIC_CHECK(obj, LSM_CAPABILITIES_MAGIC)
#define LSM_CAP_MAX   512
#define LSM_SYSTEM_MAGIC   0xAA7A0009
#define LSM_IS_SYSTEM(obj)   MAGIC_CHECK(obj, LSM_SYSTEM_MAGIC)
#define LSM_CONNECT_MAGIC   0xAA7A000A
#define LSM_IS_CONNECT(obj)   MAGIC_CHECK(obj, LSM_CONNECT_MAGIC)
#define LSM_PLUGIN_MAGIC   0xAA7A000B
#define LSM_IS_PLUGIN(obj)   MAGIC_CHECK(obj, LSM_PLUGIN_MAGIC)
#define LSM_ERROR_MAGIC   0xAA7A000C
#define LSM_IS_ERROR(obj)   MAGIC_CHECK(obj, LSM_ERROR_MAGIC)
#define LSM_STRING_LIST_MAGIC   0xAA7A000D
#define LSM_IS_STRING_LIST(obj)   MAGIC_CHECK(obj, LSM_STRING_LIST_MAGIC)
#define LSM_FS_MAGIC   0xAA7A000E
#define LSM_IS_FS(obj)   MAGIC_CHECK(obj, LSM_FS_MAGIC)
#define LSM_SS_MAGIC   0xAA7A000F
#define LSM_IS_SS(obj)   MAGIC_CHECK(obj, LSM_SS_MAGIC)
#define LSM_DISK_MAGIC   0xAA7A0010
#define LSM_IS_DISK(obj)   MAGIC_CHECK(obj, LSM_DISK_MAGIC)
#define LSM_HASH_MAGIC   0xAA7A0011
#define LSM_IS_HASH(obj)   MAGIC_CHECK(obj, LSM_HASH_MAGIC)
#define LSM_TARGET_PORT_MAGIC   0xAA7A0012
#define LSM_IS_TARGET_PORT(obj)   MAGIC_CHECK(obj, LSM_TARGET_PORT_MAGIC)

Functions

lsm_connect LSM_DLL_LOCAL * connection_get ()
void LSM_DLL_LOCAL connection_free (lsm_connect *c)
int LSM_DLL_LOCAL driver_load (lsm_connect *c, const char *plugin, const char *password, uint32_t timeout, lsm_error_ptr *e, int startup, lsm_flag flags)
char LSM_DLL_LOCAL * capability_string (lsm_storage_capabilities *c)
const char LSM_DLL_LOCAL * uds_path (void)
int LSM_DLL_LOCAL number_convert (const char *str_num, int64_t *si, uint64_t *ui, long double *d)
int LSM_DLL_LOCAL iqn_validate (const char *iqn)
int LSM_DLL_LOCAL wwpn_validate (const char *wwpn)
char LSM_DLL_LOCAL * wwpn_convert (const char *wwpn)

Define Documentation

#define LSM_ACCESS_GROUP_MAGIC   0xAA7A0003

Definition at line 86 of file lsm_datatypes.hpp.

#define LSM_BLOCK_RANGE_MAGIC   0xAA7A0007

Definition at line 125 of file lsm_datatypes.hpp.

#define LSM_CAP_MAX   512

Definition at line 141 of file lsm_datatypes.hpp.

#define LSM_CAPABILITIES_MAGIC   0xAA7A0008

Definition at line 138 of file lsm_datatypes.hpp.

#define LSM_CONNECT_MAGIC   0xAA7A000A

Definition at line 167 of file lsm_datatypes.hpp.

#define LSM_DEL_MAGIC ( obj   )     ((obj & 0x0FFFFFFF) | 0xD0000000)

Definition at line 44 of file lsm_datatypes.hpp.

#define LSM_DISK_MAGIC   0xAA7A0010

Definition at line 262 of file lsm_datatypes.hpp.

#define LSM_ERROR_MAGIC   0xAA7A000C

Definition at line 208 of file lsm_datatypes.hpp.

#define LSM_FLAG_EXPECTED_TYPE (  )     (Value::numeric_t == x["flags"].valueType())

Definition at line 49 of file lsm_datatypes.hpp.

#define LSM_FLAG_GET_VALUE (  )     x["flags"].asUint64_t()

Definition at line 48 of file lsm_datatypes.hpp.

#define LSM_FLAG_UNUSED_CHECK (  )     ( x != 0 )

Definition at line 47 of file lsm_datatypes.hpp.

#define LSM_FS_MAGIC   0xAA7A000E

Structure for File system information.

Definition at line 239 of file lsm_datatypes.hpp.

#define LSM_HASH_MAGIC   0xAA7A0011

Definition at line 275 of file lsm_datatypes.hpp.

#define LSM_IS_ACCESS_GROUP ( obj   )     MAGIC_CHECK(obj, LSM_ACCESS_GROUP_MAGIC)

Definition at line 87 of file lsm_datatypes.hpp.

#define LSM_IS_BLOCK_RANGE ( obj   )     MAGIC_CHECK(obj, LSM_BLOCK_RANGE_MAGIC)

Definition at line 126 of file lsm_datatypes.hpp.

#define LSM_IS_CAPABILITIY ( obj   )     MAGIC_CHECK(obj, LSM_CAPABILITIES_MAGIC)

Definition at line 139 of file lsm_datatypes.hpp.

#define LSM_IS_CONNECT ( obj   )     MAGIC_CHECK(obj, LSM_CONNECT_MAGIC)

Definition at line 168 of file lsm_datatypes.hpp.

#define LSM_IS_DISK ( obj   )     MAGIC_CHECK(obj, LSM_DISK_MAGIC)

Definition at line 263 of file lsm_datatypes.hpp.

#define LSM_IS_ERROR ( obj   )     MAGIC_CHECK(obj, LSM_ERROR_MAGIC)

Definition at line 209 of file lsm_datatypes.hpp.

#define LSM_IS_FS ( obj   )     MAGIC_CHECK(obj, LSM_FS_MAGIC)

Definition at line 240 of file lsm_datatypes.hpp.

#define LSM_IS_HASH ( obj   )     MAGIC_CHECK(obj, LSM_HASH_MAGIC)

Definition at line 276 of file lsm_datatypes.hpp.

#define LSM_IS_NFS_EXPORT ( obj   )     MAGIC_CHECK(obj, LSM_NFS_EXPORT_MAGIC)

Definition at line 105 of file lsm_datatypes.hpp.

#define LSM_IS_PLUGIN ( obj   )     MAGIC_CHECK(obj, LSM_PLUGIN_MAGIC)

Definition at line 172 of file lsm_datatypes.hpp.

#define LSM_IS_POOL ( obj   )     MAGIC_CHECK(obj, LSM_POOL_MAGIC)

Definition at line 66 of file lsm_datatypes.hpp.

#define LSM_IS_SS ( obj   )     MAGIC_CHECK(obj, LSM_SS_MAGIC)

Definition at line 253 of file lsm_datatypes.hpp.

#define LSM_IS_STRING_LIST ( obj   )     MAGIC_CHECK(obj, LSM_STRING_LIST_MAGIC)

Definition at line 230 of file lsm_datatypes.hpp.

#define LSM_IS_SYSTEM ( obj   )     MAGIC_CHECK(obj, LSM_SYSTEM_MAGIC)

Definition at line 153 of file lsm_datatypes.hpp.

#define LSM_IS_TARGET_PORT ( obj   )     MAGIC_CHECK(obj, LSM_TARGET_PORT_MAGIC)

Definition at line 284 of file lsm_datatypes.hpp.

#define LSM_IS_VOL ( obj   )     MAGIC_CHECK(obj, LSM_VOL_MAGIC)

Definition at line 46 of file lsm_datatypes.hpp.

#define LSM_NFS_EXPORT_MAGIC   0xAA7A0006

Definition at line 104 of file lsm_datatypes.hpp.

#define LSM_PLUGIN_MAGIC   0xAA7A000B

Definition at line 171 of file lsm_datatypes.hpp.

#define LSM_POOL_MAGIC   0xAA7A0001

Definition at line 65 of file lsm_datatypes.hpp.

#define LSM_SS_MAGIC   0xAA7A000F

Definition at line 252 of file lsm_datatypes.hpp.

#define LSM_STRING_LIST_MAGIC   0xAA7A000D

Used to house string collection.

Definition at line 229 of file lsm_datatypes.hpp.

#define LSM_SYSTEM_MAGIC   0xAA7A0009

Definition at line 152 of file lsm_datatypes.hpp.

#define LSM_TARGET_PORT_MAGIC   0xAA7A0012

Definition at line 283 of file lsm_datatypes.hpp.

#define LSM_VOL_MAGIC   0xAA7A0000

Definition at line 45 of file lsm_datatypes.hpp.

#define MAGIC_CHECK ( obj,
 ) 
Value:
((obj) && \
                                     ((obj)->magic==(m) ))

Definition at line 42 of file lsm_datatypes.hpp.

#define MEMBER_FUNC_GET ( return_type,
name,
param_sig,
x,
validation,
member,
error   ) 
Value:
return_type name( param_sig )  {\
    if( validation(x) ) {      \
        return x->member;      \
    } else {                   \
        return error;          \
    }                          \
}                              \

Definition at line 33 of file lsm_datatypes.hpp.


Function Documentation

char LSM_DLL_LOCAL* capability_string ( lsm_storage_capabilities c  ) 

Here is the caller graph for this function:

void LSM_DLL_LOCAL connection_free ( lsm_connect c  ) 

De-allocates the connection.

Parameters:
c Connection to free.

Definition at line 208 of file lsm_datatypes.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

lsm_connect LSM_DLL_LOCAL* connection_get (  ) 

Returns a pointer to a newly created connection structure.

Returns:
NULL on memory exhaustion, else new connection.

Definition at line 199 of file lsm_datatypes.cpp.

Here is the caller graph for this function:

int LSM_DLL_LOCAL driver_load ( lsm_connect c,
const char *  plugin,
const char *  password,
uint32_t  timeout,
lsm_error_ptr e,
int  startup,
lsm_flag  flags 
)

Loads the requester driver specified in the uri.

Parameters:
c Connection
plugin Short name of plugin
password Password
timeout Initial timeout
e Error data
startup If non zero call rpc start_up, else skip
flags Reserved flag for future use
Returns:
LSM_ERR_OK on success, else error code.

Definition at line 289 of file lsm_datatypes.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int LSM_DLL_LOCAL iqn_validate ( const char *  iqn  ) 

Validates an iSCSI IQN

Parameters:
iqn iSCSI iqn to check
Returns:
LSM_ERR_OK on success, else LSM_ERR_INVALID_ARGUMENT

Here is the caller graph for this function:

int LSM_DLL_LOCAL number_convert ( const char *  str_num,
int64_t *  si,
uint64_t *  ui,
long double *  d 
)

Take a character string and tries to convert to a number. Note: Number is defined as what is acceptable for JSON number. The number is represented by int64_t if possible, else uint64_t and then long double.

Parameters:
str_num Character string containing number
si Signed 64 bit number
ui Unsigned 64 bit number
d Long double
Returns:
-1 = Invalid string pointer 0 = Not a number 1 = Number converted to signed integer, value in si 2 = Number converted to unsigned integer, value in ui 3 = Number converted to long double, value in d
const char LSM_DLL_LOCAL* uds_path ( void   ) 

Definition at line 278 of file lsm_datatypes.cpp.

Here is the caller graph for this function:

char LSM_DLL_LOCAL* wwpn_convert ( const char *  wwpn  ) 

Given a WWPN validate it and then convert to internal representation.

Parameters:
wwpn World wide port name to validate
Returns:
NULL if not patch, else string with common lsm format
int LSM_DLL_LOCAL wwpn_validate ( const char *  wwpn  ) 

Validates an WWPN

Parameters:
wwpn wwpn to check
Returns:
LSM_ERR_OK on success, else LSM_ERR_INVALID_ARGUMENT

Here is the caller graph for this function:


Generated on 9 Jul 2015 for libStorageMgmt by  doxygen 1.6.1