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 options supported by the driver. More...
 
int ocs_mgmt_get (ocs_t *ocs, char *name, ocs_textbuf_t *textbuf)
 Return the value of a management 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.

Description
This is the top level "exec" handler for the driver. It performs the following:
  • Checks 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, calls the correct function to perform the action.
  • If the name is not known, sends the request to the back-ends to fulfill (if possible).
  • If the request has not been fulfilled by the back-end, passes the request 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 the ocs structure.
actionName of the action to be performed.
arg_inPointer to an argument being passed to the action.
arg_in_lengthLength of the argument pointed to by arg_in.
arg_outPointer to an argument being passed to the action.
arg_out_lengthLength of the argument pointed to by arg_out.
Returns
Returns 0 if the action was completed, or -1 otherwise.

Definition at line 538 of file ocs_mgmt.c.

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

Return the value of a management item.

Description
This is the top level "get" handler for the driver. It performs the following:
  • Checks 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, writes the value into textbuf.
  • If the name is not known, sends the request to the back-ends to fulfill (if possible).
  • If the request has not been fulfilled by the back-end, passes the request 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 the ocs structure.
nameName of the status item to be retrieved.
textbufPointer to an ocs_textbuf, which is used to return the results.
Returns
Returns 0 if the value was found and returned, or -1 if an error occurred.

Definition at line 351 of file ocs_mgmt.c.

void ocs_mgmt_get_list ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf 
)

Get a list of options supported by the driver.

Description
This is the top level "get list" handler for the driver. It performs the following:
  • Adds entries to the textbuf for any actions supported by this level in the driver.
  • Calls a back-end function to add any actions supported by the back-end.
  • Calls a function on each child (domain) to recursively add supported actions.
Parameters
ocsPointer to the ocs structure.
textbufPointer to an ocs_textbuf, which is used to accumulate the results.
Returns
Returns 0 on success, or a negative value on failure.

Definition at line 277 of file ocs_mgmt.c.

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

Set the value of a mgmt item.

Description
This is the top level "set" handler for the driver. It performs the following:
  • Checks 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, calls the correct function to change the configuration.
  • If the name is not known, sends the request to the back-ends to fulfill (if possible).
  • If the request has not been fulfilled by the back-end, passes the request 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 the ocs structure.
nameName of the property to be changed.
valueRequested new value of the property.
Returns
Returns 0 if the configuration value was updated, or -1 otherwise.

Definition at line 452 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.