Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_isns.c File Reference
#include "ocs.h"
#include "ocs_isns.h"
#include "ocs_iscsi.h"
#include "ocs_iscsi_api.h"

Go to the source code of this file.

Detailed Description

Implements the iSNS functions.

Definition in file ocs_isns.c.

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...
 
static void ocs_isns_keep_alive (void *arg)
 Sends a query to an ISNS target to keep it alive. 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...
 

Function Details

static void ocs_isns_keep_alive ( void *  arg)
static

Sends a query to an ISNS target to keep it alive.

This function sends a query to the disovered targets to keep them alive (if ESI is no present)

Parameters
argPointer to the ocs structure

Definition at line 1385 of file ocs_isns.c.