Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_mgmt.c File Reference
#include "elxu_mgmt.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <ocs_ioctl.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <elxu_device.h>

Go to the source code of this file.

Macros

#define INFO_BUFFER_SIZE   1024*1024
 
#define OCS_MGMT_MAX_NAME   128
 
#define EBUSY   16
 

Functions

static void display_mgmt_list (elxu_device_t *device)
 
static void parse_node (mgmt_list_t *list, xmlNodePtr node)
 
static mgmt_list_t * parse_list (char *buf)
 
void elxu_mgmt_info (elxu_device_t *device)
 
mgmt_list_t * mgmt_new_list ()
 mgmt_new_list: Create a new empty linked list More...
 
void mgmt_delete_list (mgmt_list_t *list)
 mgmt_delete_list Delete a linked list and free its contents More...
 
void mgmt_list_add (mgmt_list_t *list, mgmt_object_t *object)
 mgmt_list_add: Add an object to the tail of a list More...
 
mgmt_object_t * mgmt_list_remove (mgmt_list_t *list, char *name)
 Remove an object from a list. More...
 
int mgmt_list_is_empty (mgmt_list_t *list)
 
void mgmt_list_sort (mgmt_list_t *list)
 
mgmt_property_t * mgmt_new_property (char *name, char *value, char *access)
 mgmt_new_property: Create a new property with the given name and value More...
 
void mgmt_delete_property (mgmt_property_t *prop)
 mgmt_delete_property: delete a property, freeing the name and value More...
 
mgmt_object_t * mgmt_new_object ()
 mgmt_new_object: Create a new mgmt object More...
 
void mgmt_delete_object (mgmt_object_t *obj)
 mgmt_delete_object: Delete a mgmt object More...
 
void mgmt_object_add_property (mgmt_object_t *obj, char *name, char *value, char *access)
 mgmt_object_add_property: Add a name/value pair to an object as a new property More...
 
char * mgmt_get_value (elxu_device_t *device, char *name)
 
int mgmt_set_value (elxu_device_t *device, char *name, char *value)
 
int mgmt_exec (elxu_device_t *device, char *name, void *arg_in, int arg_in_len, void *arg_out, int arg_out_len)
 
mgmt_list_t * mgmt_get_all (elxu_device_t *device)
 

Macro Details

#define EBUSY   16

Definition at line 57 of file elxu_mgmt.c.

#define INFO_BUFFER_SIZE   1024*1024

Definition at line 55 of file elxu_mgmt.c.

#define OCS_MGMT_MAX_NAME   128

Definition at line 56 of file elxu_mgmt.c.

Function Details

static void display_mgmt_list ( elxu_device_t *  device)
static

Definition at line 64 of file elxu_mgmt.c.

void elxu_mgmt_info ( elxu_device_t *  device)

Definition at line 59 of file elxu_mgmt.c.

void mgmt_delete_list ( mgmt_list_t *  list)

mgmt_delete_list Delete a linked list and free its contents

Definition at line 111 of file elxu_mgmt.c.

void mgmt_delete_object ( mgmt_object_t *  obj)

mgmt_delete_object: Delete a mgmt object

Since an object is just a list of properties we just delete the list

Definition at line 308 of file elxu_mgmt.c.

void mgmt_delete_property ( mgmt_property_t *  prop)

mgmt_delete_property: delete a property, freeing the name and value

Definition at line 273 of file elxu_mgmt.c.

int mgmt_exec ( elxu_device_t *  device,
char *  name,
void *  arg_in,
int  arg_in_len,
void *  arg_out,
int  arg_out_len 
)

Definition at line 466 of file elxu_mgmt.c.

mgmt_list_t* mgmt_get_all ( elxu_device_t *  device)

Definition at line 482 of file elxu_mgmt.c.

char* mgmt_get_value ( elxu_device_t *  device,
char *  name 
)

Definition at line 354 of file elxu_mgmt.c.

void mgmt_list_add ( mgmt_list_t *  list,
mgmt_object_t *  object 
)

mgmt_list_add: Add an object to the tail of a list

Definition at line 131 of file elxu_mgmt.c.

int mgmt_list_is_empty ( mgmt_list_t *  list)

Definition at line 206 of file elxu_mgmt.c.

mgmt_object_t* mgmt_list_remove ( mgmt_list_t *  list,
char *  name 
)

Remove an object from a list.

Description
Given a list and a property name, remove the first object found with that property name from the list.
Parameters
listThe list to operate on.
nameThe name of a property to remove.
Returns
Returns a pointer to the removed object if found, NULL if not found.

Definition at line 164 of file elxu_mgmt.c.

void mgmt_list_sort ( mgmt_list_t *  list)

Definition at line 211 of file elxu_mgmt.c.

mgmt_list_t* mgmt_new_list ( )

mgmt_new_list: Create a new empty linked list

Definition at line 96 of file elxu_mgmt.c.

mgmt_object_t* mgmt_new_object ( )

mgmt_new_object: Create a new mgmt object

Definition at line 290 of file elxu_mgmt.c.

mgmt_property_t* mgmt_new_property ( char *  name,
char *  value,
char *  access 
)

mgmt_new_property: Create a new property with the given name and value

Definition at line 255 of file elxu_mgmt.c.

void mgmt_object_add_property ( mgmt_object_t *  obj,
char *  name,
char *  value,
char *  access 
)

mgmt_object_add_property: Add a name/value pair to an object as a new property

Definition at line 329 of file elxu_mgmt.c.

int mgmt_set_value ( elxu_device_t *  device,
char *  name,
char *  value 
)

Definition at line 447 of file elxu_mgmt.c.

static mgmt_list_t * parse_list ( char *  buf)
static

Definition at line 507 of file elxu_mgmt.c.

static void parse_node ( mgmt_list_t *  list,
xmlNodePtr  node 
)
static

Definition at line 531 of file elxu_mgmt.c.