Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Management Functions

Functions

void ocs_mgmt_start_section (ocs_textbuf_t *textbuf, const char *name, int index)
 Generate the beginning of a numbered section in a management XML document. More...
 
void ocs_mgmt_start_unnumbered_section (ocs_textbuf_t *textbuf, const char *name)
 Generate the beginning of an unnumbered section in a management XML document. More...
 
void ocs_mgmt_end_unnumbered_section (ocs_textbuf_t *textbuf, const char *name)
 Generate the end of a section in a management XML document. More...
 
void ocs_mgmt_end_section (ocs_textbuf_t *textbuf, const char *name, int index)
 Generate the indexed end of a section in a management XML document. More...
 
void ocs_mgmt_emit_property_name (ocs_textbuf_t *textbuf, int mode, const char *name)
 Generate a property, with no value, in a management XML document. More...
 
void ocs_mgmt_emit_string (ocs_textbuf_t *textbuf, int mode, const char *name, const char *value)
 Generate a property with a string value in a management XML document. More...
 
void ocs_mgmt_emit_int (ocs_textbuf_t *textbuf, int mode, const char *name, const char *fmt,...)
 Generate a property with an integer value in a management XML document. More...
 
void ocs_mgmt_emit_boolean (ocs_textbuf_t *textbuf, int mode, const char *name, int value)
 Generate a property with a boolean value in a management XML document. More...
 
void ocs_mgmt_get_list (ocs_t *ocs, ocs_textbuf_t *textbuf)
 get a list of mgmt items supported by the driver More...
 
int ocs_mgmt_get (ocs_t *ocs, char *name, ocs_textbuf_t *textbuf)
 return the value of a mgmt item More...
 
int ocs_mgmt_set (ocs_t *ocs, char *name, char *value)
 set the value of a mgmt item More...
 
int ocs_mgmt_exec (ocs_t *ocs, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length)
 perform a management action More...
 

Function Details

void ocs_mgmt_emit_boolean ( ocs_textbuf_t *  textbuf,
int  mode,
const char *  name,
int  value 
)

Generate a property with a boolean value in a management XML document.

Description
This function generates a property name and a boolean value. The XML information is appended to the textbuf.
Parameters
textbufPointer to the driver dump text buffer.
modeDefines whether the property is read(r)/write(w)/executable(x).
nameName of the property.
valueBoolean value to be added to the textbuf.
Returns
None.

Definition at line 213 of file ocs_mgmt_common.c.

void ocs_mgmt_emit_int ( ocs_textbuf_t *  textbuf,
int  mode,
const char *  name,
const char *  fmt,
  ... 
)

Generate a property with an integer value in a management XML document.

Description
This function generates a property name and an integer value. The XML information is appended to the textbuf.
Parameters
textbufPointer to driver dump text buffer.
modeDefines whether the property is read(r)/write(w)/executable(x).
nameName of the property.
fmtA printf format for formatting the integer value.
Returns
none

Definition at line 185 of file ocs_mgmt_common.c.

void ocs_mgmt_emit_property_name ( ocs_textbuf_t *  textbuf,
int  mode,
const char *  name 
)

Generate a property, with no value, in a management XML document.

Description
This function generates a property name. The XML information is appended to the textbuf. This form of the function is used by the list functions when the property name only (and not the current value) is given.
Parameters
textbufPointer to the driver dump text buffer.
modeDefines whether the property is read(r)/write(w)/executable(x).
nameName of the property.
Returns
None.

Definition at line 143 of file ocs_mgmt_common.c.

void ocs_mgmt_emit_string ( ocs_textbuf_t *  textbuf,
int  mode,
const char *  name,
const char *  value 
)

Generate a property with a string value in a management XML document.

Description
This function generates a property name and a string value. The XML information is appended to the textbuf.
Parameters
textbufPointer to the driver dump text buffer.
modeDefines whether the property is read(r)/write(w)/executable(x).
nameName of the property.
valueValue of the property.
Returns
None.

Definition at line 164 of file ocs_mgmt_common.c.

void ocs_mgmt_end_section ( ocs_textbuf_t *  textbuf,
const char *  name,
int  index 
)

Generate the indexed end of a section in a management XML document.

Description
This function ends a section. The XML information is appended to the textbuf.
Parameters
textbufPointer to the driver dump text buffer.
nameName of the section.
indexIndex number of this instance of the section.
Returns
None.

Definition at line 120 of file ocs_mgmt_common.c.

void ocs_mgmt_end_unnumbered_section ( ocs_textbuf_t *  textbuf,
const char *  name 
)

