39 #if !defined(__OCS_MGMT_H__)
40 #define __OCS_MGMT_H__
44 #define OCS_MGMT_MAX_NAME 128
45 #define OCS_MGMT_MAX_VALUE 128
47 #define MGMT_MODE_RD 4
48 #define MGMT_MODE_WR 2
49 #define MGMT_MODE_EX 1
50 #define MGMT_MODE_RW (MGMT_MODE_RD | MGMT_MODE_WR)
52 #define OCS_ISCSI_MGMT_CMD_PARAMS_LEN 256
54 #define SFP_PAGE_SIZE 128
55 #define SFP_PAGE_A0 0xa0
56 #define SFP_PAGE_A2 0xa2
64 typedef struct ocs_mgmt_table_entry_s {
80 void *arg_out, uint32_t arg_out_length,
void *object);
82 typedef struct ocs_mgmt_functions_s {
101 extern
int parse_wwn(
char *wwn_in, uint64_t *wwn_out);
107 extern
int ocs_mgmt_set(ocs_t *ocs,
char *name,
char *value);
108 extern
int ocs_mgmt_exec(ocs_t *ocs,
char *action,
void *arg_in, uint32_t arg_in_length,
109 void *arg_out, uint32_t arg_out_length);
111 void *buf, uint32_t buf_len);
int(* ocs_mgmt_set_func)(ocs_t *, char *, char *)
ocs_mgmt_get_handler get_handler
ocs_mgmt_action_func action_handler
int ocs_mgmt_get(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf)
Return the value of a management item.
int parse_wwn(char *wwn_in, uint64_t *wwn_out)
parse a WWN from a string into a 64-bit value
ocs_mgmt_set_func set_handler
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.
int(* ocs_mgmt_exec_handler)(char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *object)
ocs_mgmt_get_func get_handler
int ocs_mgmt_set(ocs_t *ocs, char *name, char *value)
Set the value of a mgmt item.
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.
ocs_mgmt_exec_handler exec_handler
ocs_mgmt_get_all_handler get_all_handler
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.
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.
int const char const char void ocs_mgmt_emit_boolean(ocs_textbuf_t *textbuf, int access, const char *name, const int value)
Generate a property with a boolean value in a management XML document.
int32_t ocs_mgmt_get_sfp(ocs_t *ocs, uint16_t page, void *buf, uint32_t buf_len)
void ocs_mgmt_get_list(ocs_t *ocs, ocs_textbuf_t *textbuf)
Get a list of options supported by the driver.
void ocs_mgmt_get_all(ocs_t *ocs, ocs_textbuf_t *textbuf)
void(* ocs_mgmt_get_all_handler)(ocs_textbuf_t *textbuf, void *object)
void ocs_mgmt_end_unnumbered_section(ocs_textbuf_t *textbuf, const char *name)
Generate the end of a section in a management XML document.
int(* ocs_mgmt_set_handler)(char *parent, char *name, char *value, void *object)
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.
ocs_mgmt_get_list_handler get_list_handler
void(* ocs_mgmt_get_list_handler)(ocs_textbuf_t *textbuf, void *object)
int(* ocs_mgmt_action_func)(ocs_t *, char *, void *, uint32_t, void *, uint32_t)
void(* ocs_mgmt_get_func)(ocs_t *, char *, ocs_textbuf_t *)
__attribute__((format(printf, 3, 4))) extern void ocs_ddump_value(ocs_textbuf_t *textbuf
void ocs_mgmt_emit_string(ocs_textbuf_t *textbuf, int access, const char *name, const char *value)
Generate a property with a string value in a management XML document.
const char const char * fmt
void ocs_mgmt_emit_property_name(ocs_textbuf_t *textbuf, int access, const char *name)
Generate a property, with no value, in a management XML document.
ocs_mgmt_set_handler set_handler
int(* ocs_mgmt_get_handler)(ocs_textbuf_t *, char *parent, char *name, void *object)