Functions | |
| int32_t | ocs_isns_initialize (ocs_iscsi_t *iscsi) |
| Initialize the iSNS module. More... | |
| int32_t | ocs_isns_teardown (ocs_iscsi_t *iscsi) |
| Shutdown the iSNS module. More... | |
| static int | ocs_binary_attr (int tag) |
| Determines whether a given isns attribute is a numeric (binary) one. More... | |
| static void | ocs_print_nl (ocs_iscsi_t *iscsi, uint32_t ctr) |
| Prints a number of empty lines. More... | |
| static char * | ocs_get_tag_name (uint32_t tag) |
| Gets the name of the given isns tag. More... | |
| static char * | ocs_get_error_name (uint32_t error_number) |
| Gets the name of the given isns error. More... | |
| static int8_t | ocs_create_node (ocs_iscsi_t *iscsi, void *ptr, uint16_t num) |
| Creates an empty isns node. More... | |
| char * | ocs_get_iscsi_name (ocs_iscsi_t *iscsi, void *p, uint16_t index) |
| Gets the iscsi name of a given node. More... | |
| uint16_t | ocs_get_iscsi_ipp_count (ocs_iscsi_t *iscsi, void *p, uint16_t index) |
| Gets the count of the ip_port structs in a given node. More... | |
| void | ocs_str_to_ip_struct (ocs_iscsi_t *iscsi, char *ip, ocs_ip_address_t *ip_struct) |
| Converts a string ip into an ip struct. More... | |
| char * | ocs_get_ip (ocs_iscsi_t *iscsi, void *p, uint16_t index, uint16_t ip_index) |
| Gets the ip address of a given isns node. More... | |
| uint16_t | ocs_get_port (ocs_iscsi_t *iscsi, void *p, uint16_t index, uint16_t ip_index) |
| Gets the port of a given isns node. More... | |
| static int8_t | ocs_create_nodes (ocs_iscsi_t *iscsi, void *rsp_ptr, int16_t bytes_left, void *ret) |
| Creates an isns node. More... | |
| static void | ocs_fill_nodes_values (ocs_iscsi_t *iscsi, void *rsp_ptr, int16_t bytes_left, void *ret) |
| Fills the attributes of the isns node. More... | |
| static int | ocs_build_hdr_dev_attr_reg (void *curr, uint16_t len) |
| Builds the header of the DevAttrReg message. More... | |
| static int | ocs_build_hdr_dev_dereg (void *curr, uint16_t len) |
| Builds the header of the DevAttrDereg message. More... | |
| static int | ocs_build_hdr_dev_attr_qry (void *curr, uint16_t len) |
| Builds the header of the DevAttrQry message. More... | |
| static int | ocs_add_delimiter (void *curr, int remaining) |
| Create a delimiter attribute. More... | |
| static int | ocs_add_tlv (ocs_iscsi_t *iscsi, void *curr, uint32_t tag, uint32_t len, void *value, int remaining) |
| Create a tag-length-value attribute. More... | |
| static void | ocs_get_ipv6_string (ocs_iscsi_t *iscsi, ocs_ip_address_t *addr, uint8_t *ret_addr) |
| Forms an v6-format ip string. More... | |
| static void | ocs_parse_flags (ocs_iscsi_t *iscsi, uint16_t flags) |
| Parses the flags of the response of an isns message. More... | |
| static void | ocs_parse_rsp_hdr (ocs_iscsi_t *iscsi, void *rsp) |
| Parses the header of the response of an isns message. More... | |
| static void * | ocs_parse_qry_rsp (ocs_iscsi_t *iscsi, void *rsp_ptr, uint16_t rsp_len, uint16_t *ret_nodes_count) |
| Parses the response of the DevAttrQry message. More... | |
| void * | ocs_isns_qry_tgts (ocs_iscsi_t *iscsi, ocs_ip_address_t *isns_ip, uint16_t *ret_nodes_count) |
| Sends the DevAttrReg message to the iSNS server. More... | |
| static int8_t | ocs_parse_msg_rsp (ocs_iscsi_t *iscsi, const char *original_func_name, void *rsp_ptr, uint16_t rsp_len, uint32_t *reg_period, char *eid) |
| Parses the response of an isns message. More... | |
| static void * | ocs_isns_qry_attr (ocs_iscsi_t *iscsi, ocs_ip_address_t *isns_ip) |
| Sends the DevAttrReg message to the iSNS server. More... | |
| int8_t | ocs_isns_register (ocs_iscsi_t *iscsi, uint8_t reg_tgts, uint8_t reg_ini, ocs_ip_address_t *isns_ip, char *eid) |
| Sends the DevAttrReg message to the iSNS server. More... | |
| int8_t | ocs_isns_deregister (ocs_t *ocs, ocs_ip_address_t *isns_ip, char *eid) |
| Sends the DevDereg message to the iSNS server. More... | |
|
static |
Create a delimiter attribute.
This function will form a delimiter attribute (0-length and 0-tag attribute) for the isns messages
| curr | Pointer to the start of the attribute |
| remaining | the number of bytes left in the memory allocated for this msg |
Definition at line 552 of file ocs_isns.c.
|
static |
Create a tag-length-value attribute.
This function will form a tag-length-value-attribute for the isns messages
| iscsi | Pointer to the iSCSI structure that represents this device |
| curr | Pointer to the start of the attribute |
| tag | the tag of the attribute |
| len | the length of the attribute |
| value | Pointer to the value part of the attribute |
| remaining | the number of bytes left in the memory allocated for this msg |
Definition at line 576 of file ocs_isns.c.
|
static |
Determines whether a given isns attribute is a numeric (binary) one.
| tag | The tag of the isns attribute in query |
Definition at line 88 of file ocs_isns.c.
|
static |
Builds the header of the DevAttrQry message.
| curr | Pointer to the start of the attribute |
| len | the length of the PDU of that message |
Definition at line 528 of file ocs_isns.c.
|
static |
Builds the header of the DevAttrReg message.
| curr | Pointer to the start of the attribute |
| len | the length of the PDU of that message |
Definition at line 483 of file ocs_isns.c.
|
static |
Builds the header of the DevAttrDereg message.
| curr | Pointer to the start of the attribute |
| len | the length of the PDU of that message |
Definition at line 506 of file ocs_isns.c.
|
static |
Creates an empty isns node.
This function will create an empty isns node and allocates memory for the given number of ip_port structs
| iscsi | Pointer to the iSCSI structure that represents this device |
| ptr | Pointer that determines where to create this node |
| num | The number of ip-port structs in that node |
Definition at line 196 of file ocs_isns.c.
|
static |
Creates an isns node.
This function will create an isns node by parsing the response message
| iscsi | Pointer to the iSCSI structure that represents this device |
| rsp_ptr | Pointer to the start of the nodes in the operating attributes |
| bytes_left | Number of bytes left in the response message |
| ret | Pointer to the node to be created |
Definition at line 351 of file ocs_isns.c.
|
static |
Fills the attributes of the isns node.
This function will fills the ip and port attributes of the given node by parsing the response message
| iscsi | Pointer to the iSCSI structure that represents this device |
| rsp_ptr | Pointer to the start of the nodes in the operating attributes |
| bytes_left | Number of bytes left in the response message |
| ret | Pointer to the node to be filled |
Definition at line 420 of file ocs_isns.c.
|
static |
Gets the name of the given isns error.
| error_number | The number of the error |
Definition at line 153 of file ocs_isns.c.
| char* ocs_get_ip | ( | ocs_iscsi_t * | iscsi, |
| void * | p, | ||
| uint16_t | index, | ||
| uint16_t | ip_index | ||
| ) |
Gets the ip address of a given isns node.
| iscsi | Pointer to the iSCSI structure that represents this device |
| p | Pointer to the start of the nodes table |
| index | determines the index of the node in query |
| ip_index | determines which ip-port structure to be selected |
Definition at line 301 of file ocs_isns.c.
|
static |
Forms an v6-format ip string.
This function will convert an ip address into an ipv6-formatted string
| iscsi | Pointer to the iSCSI structure that represents this device |
| addr | Pointer to the input ip address |
| ret_addr | Pointer to the return string |
Definition at line 646 of file ocs_isns.c.
| uint16_t ocs_get_iscsi_ipp_count | ( | ocs_iscsi_t * | iscsi, |
| void * | p, | ||
| uint16_t | index | ||
| ) |
Gets the count of the ip_port structs in a given node.
| iscsi | Pointer to the iSCSI structure that represents this device |
| p | Pointer to the start of the nodes table |
| index | determines the index of the node in query |
Definition at line 240 of file ocs_isns.c.
| char* ocs_get_iscsi_name | ( | ocs_iscsi_t * | iscsi, |
| void * | p, | ||
| uint16_t | index | ||
| ) |
Gets the iscsi name of a given node.
| iscsi | Pointer to the iSCSI structure that represents this device |
| p | Pointer to the start of the nodes table |
| index | determines the index of the node in query |
Definition at line 223 of file ocs_isns.c.
| uint16_t ocs_get_port | ( | ocs_iscsi_t * | iscsi, |
| void * | p, | ||
| uint16_t | index, | ||
| uint16_t | ip_index | ||
| ) |
Gets the port of a given isns node.
| iscsi | Pointer to the iSCSI structure that represents this device |
| p | Pointer to the start of the nodes table |
| index | determines the index of the node in query |
| ip_index | determines which ip-port structure to be selected |
Definition at line 325 of file ocs_isns.c.
|
static |
Gets the name of the given isns tag.
| tag | The number of the tag |
Definition at line 126 of file ocs_isns.c.
| int8_t ocs_isns_deregister | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | isns_ip, | ||
| char * | eid | ||
| ) |
Sends the DevDereg message to the iSNS server.
This function will de-register all targets in this iSCSI device with within the same entity in the isns server.
| ocs | Pointer to the ocs structure that represents this device |
| isns_ip | to the IP addresses of the iSNS server |
| eid | The entity ID assigned by the iSNS server during registration |
Definition at line 1806 of file ocs_isns.c.
| int32_t ocs_isns_initialize | ( | ocs_iscsi_t * | iscsi | ) |
Initialize the iSNS module.
This function will initialize any iSNS required structures
| iscsi | pointer to the iSCSI structure that represents this device |
Definition at line 58 of file ocs_isns.c.
|
static |
Sends the DevAttrReg message to the iSNS server.
This function will query the iSCSI device with the isns server to get all the registered targets
| iscsi | Pointer to the iSCSI structure that represents this device |
| isns_ip | Pointer to the IP address of the iSNS server |
Definition at line 1236 of file ocs_isns.c.
| void* ocs_isns_qry_tgts | ( | ocs_iscsi_t * | iscsi, |
| ocs_ip_address_t * | isns_ip, | ||
| uint16_t * | ret_nodes_count | ||
| ) |
Sends the DevAttrReg message to the iSNS server.
This function will query the iSCSI device with the isns server to get all the registered targets
| iscsi | Pointer to the iSCSI structure that represents this device |
| isns_ip | Pointer to the IP address of the iSNS server |
| ret_nodes_count | Pointer to the number of nodes registered |
Definition at line 925 of file ocs_isns.c.
| int8_t ocs_isns_register | ( | ocs_iscsi_t * | iscsi, |
| uint8_t | reg_tgts, | ||
| uint8_t | reg_ini, | ||
| ocs_ip_address_t * | isns_ip, | ||
| char * | eid | ||
| ) |
Sends the DevAttrReg message to the iSNS server.
This function will register all targets in this iSCSI device with the isns server.
| iscsi | Pointer to the iSCSI structure that represents this device |
| reg_tgts | to determine whether to register targets or not |
| reg_ini | to determine whether to register initiators or not |
| isns_ip | Pointer to the IP address of the iSNS server |
| eid | The entity ID assigned by the iSNS server during registration |
Definition at line 1420 of file ocs_isns.c.
| int32_t ocs_isns_teardown | ( | ocs_iscsi_t * | iscsi | ) |
Shutdown the iSNS module.
This function will free any iSNS resources prior to driver shutdown
| iscsi | pointer to the iSCSI structure that represents this device |
Definition at line 74 of file ocs_isns.c.
|
static |
Parses the flags of the response of an isns message.
| iscsi | Pointer to the iSCSI structure that represents this device |
| flags | The flags of that message |
Definition at line 672 of file ocs_isns.c.
|
static |
Parses the response of an isns message.
This function will create an empty isns node and allocates memory for the given number of ip_port structs
| iscsi | Pointer to the iSCSI structure that represents this device |
| original_func_name | Pointer to the name of the source message |
| rsp_ptr | Pointer to the response |
| rsp_len | The length of that response |
| reg_period | Pointer to the registration period variable |
| eid | The entity ID assigned by the iSNS server during registration |
Definition at line 1102 of file ocs_isns.c.
|
static |
Parses the response of the DevAttrQry message.
| iscsi | Pointer to the iSCSI structure that represents this device |
| rsp_ptr | Pointer to the start of the response |
| rsp_len | the length of the response |
| ret_nodes_count | Pointer to the number of discovered targets |
Definition at line 763 of file ocs_isns.c.
|
static |
Parses the header of the response of an isns message.
| iscsi | Pointer to the iSCSI structure that represents this device |
| rsp | Pointer to the header of the response message |
Definition at line 717 of file ocs_isns.c.
|
static |
Prints a number of empty lines.
| iscsi | Pointer to the iSCSI structure that represents this device |
| ctr | the number of empty lines to be printed |
Definition at line 110 of file ocs_isns.c.
| void ocs_str_to_ip_struct | ( | ocs_iscsi_t * | iscsi, |
| char * | ip, | ||
| ocs_ip_address_t * | ip_struct | ||
| ) |
Converts a string ip into an ip struct.
| iscsi | Pointer to the iSCSI structure that represents this device |
| *ip | Pointer to the ip string |
| *ip_struct | Pointer to the ip_struct to contain the given string ip |
Definition at line 256 of file ocs_isns.c.