Generate the end of a section in a management XML document.

Description
This function ends a section. The XML information is appended to the textbuf.
Parameters
textbufPointer to the driver dump text buffer.
nameName of the section.
Returns
None.

Definition at line 100 of file ocs_mgmt_common.c.

int ocs_mgmt_exec ( ocs_t *  ocs,
char *  action,
void *  arg_in,
uint32_t  arg_in_length,
void *  arg_out,
uint32_t  arg_out_length 
)

perform a management action

This is the top level "do action" handler for the driver. It will:

  • Check that the qualifier portion of the name begins with my qualifier (ocs)
  • If the remaining part of the name matches an action that is known at this level then the correct function will be called to perform the action
  • If the name is not known the request will be given to the back ends to fulfill if possible
  • If the request hasn't been fulfilled by the back end it will be passed to each of the children (domains) to have them (recursively) try to respond

In passing the request to other entities the request is considered to be handled if the function returns 0.

Parameters
ocspointer to ocs structure
actionthe name of the action to be performed
arg_ina pointer to an argument being passed to the action
arg_in_lengththe length of the argument pointed to by *arg_in
arg_outa pointer to an argument being passed to the action
arg_out_lengththe length of the argument pointed to by *arg_out
Returns
0 if the action was completed, -1 if it was not for any reason

Definition at line 530 of file ocs_mgmt.c.

int ocs_mgmt_get ( ocs_t *  ocs,
char *  name,
ocs_textbuf_t *  textbuf 
)

return the value of a mgmt item

This is the top level "get" handler for the driver. It will:

  • Check that the qualifier portion of the name begins with my qualifier (ocs)
  • If the remaining part of the name matches a parameter that is known at this level then the value will be written into textbuf
  • If the name is not known the request will be given to the back ends to fulfill if possible
  • If the request hasn't been fulfilled by the back end it will be passed to each of the children (domains) to have them (recursively) try to respond

In passing the request to other entities the request is considered to be answered when a response has been written into textbuf, indicated by textbuf->buffer_written being non-zero.

Parameters
ocspointer to ocs structure
namethe name of the status item to be retrieved
textbufpointer to an ocs_textbuf which is used to return the results
Returns
none

Definition at line 337 of file ocs_mgmt.c.

void ocs_mgmt_get_list ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf 
)

get a list of mgmt items supported by the driver

This is the top level "get list" handler for the driver. It will:

  • Add entries to the textbuf for any actions supported by this level in the driver
  • Call a back end function to add any actions supported by the back end
  • Call a function on each child (domain) to recursively add supported actions
Parameters
ocspointer to ocs structure
textbufpointer to an ocs_textbuf which is used to accumulate the results
Returns
Nothing.

Definition at line 274 of file ocs_mgmt.c.

int ocs_mgmt_set ( ocs_t *  ocs,
char *  name,
char *  value 
)

set the value of a mgmt item

This is the top level "set" handler for the driver. It will:

  • Check that the qualifier portion of the name begins with my qualifier (ocs)
  • If the remaining part of the name matches a parameter that is known at this level then the correct function will be called to change the configuration
  • If the name is not known the request will be given to the back ends to fulfill if possible
  • If the request hasn't been fulfilled by the back end it will be passed to each of the children (domains) to have them (recursively) try to respond

In passing the request to other entities the request is considered to be handled if the function returns 0.

Parameters
ocspointer to ocs structure
namethe name of the property to be changed
valuethe requested new value of the property
Returns
0 if the configuration value was updated, -1 if it was not for any reason

Definition at line 456 of file ocs_mgmt.c.

void ocs_mgmt_start_section ( ocs_textbuf_t *  textbuf,
const char *  name,
int  index 
)

Generate the beginning of a numbered section in a management XML document.

Description
This function begins a section. The XML information is appended to the textbuf. This form of the function is used for sections that might have multiple instances, such as a node or a SLI Port (sport). The index number is appended to the name.
Parameters
textbufPointer to the driver dump text buffer.
nameName of the section.
indexIndex number of this instance of the section.
Returns
None.

Definition at line 61 of file ocs_mgmt_common.c.

void ocs_mgmt_start_unnumbered_section ( ocs_textbuf_t *  textbuf,
const char *  name 
)

Generate the beginning of an unnumbered section in a management XML document.

Description
This function begins a section. The XML information is appended to the textbuf. This form of the function is used for sections that have a single instance only. Therefore, no index number is needed.
Parameters
textbufPointer to the driver dump text buffer.
nameName of the section.
Returns
None.

Definition at line 81 of file ocs_mgmt_common.c.