You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(23) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(13) |
Mar
(7) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(31) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Robert W. <wrw...@us...> - 2006-12-07 22:46:05
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/etc In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28912/etc Log Message: Directory /cvsroot/linuxisns/isnsNT/isnsserver/etc added to the repository |
From: Robert W. <wrw...@us...> - 2006-12-07 17:26:16
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv789/src Modified Files: iSNSdereg.c iSNSreg.c Log Message: Fix Check_Permission in deregistering a DDS Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSreg.c 6 Dec 2006 22:05:34 -0000 1.7 --- iSNSreg.c 7 Dec 2006 17:26:12 -0000 1.8 *************** *** 3632,3636 **** int found; ! DEBUG_0 (isns_db_debug &1,Create_Default_DD); /* check if default DDS exists, if not create it */ --- 3632,3636 ---- int found; ! DEBUG_0 (isns_db_debug &1,Create Default Domains and Domain Sets); /* check if default DDS exists, if not create it */ *************** *** 3660,3664 **** p_dds->status = 1; rval = ISNSdbWrite(&dds_key,lentry1); ! DEBUG_1 (isns_db_debug &1,Create Default DD rval:%i,rval); } --- 3660,3664 ---- p_dds->status = 1; rval = ISNSdbWrite(&dds_key,lentry1); ! DEBUG_1 (isns_db_debug &1,Create Default DDS rval:%i,rval); } Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSdereg.c 6 Dec 2006 22:05:34 -0000 1.8 --- iSNSdereg.c 7 Dec 2006 17:26:12 -0000 1.9 *************** *** 228,231 **** --- 228,233 ---- + DEBUG_0 (isns_db_debug &1, RemoveAttrDSS_Entry); + dds_key.id = id; read_key.tag = DDS_ID_KEY; *************** *** 236,240 **** p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dd); if (rval != SUCCESS) { --- 238,242 ---- p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dds); if (rval != SUCCESS) { *************** *** 249,255 **** /* Remove DDS from DD's DDS List */ memberRemovedFlag = FALSE; - pnode = NULL; memset(dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); updated_dd_list_size = 0; while ( (pnode=GetNextNode(&p_dds->dd_list, pnode)) ) { --- 251,258 ---- /* Remove DDS from DD's DDS List */ memberRemovedFlag = FALSE; memset(dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); updated_dd_list_size = 0; + + pnode = NULL; while ( (pnode=GetNextNode(&p_dds->dd_list, pnode)) ) { *************** *** 346,349 **** --- 349,354 ---- /* int isActiveFlag; */ + DEBUG_0 (isns_db_debug &1, RemoveAttrDDS_Member); + dds_key.id = id; read_key.tag = DDS_ID_KEY; |
From: Robert W. <wrw...@us...> - 2006-12-07 00:12:06
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15299/src Modified Files: iSNScomm.c Log Message: Add signal_pipe Handler Index: iSNScomm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNScomm.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNScomm.c 1 Dec 2006 21:49:29 -0000 1.6 --- iSNScomm.c 7 Dec 2006 00:12:03 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- ***********************************************************************/ + #include <signal.h> #include "iSNS.h" *************** *** 107,110 **** --- 108,116 ---- struct sockaddr_in mc_sock; + void pipe_handler(int n) + { + printf("SIG_PIPE received:%i\n",n); + } + /* * Function Name: SNSCommInit *************** *** 260,263 **** --- 266,272 ---- return (-1); } + + signal (SIGPIPE, pipe_handler); + return (SUCCESS); } |
From: Robert W. <wrw...@us...> - 2006-12-06 22:06:31
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28989/src Modified Files: iSNSInit.c iSNSdereg.c iSNSquery.c iSNSreg.c Log Message: Add a default DDS,DD - enable permissions Index: iSNSInit.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSInit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSInit.c 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSInit.c 6 Dec 2006 22:05:34 -0000 1.3 *************** *** 47,50 **** --- 47,51 ---- #include "iSNSipc.h" #include "iSNSbuffer.h" + #include "iSNSreg.h" #include "iSNSdebug.h" *************** *** 148,151 **** --- 149,154 ---- */ ISNSInitDBTables(); + Create_Default_DD(); + if ( SNSStartFSM() == ERROR ) { Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSreg.c 4 Dec 2006 22:15:28 -0000 1.6 --- iSNSreg.c 6 Dec 2006 22:05:34 -0000 1.7 *************** *** 53,56 **** --- 53,57 ---- #include "iSNSdebug.h" + int Check_if_member_of_DD (char * id); #ifndef MAX_PARSE_ATTRS *************** *** 73,79 **** static SOIP_DB_Entry entry3; - extern uint32_t *dlist_src; /*[MAX_DD_PER_LIST];*/ extern uint32_t *dlist_node; /*[MAX_DD_PER_LIST];*/ - extern SOIP_Dd_Member *ddmem; /* [100]; */ extern ISNS_LIST esi_list; --- 74,78 ---- *************** *** 88,91 **** --- 87,92 ---- extern dbStats iSNS_stats; + static int Add_ISCSINode_Default_DD (SOIP_Iscsi *p_node); + /********************************************************************* _SNSdbAddAttr *************** *** 784,793 **** ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 0)) - { - return (ISNS_INVALID_REG_ERR); - } - /* Search the keys for DD_Set. */ ddKeyIndex = ISNSFindTag (0, ISNS_DDS_ID, key_indx); --- 785,788 ---- *************** *** 1105,1114 **** ISNSParseMsg(&p_md->msg, attr_indx, key_indx, (char **) &src_attr); - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 0)) - { - return (ISNS_INVALID_REG_ERR); - } - /* Search the keys for DD_Set. */ ddKeyIndex = ISNSFindTag (0, ISNS_DD_ID, key_indx); --- 1100,1103 ---- *************** *** 2338,2387 **** p_node->entity_index = p_entity->entity_index; newIscsiNodeFlag = TRUE; } else { - #if 0 - attr = ISNSFindKeyInResponseMsg ( ISNS_ENTITY_ID, p_rspmsg ); - if ( attr ) - { - /* Fetch the old entity */ - DEBUG_0 (1,call SNSdbFetchEntity); - if ( SUCCESS != SNSdbFetchEntity (p_node->entity_id.id, &p_entity, &entry2) ) - { - if ( newIscsiNodeFlag ) - DeleteList( &p_node->dd_id_list ); - - return ( ISNS_INVALID_REG_ERR ); - } - - /* Remove this node from the old entity */ - if ( !(p_lnode = FindNode( &p_entity->iscsi_node_list, p_node->id.v, PAD4(strlen (p_node->id.v)) )) ) - { - RemoveNode( &p_entity->iscsi_node_list, p_lnode); - } - - /* Delete entity if it is the last one */ - if (IsEmptyList(&p_entity->iscsi_node_list)) - { - ISNSdbRemoveAttrEntityEntry(p_entity->eid.id, NULL, NULL); - } - - /* Associate this node with the new entity */ - DEBUG_0 (1,call SNSdbFetchEntity); - if ( SUCCESS != SNSdbFetchEntity ((char *)&attr->val, &p_entity, &entry2) ) - { - if ( newIscsiNodeFlag ) - DeleteList( &p_node->dd_id_list ); - - return ( ISNS_INVALID_REG_ERR ); - } - - if (!FindNode( &p_entity->iscsi_node_list, p_node->id.v, PAD4(strlen (p_node->id.v)) )) - { - AddNode( &p_entity->iscsi_node_list, p_node->id.v, PAD4(strlen (p_node->id.v)) ); - } - - } - #endif scn_bitmap |= ISNS_SCN_OBJ_UPDATED; } --- 2327,2336 ---- p_node->entity_index = p_entity->entity_index; newIscsiNodeFlag = TRUE; + + /* Check if member of a Domain */ + Check_if_member_of_DD (p_node->id.v); } else { scn_bitmap |= ISNS_SCN_OBJ_UPDATED; } *************** *** 2391,2405 **** ISNSAppendKey( p_scn_all_msg_buffer, ISNS_ISCSI_NODE_ID, p_node->iscsi_id_len, p_node->id.v, 0 ); - if ( entry.data_type != ISCSI_ID_KEY ) - { - DEBUG_2 ( isns_db_debug & 1, (database key does not match %u %u), - entry.data_type, ISCSI_ID_KEY ); - - if ( newIscsiNodeFlag ) - DeleteList( &p_node->dd_id_list ); - - return ( ISNS_UNKNOWN_ERR ); - } - updateFlag = FALSE; stopFlag = FALSE; --- 2340,2343 ---- *************** *** 2559,2569 **** ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); ! /* Validate the src attr */ ! memset ( dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! rval = SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 0); ! if (SUCCESS != rval) ! { ! return (rval); ! } /* Scan the keys */ --- 2497,2502 ---- ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); ! ! /* Validate the src attr for Permission */ /* Scan the keys */ *************** *** 2605,2621 **** p_node = (SOIP_Iscsi *)&entry.data.node; - if (src_attr != NULL && src_attr->tag != 0 && - strcmp ((char *)&src_attr->val, (char *)&key->val)) - { - memset (dlist_node, 0, sizeof (dlist_node)); - Get_Active_DD_List (&p_node->dd_id_list, dlist_node, 0); - - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return (ISNS_SCN_REG_REJECTED_ERR); - } - } - scn_bitmap_index = ISNSFindTag (0, ISNS_ISCSI_SCN_BITMAP, attr_indx); if (scn_bitmap_index == -1) --- 2538,2541 ---- *************** *** 2708,2724 **** } - if (src_attr != NULL && src_attr->tag != 0 && - memcmp (&src_attr->val, &key->val, ISNS_PORT_NAME_SIZE)) - { - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - Get_Active_DD_List_From_IFCP_Node ((char *)&key->val, dlist_node, 0); - - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return ( ISNS_SCN_REG_REJECTED_ERR ); - } - } - scn_bitmap_index = ISNSFindTag (0, ISNS_IFCP_SCN_BITMAP, attr_indx); if (scn_bitmap_index == -1) --- 2628,2631 ---- *************** *** 2759,2762 **** --- 2666,2673 ---- } + int Check_if_member_of_DD (char * id) + { + return SUCCESS; + } /********************************************************************* _Add_DD_to_ISCSI_Node *************** *** 3202,3205 **** --- 3113,3121 ---- int rval; + + DEBUG_0 (isns_db_debug &1,Activate_DD_Membership); + + Create_Default_DD (); + /* Get First DD Entry */ key.tag = DD_ID_KEY; *************** *** 3323,3326 **** --- 3239,3255 ---- send_scn_parameter_change_to_all( p_scn_all_msg_buffer, 0); } + else + { + Add_ISCSINode_Default_DD (p_node); + switch ( type ) + { + case ISNS_DD_ISCSI_MEMBER: + p_iscsi->activeFlag = TRUE; + break; + case ISNS_DD_IFCP_MEMBER: + p_ifcp->activeFlag = TRUE; + break; + } + } return ( SUCCESS ); *************** *** 3691,3692 **** --- 3620,3738 ---- } + int + Create_Default_DD () + { + SOIP_DB_Entry lentry1; + SOIP_DB_Entry lentry2; + SOIP_Dd *p_dd; + SOIP_Dds *p_dds; + ISNS_Key dds_key = { 0 }; + ISNS_Key dd_key = { 0 }; + int rval; + int found; + + DEBUG_0 (isns_db_debug &1,Create_Default_DD); + + /* check if default DDS exists, if not create it */ + dds_key.tag = DDS_ID_KEY; + found = FALSE; + while ( SNSdbGetNextOfKey ( &dds_key ) == SUCCESS ) + { + rval = ISNSdbRead(&dds_key,&lentry1); + if (rval != SUCCESS) + return rval; + p_dds = (SOIP_Dds *)&lentry1.data; + if ( !strcmp("default DDS",p_dds->sym_name) ) + { + found = TRUE; + } + } + + if (!found) + { + DEBUG_0 (isns_db_debug &1, Create Default DDS); + dds_key.val.dds_id = ISNS_GetNewDDS_ID (); + lentry1.data_type = DDS_ID_KEY; + p_dds = (SOIP_Dds *)&lentry1.data; + p_dds->id = dds_key.val.dds_id; + strcpy(p_dds->sym_name,"default DDS"); + InitList(DDS_DD_LIST, p_dds); + p_dds->status = 1; + rval = ISNSdbWrite(&dds_key,lentry1); + DEBUG_1 (isns_db_debug &1,Create Default DD rval:%i,rval); + } + + /* check if default DD exists, if not create it */ + dd_key.tag = DD_ID_KEY; + found = FALSE; + while ( SNSdbGetNextOfKey ( &dd_key ) == SUCCESS ) + { + rval = ISNSdbRead(&dd_key,&lentry2); + if (rval != SUCCESS) + return rval; + p_dd = (SOIP_Dd *)&lentry2.data; + if ( !strcmp("default DD",p_dd->sym_name) ) + { + found = TRUE; + } + } + + if (!found) + { + DEBUG_0 (isns_db_debug &1, Create Default DD); + dd_key.val.dd_id = ISNS_GetNewDD_ID (); + lentry2.data_type = DD_ID_KEY; + p_dd = (SOIP_Dd *)&lentry2.data; + p_dd->id = dd_key.val.dd_id; + strcpy(p_dd->sym_name,"default DD"); + InitList(DD_MEMBER_LIST, p_dd); + InitList(DD_DDS_LIST, p_dd); + p_dd->activeFlag = p_dds->status; + rval = ISNSdbWrite(&dd_key,lentry2); + DEBUG_1 (isns_db_debug &1,Create Default DD rval:%i,rval); + + /* Add DD to DDS */ + Add_dds_to_dd (p_dds,p_dd->id); + rval = ISNSdbWrite(&dds_key,lentry1); + } + + return SUCCESS; + } + + static int Add_ISCSINode_Default_DD (SOIP_Iscsi *p_node) + { + SOIP_DB_Entry lentry2; + SOIP_Dd *p_dd; + ISNS_Key dd_key = { 0 }; + int rval; + int found; + + /* check if default DD exists, if not create it */ + dd_key.tag = DD_ID_KEY; + found = FALSE; + while ( SNSdbGetNextOfKey ( &dd_key ) == SUCCESS ) + { + rval = ISNSdbRead(&dd_key,&lentry2); + if (rval != SUCCESS) + return rval; + p_dd = (SOIP_Dd *)&lentry2.data; + if ( !strcmp("default DD",p_dd->sym_name) ) + { + found = TRUE; + } + } + if (found) + { + if (!FindNode(&p_node->dd_id_list, (char *)&p_dd->id, sizeof(p_dd->id))) + { + AddNode(&p_node->dd_id_list, (char *)&p_dd->id, sizeof(p_dd->id)); + } + p_node->activeFlag = TRUE; + + DEBUG_1 (isns_db_debug &1,Add_DD_to_ISCSI_Node rval:%i,rval); + Add_DD_Member(p_dd,p_node->id.v,PAD4(strlen(p_node->id.v)),ISNS_DD_ISCSI_MEMBER,ISNS_DD_MEMBER_ENABLE,0); + ISNSdbWrite(&dd_key,lentry2); + } + return SUCCESS; + } + Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSdereg.c 4 Dec 2006 22:15:28 -0000 1.7 --- iSNSdereg.c 6 Dec 2006 22:05:34 -0000 1.8 *************** *** 1,3 **** ! /*********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. --- 1,3 ---- ! /************************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. *************** *** 65,68 **** --- 65,70 ---- ISNSAttrGetList (ISNS_Msg_Descp *p_md); + int Check_Permission (ISNS_Attr *src_attr, int rectype, void * ptr); + /* * static common variables for gdbm fetches *************** *** 77,83 **** static SOIP_DB_Entry entry5; - extern uint32_t *dlist_src; /*[MAX_DD_PER_LIST];*/ extern uint32_t *dlist_node; /*[MAX_DD_PER_LIST];*/ - extern SOIP_Dd_Member *ddmem; /* [100]; */ extern ISNS_LIST esi_list; --- 79,83 ---- *************** *** 215,221 **** SOIP_Dds *p_dds; SOIP_DDS_Key dds_key; - int ddCheckedFlag; int isActiveFlag; - int jj; int rval; int count; --- 215,219 ---- *************** *** 229,237 **** ISNS_Key read_key; - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS !=(rval=SNSGet_Active_DD_List_From_Src ((ISNS_Attr *)src_attr, dlist_src, 1))) - { - return (ISNS_INVALID_REG_ERR); - } dds_key.id = id; --- 227,230 ---- *************** *** 243,269 **** p_dds = (SOIP_Dds *)&entry.data; ! ddCheckedFlag = FALSE; ! if (src_attr && src_attr->tag != 0) { ! /* Check DD */ ! pnode=NULL; ! while ((pnode=GetNextNode(&p_dds->dd_list, pnode))) ! { ! for (jj = 0; jj < MAX_DD_PER_LIST && dlist_src[jj]!=0; jj++) ! { ! if (dlist_src[jj]==*(uint32_t *)GetNodeData(pnode)) ! { ! ddCheckedFlag = TRUE; ! break; ! } ! } ! } ! ! if (!ddCheckedFlag) ! { ! DEBUG_0 (isns_db_debug & 1, ! (Attempted to dereg DDS without being a member)); ! return (ISNS_INVALID_REG_ERR); ! } } --- 236,243 ---- p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dd); ! if (rval != SUCCESS) { ! return (ISNS_NO_SUCH_ENTRY_ERR); } *************** *** 357,364 **** ISNS_Msg * p_rspmsg) { - int jj; int kk; int rval; - int ddCheckedFlag; ISNS_Key *key; SOIP_Dds *p_dds; --- 331,336 ---- *************** *** 374,383 **** /* int isActiveFlag; */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 1)) - { - return (ISNS_INVALID_REG_ERR); - } - dds_key.id = id; read_key.tag = DDS_ID_KEY; --- 346,349 ---- *************** *** 389,415 **** p_dds = (SOIP_Dds *)&entry.data; ! ddCheckedFlag = FALSE; ! if (src_attr && src_attr->tag != 0) { ! /* Check DD */ ! pnode=NULL; ! while ((pnode=GetNextNode(&p_dds->dd_list, pnode))) ! { ! for (jj = 0; jj < MAX_DD_PER_LIST && dlist_src[jj]!=0; jj++) ! { ! if (dlist_src[jj]==*(uint32_t *)GetNodeData(pnode)) ! { ! ddCheckedFlag = TRUE; ! break; ! } ! } ! } ! ! if (!ddCheckedFlag) ! { ! DEBUG_0 (isns_db_debug & 1, ! (Attempted to dereg DDS without being a member)); ! return (ISNS_INVALID_REG_ERR); ! } } --- 355,362 ---- p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dd); ! if (rval != SUCCESS) { ! return (ISNS_NO_SUCH_ENTRY_ERR); } *************** *** 623,634 **** ISNS_Key key; ! DEBUG_1 ( isns_db_debug & 1, (Deregistering Entity %s), ! p_entity_id ); ! memset ( dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! if (SUCCESS != SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 1)) ! { ! return ( ISNS_NO_SUCH_ENTRY_ERR ); ! } /* read entity from database */ --- 570,579 ---- ISNS_Key key; ! DEBUG_1 ( isns_db_debug & 1, (Deregistering Entity %s),p_entity_id); ! /* ! Validate the src attr has permission to delete the node ! The src is an entity verify that it is the same as the entity to delete. ! */ /* read entity from database */ *************** *** 638,661 **** if (rval != SUCCESS) return rval; - p_entity = &entry.data.entity; - /* Check Zoning */ - if (src_attr && src_attr->tag - && strcmp (p_entity->eid.id, (char *)&src_attr->val)) - { - /* Check for DD */ - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (ISNS_NO_ERR != Get_Active_DD_List_From_ENTITY_Node (NULL, p_entity, - dlist_node, - 1)) - { - return (ERROR); - } - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - return (ISNS_NO_SUCH_ENTRY_ERR); - } - } /* Remove Portals */ --- 583,588 ---- *************** *** 741,749 **** DEBUG_0 (isns_db_debug & 1, (Deregistering IFCP WWPN)); ! memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! if (SUCCESS != (rval=SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 1))) ! { ! return (rval); ! } memset (buffer, 0, PORT_NAME_SIZE); --- 668,677 ---- DEBUG_0 (isns_db_debug & 1, (Deregistering IFCP WWPN)); ! /* ! Validate the src attr has permission to delete the node ! If the src node is an iscsi node, verify that it is the same ! as the iscsi node. ! If the src is an entity verify that iscsi node belongs to the entity ! */ memset (buffer, 0, PORT_NAME_SIZE); *************** *** 758,775 **** p_ifcp_node = (SOIP_Ifcp *)&entry2.data; - /* Check Zoning */ - if (src_attr != NULL && src_attr->tag != 0 && - memcmp (&src_attr->val, ifcp_node_key, ISNS_PORT_NAME_SIZE)) - { - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - Get_Active_DD_List_From_IFCP_Node (ifcp_node_key, dlist_node, 1); - - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return (ISNS_NO_SUCH_ENTRY_ERR); - } - } - /* Remove from all DD */ pnode=NULL; --- 686,689 ---- *************** *** 1150,1160 **** DEBUG_0 (isns_db_debug & 1, (Deregistering iSCSI Node)); - /* Validate the src attr */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 1)) - { - return (ISNS_NO_SUCH_ENTRY_ERR); - } - scn_bitmap = 0; key.tag = ISCSI_ID_KEY; --- 1064,1067 ---- *************** *** 1166,1182 **** p_node = (SOIP_Iscsi *)&entry2.data; ! if (src_attr != NULL && src_attr->tag != 0 && ! strcmp ((char *)&src_attr->val, p_node->id.v)) ! { ! /* Src tag exists and is not the same as the entity id */ ! memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! Get_Active_DD_List (&p_node->dd_id_list, dlist_node, 1); ! ! if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) ! { ! DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); ! return (ISNS_NO_SUCH_ENTRY_ERR); ! } ! } RemoveCert (&p_node->ptr_cert); --- 1073,1082 ---- p_node = (SOIP_Iscsi *)&entry2.data; ! /* ! Validate the src attr has permission to delete the node ! If the src node is an iscsi node, verify that it is the same ! as the iscsi node. ! If the src is an entity verify that iscsi node belongs to the entity ! */ RemoveCert (&p_node->ptr_cert); *************** *** 1350,1360 **** DEBUG_0 (isns_db_debug & 1, (Deregistering Portal)); - /* Validate the src attr */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != (rval=SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 0))) - { - return (rval); - } - ISNS_Key read_key; read_key.tag = PORTAL_ID_KEY; --- 1250,1253 ---- *************** *** 1366,1393 **** p_portal = &entry2.data.portal; ! if (src_attr != NULL && src_attr->tag != 0) ! { ! /* Src tag exists and is not the same as the entity id */ ! memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! ! pnode2 = NULL; ! while ((pnode2 = GetNextNode(&p_portal->entity_list, pnode2))) ! { ! ENTITY_LIST_ENTRY *lentry; ! ! lentry = (ENTITY_LIST_ENTRY *) GetNodeData(pnode2); ! ! if (SUCCESS != ! Get_Active_DD_List_From_ENTITY_Node (lentry->eid.id, NULL, ! dlist_node, 0)) ! return (ERROR); ! } ! ! if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) ! { ! DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); ! return (ERROR); ! } ! } /* Send detailed SCN */ --- 1259,1268 ---- p_portal = &entry2.data.portal; ! /* ! Validate the src attr has permission to delete the node ! If the src node is an iscsi node, verify that it is the same ! as the iscsi node. ! If the src is an entity verify that iscsi node belongs to the entity ! */ /* Send detailed SCN */ *************** *** 1500,1507 **** SNSdbRemoveDD_Entry ( int id, ISNS_Attr * src_attr, ISNS_Msg * p_rspmsg ) { ! int ii, rval; SOIP_Dd *p_dd; SOIP_DD_Key dd_key; - int ddCheckPassedFlag; SOIP_Dd_Member *p_member; ISNS_LIST_NODE *pnode; --- 1375,1381 ---- SNSdbRemoveDD_Entry ( int id, ISNS_Attr * src_attr, ISNS_Msg * p_rspmsg ) { ! int rval; SOIP_Dd *p_dd; SOIP_DD_Key dd_key; SOIP_Dd_Member *p_member; ISNS_LIST_NODE *pnode; *************** *** 1510,1519 **** ISNS_Key key; - /* Validate the src attr */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src ((ISNS_Attr *)src_attr, dlist_src, 1)) - { - return (ISNS_NO_SUCH_ENTRY_ERR); - } dd_key.id = id; --- 1384,1387 ---- *************** *** 1527,1548 **** p_dd = (SOIP_Dd *)&entry.data; ! if ( src_attr && src_attr->tag != 0 ) { ! ddCheckPassedFlag = FALSE; ! for (ii = 0; ii < MAX_DD_PER_LIST && dlist_src[ii]!=0; ii++) ! { ! if ( dlist_src[ ii ] == p_dd->id ) ! { ! ddCheckPassedFlag = TRUE; ! break; ! } ! ! } ! ! if ( !ddCheckPassedFlag ) ! { ! DEBUG_0 (isns_db_debug & 1, (Node outside DD trying to dereg DD)); ! return ( ISNS_NO_SUCH_ENTRY_ERR ); ! } } --- 1395,1402 ---- p_dd = (SOIP_Dd *)&entry.data; ! rval = Check_Permission(src_attr, DD_ID_KEY, p_dd); ! if (rval != SUCCESS) { ! return (ISNS_NO_SUCH_ENTRY_ERR); } *************** *** 1661,1675 **** SOIP_Dd *p_dd; SOIP_DD_Key dd_key; - int ddCheckPassedFlag; int removeMemberFlag; ISNS_Key key; - /* Validate the src attr */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != SNSGet_Active_DD_List_From_Src ((ISNS_Attr *)src_attr, dlist_src, 1)) - { - return (ISNS_NO_SUCH_ENTRY_ERR); - } - dd_key.id = id; --- 1515,1521 ---- *************** *** 1682,1703 **** p_dd = (SOIP_Dd *)&entry.data; ! if (src_attr && src_attr->tag != 0) { ! ddCheckPassedFlag = FALSE; ! for (ii = 0; ii < MAX_DD_PER_LIST && dlist_src[ii]!=0; ii++) ! { ! if (dlist_src[ii] == p_dd->id) ! { ! ddCheckPassedFlag = TRUE; ! break; ! } ! ! } ! ! if (!ddCheckPassedFlag) ! { ! DEBUG_0 (isns_db_debug & 1, (Node outside DD trying to dereg DD)); ! return (ISNS_NO_SUCH_ENTRY_ERR); ! } } --- 1528,1535 ---- p_dd = (SOIP_Dd *)&entry.data; ! rval = Check_Permission(src_attr, DD_ID_KEY, p_dd); ! if (rval != SUCCESS) { ! return (ISNS_NO_SUCH_ENTRY_ERR); } *************** *** 2010,2019 **** ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); - /* Validate the src attr */ - memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - if (SUCCESS != (rval=SNSGet_Active_DD_List_From_Src (src_attr, dlist_src, 0))) - { - return (rval); - } /* Scan the keys */ --- 1842,1845 ---- *************** *** 2039,2043 **** /* Error condition */ break; - } } --- 1865,1868 ---- *************** *** 2060,2076 **** p_node = (SOIP_Iscsi *)&entry.data; - if (src_attr != NULL && src_attr->tag != 0 && - strcmp ((char *)&src_attr->val, (char *)&key->val)) - { - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - Get_Active_DD_List (&p_node->dd_id_list, dlist_node, 0); - - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return (ISNS_NO_SUCH_ENTRY_ERR); - } - } - p_node->scn_bitmap=0; p_node->scn_sockfd = 0; --- 1885,1888 ---- *************** *** 2097,2113 **** p_ifcp_node = &entry.data.port; - if (src_attr != NULL && src_attr->tag != 0 && - memcmp (&src_attr->val, &key->val, ISNS_PORT_NAME_SIZE)) - { - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - Get_Active_DD_List_From_IFCP_Node ((char *)&key->val, dlist_node, 0); - - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return (ISNS_NO_SUCH_ENTRY_ERR); - } - } - p_ifcp_node->scn_bitmap=0; p_ifcp_node->scn_sockfd = 0; --- 1909,1912 ---- *************** *** 2132,2153 **** } - if (src_attr->tag && strcmp ((char *)&key->val, (char *)&src_attr->val)) - { - memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); - - if (ISNS_NO_ERR != Get_Active_DD_List_From_ENTITY_Node (NULL, - p_entity, - dlist_node, - 0)) - { - return (ISNS_NO_SUCH_ENTRY_ERR); - } - if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) - { - DEBUG_0(isns_db_debug & 1, "***WARNING: Different dd.\n"); - return (ISNS_NO_SUCH_ENTRY_ERR); - } - } - p_entity->scn_bitmap=0; p_entity->scn_sockfd = 0; --- 1931,1934 ---- *************** *** 2169,2173 **** return (ISNS_NO_ERR); - } --- 1950,1953 ---- Index: iSNSquery.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSquery.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSquery.c 6 Nov 2006 18:04:38 -0000 1.4 --- iSNSquery.c 6 Dec 2006 22:05:34 -0000 1.5 *************** *** 127,130 **** --- 127,132 ---- SNSdbGetAttrEntity (char **attr_indx, char **key_indx, ISNS_Attr * src_attr, ISNS_Msg_Descp * md, ISNS_Msg * p_rspmsg); + int + Check_Permission (ISNS_Attr *src_attr, int rectype, void * ptr); *************** *** 272,278 **** DEBUG_0 (isns_db_debug &1,(GetAttrEntity)); [...1393 lines suppressed...] + p_dd = ptr; + int ii; + + for (ii = 0; ii < MAX_DD_PER_LIST && dlist_src[ii]!=0; ii++) + { + if (dlist_src[ii] == p_dd->id) + { + return (SUCCESS); + break; + } + } + } + break; + default: + return (ISNS_INVALID_QUERY_ERR); + break; + } + + return SUCCESS; + } |
From: Robert W. <wrw...@us...> - 2006-12-06 22:06:27
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28989/include Modified Files: iSNSreg.h Log Message: Add a default DDS,DD - enable permissions Index: iSNSreg.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSreg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iSNSreg.h 3 Nov 2006 20:22:29 -0000 1.1 --- iSNSreg.h 6 Dec 2006 22:05:34 -0000 1.2 *************** *** 241,243 **** --- 241,246 ---- Append_DD_to_List (ISNS_DD_LIST p_dlist, uint32_t id); + int + Create_Default_DD(); + #endif |
From: Robert W. <wrw...@us...> - 2006-12-05 16:28:57
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29152/isnsserver/src Modified Files: iSNSList.c Log Message: fix list defect Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNSList.c 4 Dec 2006 22:15:25 -0000 1.5 --- iSNSList.c 5 Dec 2006 16:28:34 -0000 1.6 *************** *** 211,215 **** ISNS_LIST *p_list; - curr_node = NULL; DEBUG_0 (isns_db_debug &1,Remove Node); --- 211,214 ---- *************** *** 217,220 **** --- 216,220 ---- foundFlag = FALSE; + curr_node = NULL; curr_node = GetNextNode(plist, curr_node); while ( curr_node != NULL ) *************** *** 229,232 **** --- 229,238 ---- } + if ( (curr_node == NULL) && (plist->node_count > 0) ) + { + DEBUG_1 (isns_db_debug &1,Remove Node FAILURE node_count:%i,plist->node_count); + plist->node_count--; + return ERROR; /* we should have found a node in this case */ + } DEBUG_1 (isns_db_debug &1, Remove Node FoundFlag: %i,foundFlag); |
From: Robert W. <wrw...@us...> - 2006-12-05 16:28:42
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29152/isnsclient/src Modified Files: entity.c Log Message: fix list defect Index: entity.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/entity.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** entity.c 28 Nov 2006 22:00:47 -0000 1.5 --- entity.c 5 Dec 2006 16:28:33 -0000 1.6 *************** *** 221,224 **** --- 221,228 ---- printf ("Registering Entity.\n"); /* Insert Header */ + printf("replaceFlag:%i\n",replaceFlag); + printf("hdr replace:%i\n",replaceFlag?ISNS_FLAG_REPLACE_REG:0); + + ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd), replaceFlag?ISNS_FLAG_REPLACE_REG:0); |
From: Robert W. <wrw...@us...> - 2006-12-04 22:15:39
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32350/src Modified Files: iSNSList.c iSNSdb.c iSNSdereg.c iSNSparse.c iSNSreg.c Log Message: Fix defect in deleting lists Index: iSNSparse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSparse.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSparse.c 1 Dec 2006 15:35:17 -0000 1.7 --- iSNSparse.c 4 Dec 2006 22:15:28 -0000 1.8 *************** *** 283,286 **** --- 283,288 ---- return (ERROR); + DEBUG_1(sns_parse_debug &1,message hdr flags:%x,msg->hdr.flags); + /* Store Keys */ offset = 0; Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNSreg.c 22 Nov 2006 17:45:39 -0000 1.5 --- iSNSreg.c 4 Dec 2006 22:15:28 -0000 1.6 *************** *** 383,402 **** p_portal = &entry2.data.portal; ! if ( rval == SUCCESS && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { ! /* An entry was found and the update flag is not set, ! we need to deregister it. */ ! ! DEBUG_0 (isns_db_debug & 1, "***WARNING: Deregistering Portal.\n"); SNSRemovePortalEntry ((char *)&db_portal, NULL, NULL); - - /* Set this */ rval = ERROR; } - DEBUG_0 (isns_db_debug &1,create new portal entry); /* Create new entry */ if ( rval != SUCCESS ) { if ( FALSE == newPortalRegFlag ) { --- 383,398 ---- p_portal = &entry2.data.portal; ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { ! DEBUG_0 (isns_db_debug & 1, "Deregistering Portal.\n"); SNSRemovePortalEntry ((char *)&db_portal, NULL, NULL); rval = ERROR; } /* Create new entry */ if ( rval != SUCCESS ) { + DEBUG_0 (isns_db_debug &1,create new portal entry); + if ( FALSE == newPortalRegFlag ) { *************** *** 873,885 **** p_dds = (SOIP_Dds *)&entry.data; - if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) - { - /* An entry was found and the update flag is not set, - we need to deregister it. */ ! DEBUG_0(isns_db_debug & 1, "***WARNING: Deregistering DDS.\n"); SNSdbRemoveAttrDDS_Entry (dds_key.id, NULL, NULL); - - /* Set this */ rval = ERROR; } --- 869,877 ---- p_dds = (SOIP_Dds *)&entry.data; ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) ! { ! DEBUG_0(isns_db_debug & 1, "Deregistering DDS.\n"); SNSdbRemoveAttrDDS_Entry (dds_key.id, NULL, NULL); rval = ERROR; } *************** *** 1200,1210 **** p_dd = (SOIP_Dd *)&entry.data; ! if ( rval == SUCCESS && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { - /* An entry was found and the update flag is not set, - we need to deregister it. */ SNSdbRemoveDD_Entry ( dd_key.id, NULL, NULL ); - - /* Set this */ rval = ERROR; } --- 1192,1198 ---- p_dd = (SOIP_Dd *)&entry.data; ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { SNSdbRemoveDD_Entry ( dd_key.id, NULL, NULL ); rval = ERROR; } *************** *** 1510,1521 **** else if ( entityAttrIndex == -1 && entityKeyIndex == -1 ) { ! /* Entity ID was not provided. */ memset (tempEntityId, 0, sizeof (tempEntityId)); sprintf(tempEntityId, "isns.entity.%4.4d", entityNumber++); - - /* strcpy (tempEntityId, "iSNS:"); */ - /* itoa (entityNumber++, &tempEntityId[5], 10); */ - - /* Generate one */ strncpy ((char *) db_entity_id.id, (char *) tempEntityId, sizeof(db_entity_id.id) ); } --- 1498,1504 ---- else if ( entityAttrIndex == -1 && entityKeyIndex == -1 ) { ! /* Entity ID was not provided so generate one. */ memset (tempEntityId, 0, sizeof (tempEntityId)); sprintf(tempEntityId, "isns.entity.%4.4d", entityNumber++); strncpy ((char *) db_entity_id.id, (char *) tempEntityId, sizeof(db_entity_id.id) ); } *************** *** 1526,1542 **** rval = ISNSdbRead(&read_key,&entry); ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { ! /* An entry was found and the update flag is not set, ! we need to deregister it. */ ! ! DEBUG_0 (isns_db_debug &1, RemoveEntity); ! ! if (SUCCESS != ! (rval = ISNSdbRemoveAttrEntityEntry (db_entity_id.id, NULL, NULL))) ! return (rval); ! ! /* Set this */ ! rval = ERROR; } --- 1509,1518 ---- rval = ISNSdbRead(&read_key,&entry); ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { ! /* An entry was found and the update flag is not set, so deregister it */ ! DEBUG_0 (isns_db_debug &1, RemoveEntity); ! ISNSdbRemoveAttrEntityEntry (db_entity_id.id, NULL, NULL); ! rval = ERROR; } *************** *** 1748,1759 **** p_node = (SOIP_Fc_Node *)&entry.data.node; ! if ( rval == SUCCESS && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { - /* An entry was found and the update flag is not set, - we need to deregister it. */ DEBUG_0 (isns_db_debug & 2, (Deregistering FC Node)); SNSRemoveFCNodeEntry (key->val.node_name.v, NULL); - - /* Set this */ rval = ERROR; } --- 1724,1731 ---- p_node = (SOIP_Fc_Node *)&entry.data.node; ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { DEBUG_0 (isns_db_debug & 2, (Deregistering FC Node)); SNSRemoveFCNodeEntry (key->val.node_name.v, NULL); rval = ERROR; } *************** *** 1922,1933 **** p_ifcp_node = (SOIP_Ifcp *)&entry.data; ! if ( rval == SUCCESS && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { - /* An entry was found and the update flag is not set, - we need to deregister it. */ DEBUG_0 (isns_db_debug & 2, (Deregistering iFCP Node)); SNSRemoveIFCPNodeEntry ((char *)&key->val, NULL, NULL); - - /* Set this */ rval = ERROR; } --- 1894,1901 ---- p_ifcp_node = (SOIP_Ifcp *)&entry.data; ! if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG) ) { DEBUG_0 (isns_db_debug & 2, (Deregistering iFCP Node)); SNSRemoveIFCPNodeEntry ((char *)&key->val, NULL, NULL); rval = ERROR; } *************** *** 2263,2273 **** if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { ! /* An entry was found and the update flag is not set, ! we need to deregister it. */ ! DEBUG_1 ( isns_db_debug & 2, (Deregistering iSCSI Node %s), ! db_node_name.v ); SNSRemoveISCSINodeEntry ( db_node_name.v, NULL, NULL ); - - /* Set this */ rval = ERROR; } --- 2231,2236 ---- if ( (rval == SUCCESS) && (p_md->msg.hdr.flags & ISNS_FLAG_REPLACE_REG)) { ! DEBUG_1 ( isns_db_debug & 2, (Deregistering iSCSI Node %s), db_node_name.v); SNSRemoveISCSINodeEntry ( db_node_name.v, NULL, NULL ); rval = ERROR; } Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** iSNSdb.c 1 Dec 2006 21:49:29 -0000 1.15 --- iSNSdb.c 4 Dec 2006 22:15:28 -0000 1.16 *************** *** 308,312 **** k.dptr = (char *)&key->val.dds_id; k.dsize = DDS_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DDS Write failed); --- 308,312 ---- k.dptr = (char *)&key->val.dds_id; k.dsize = DDS_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DDS Write failed); *************** *** 317,321 **** k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DD Write failed); --- 317,321 ---- k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DD Write failed); *************** *** 325,329 **** k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ISCSI Write failed); --- 325,329 ---- k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ISCSI Write failed); *************** *** 341,345 **** k.dptr = (char *)key->val.port_name.v; k.dsize = strlen(key->val.port_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORT_NAME Write failed); --- 341,345 ---- k.dptr = (char *)key->val.port_name.v; k.dsize = strlen(key->val.port_name.v); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORT_NAME Write failed); *************** *** 348,352 **** k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,FC NODE_NAME Write failed); --- 348,352 ---- k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,FC NODE_NAME Write failed); *************** *** 355,359 **** k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_DB_Portal); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORTAL Name Write failed); --- 355,359 ---- k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_DB_Portal); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORTAL Name Write failed); *************** *** 364,368 **** k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_IDX_Key); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,Index Write failed); --- 364,368 ---- k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_IDX_Key); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,Index Write failed); *************** *** 410,414 **** break; } ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,List Write failed); --- 410,414 ---- break; } ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,List Write failed); Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSdereg.c 1 Dec 2006 21:49:29 -0000 1.6 --- iSNSdereg.c 4 Dec 2006 22:15:28 -0000 1.7 *************** *** 618,627 **** ISNS_Msg * p_rspmsg ) { ! SOIP_Entity *p_entity; ! /* SOIP_DD_Key dd_key; */ ! SOIP_Entity_Key db_entity_id; ! int rval; ! ISNS_LIST_NODE *pnode; ! ISNS_Key delete_key; DEBUG_1 ( isns_db_debug & 1, (Deregistering Entity %s), --- 618,625 ---- ISNS_Msg * p_rspmsg ) { ! SOIP_Entity *p_entity; ! int rval; ! ISNS_LIST_NODE *pnode; ! ISNS_Key key; DEBUG_1 ( isns_db_debug & 1, (Deregistering Entity %s), *************** *** 634,648 **** } ! /* Fetch entity from hash */ ! if (SUCCESS != (rval = SNSdbFetchEntity (p_entity_id, &p_entity, &entry))) ! return ( rval ); ! ! memset ( &db_entity_id, 0, sizeof (db_entity_id) ); ! strncpy ((char *) db_entity_id.id, (char *) p_entity_id, sizeof(db_entity_id.id) ); ! ! ISNS_Key read_key; ! read_key.tag = ENTITY_ID_KEY; ! strcpy(read_key.val.entity_id.id,db_entity_id.id); ! rval = ISNSdbRead(&read_key,&entry); if (rval != SUCCESS) return rval; --- 632,639 ---- } ! /* read entity from database */ ! key.tag = ENTITY_ID_KEY; ! strcpy(key.val.entity_id.id,p_entity_id); ! rval = ISNSdbRead(&key,&entry); if (rval != SUCCESS) return rval; *************** *** 668,683 **** } - - /* Remove Portals */ ! while ((pnode = GetNextNode(&p_entity->iportal_list, NULL /* head of list */))) { rval = SNSRemovePortalEntry (GetNodeData(pnode), NULL, p_rspmsg); - - if (rval) - break; } - - DEBUG_0 (isns_db_debug &1,Remove iportal_list); DeleteList( &p_entity->iportal_list ); --- 659,669 ---- } /* Remove Portals */ ! DEBUG_0 (isns_db_debug &1,Remove iportal_list); ! pnode = NULL; ! while ((pnode = GetNextNode(&p_entity->iportal_list, pnode))) { rval = SNSRemovePortalEntry (GetNodeData(pnode), NULL, p_rspmsg); } DeleteList( &p_entity->iportal_list ); *************** *** 687,695 **** /* Remove IFCP Nodes */ DEBUG_0 (isns_db_debug &1,Remove ifcp_node_list); ! while ((pnode = GetNextNode(&p_entity->ifcp_node_list, NULL /* head of list */))) { ! rval = ! SNSRemoveIFCPNodeEntry (GetNodeData(pnode), NULL, ! p_rspmsg); } DeleteList( &p_entity->ifcp_node_list ); --- 673,680 ---- /* Remove IFCP Nodes */ DEBUG_0 (isns_db_debug &1,Remove ifcp_node_list); ! pnode = NULL; ! while ((pnode = GetNextNode(&p_entity->ifcp_node_list, pnode))) { ! rval = SNSRemoveIFCPNodeEntry (GetNodeData(pnode), NULL, p_rspmsg); } DeleteList( &p_entity->ifcp_node_list ); *************** *** 700,709 **** DEBUG_0 (isns_db_debug &1,Remove iscsi_node_list); pnode = NULL; ! while ((pnode = GetNextNode(&p_entity->iscsi_node_list, pnode /* head of list */))) { DEBUG_0 (isns_db_debug &1, Call SNSRemoveISCSINodeEntry); ! rval = ! SNSRemoveISCSINodeEntry (GetNodeData(pnode), NULL, ! p_rspmsg); if (rval) break; --- 685,692 ---- DEBUG_0 (isns_db_debug &1,Remove iscsi_node_list); pnode = NULL; ! while ((pnode = GetNextNode(&p_entity->iscsi_node_list, pnode))) { DEBUG_0 (isns_db_debug &1, Call SNSRemoveISCSINodeEntry); ! rval = SNSRemoveISCSINodeEntry (GetNodeData(pnode), NULL, p_rspmsg); if (rval) break; *************** *** 716,719 **** --- 699,705 ---- } + RemoveCert (&p_entity->ptr_cert); + + /* Remove Entity In Entity Index Database */ ISNS_Key remove_key; remove_key.tag = ENTITY_IDX_KEY; *************** *** 722,734 **** ISNSdbDelete(&remove_key); ! /* Remove Self */ ! delete_key.tag = ENTITY_ID_KEY; ! strcpy(delete_key.val.entity_id.id,db_entity_id.id); ! ISNSdbDelete (&delete_key); iSNS_stats.num_entity--; - RemoveCert (&p_entity->ptr_cert); ISNSAppendKey (p_rspmsg, ISNS_ENTITY_ID, PAD4 (strlen (p_entity_id)), p_entity_id, 0); return ( rval ); } --- 708,719 ---- ISNSdbDelete(&remove_key); ! /* Remove Entity */ ! rval = ISNSdbDelete (&key); ! iSNS_stats.num_entity--; ISNSAppendKey (p_rspmsg, ISNS_ENTITY_ID, PAD4 (strlen (p_entity_id)), p_entity_id, 0); + return ( rval ); } *************** *** 1149,1153 **** *********************************************************************/ int ! SNSRemoveISCSINodeEntry (char *iscsi_node_key_o, ISNS_Attr * src_attr, ISNS_Msg * p_rspmsg) { --- 1134,1138 ---- *********************************************************************/ int ! SNSRemoveISCSINodeEntry (char *iscsi_node_key, ISNS_Attr * src_attr, ISNS_Msg * p_rspmsg) { *************** *** 1159,1171 **** SOIP_DD_Key dd_key; ISNS_LIST_NODE *pnode; ! SOIP_Entity_Key db_entity; ! char iscsi_node_key[MAX_ISCSI_NODE_ID_SIZE]; ! ISNS_Key delete_key; DEBUG_0 (isns_db_debug & 1, (Deregistering iSCSI Node)); - if (iscsi_node_key_o) - strncpy(iscsi_node_key, iscsi_node_key_o, sizeof(iscsi_node_key)); - /* Validate the src attr */ memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); --- 1144,1153 ---- SOIP_DD_Key dd_key; ISNS_LIST_NODE *pnode; ! ISNS_Key key; ! ISNS_Key entity_key; ! ISNS_Key remove_key; DEBUG_0 (isns_db_debug & 1, (Deregistering iSCSI Node)); /* Validate the src attr */ memset (dlist_src, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); *************** *** 1176,1183 **** scn_bitmap = 0; ! ISNS_Key read_key; ! read_key.tag = ISCSI_ID_KEY; ! strcpy(read_key.val.node_name.v,iscsi_node_key); ! rval = ISNSdbRead(&read_key,&entry2); if (rval != SUCCESS) return rval; --- 1158,1164 ---- scn_bitmap = 0; ! key.tag = ISCSI_ID_KEY; ! strcpy(key.val.node_name.v,iscsi_node_key); ! rval = ISNSdbRead(&key,&entry2); if (rval != SUCCESS) return rval; *************** *** 1250,1260 **** } ! /* Fetch Entity Node */ ! if (SUCCESS != SNSdbFetchEntity (p_node->entity_id.id, &p_entity, &entry4)) ! { ! return (ERROR); ! } ! memset( &db_entity, 0, sizeof(db_entity) ); ! strncpy( db_entity.id, p_node->entity_id.id, sizeof(db_entity.id) ); /* Remove ISCSI Node from ENTITY */ --- 1231,1242 ---- } ! /* read entity from database */ ! entity_key.tag = ENTITY_ID_KEY; ! strcpy(entity_key.val.entity_id.id,p_node->entity_id.id); ! rval = ISNSdbRead(&entity_key,&entry4); ! if (rval != SUCCESS) ! return ERROR; ! ! p_entity = &entry4.data.entity; /* Remove ISCSI Node from ENTITY */ *************** *** 1264,1318 **** } ! ISNS_Key key; ! key.tag = ENTITY_ID_KEY; ! strcpy(key.val.entity_id.id,db_entity.id); ! rval = ISNSdbWrite(&key,entry4); ! ! /* Deregister Entity if the period ! is not set and this is the last node */ ! #if 0 ! if (/* p_entity->period == 0 && */ ! IsEmptyList(&p_entity->iscsi_node_list)) ! { ! int more_esi_portals; ! SOIP_Portal *p_portal; ! ! /* Anymore Portals w/ ESI */ ! more_esi_portals = FALSE; ! pnode=NULL; ! while ((pnode=GetNextNode(&p_entity->iportal_list, pnode))) ! { ! /* Fetch Portal */ ! ISNS_Key read_key; ! read_key.tag = PORTAL_ID_KEY; ! memcpy(&read_key.val,GetNodeData(pnode),sizeof(SOIP_DB_Portal)); ! rval = ISNSdbRead(&read_key,&entry3); ! if (rval != SUCCESS) ! return rval; ! ! p_portal = (SOIP_Portal *)&entry3.data; ! ! if (p_portal->esi_interval != 0) ! { ! more_esi_portals = TRUE; ! break; ! } ! } ! ! if (!more_esi_portals) ! { ! /* remove entity */ ! ISNSdbRemoveAttrEntityEntry (p_entity->eid.id, NULL, NULL); ! } ! } ! #endif /* Delete the iSCSI Node */ - ISNS_Key remove_key; remove_key.tag = ISCSI_IDX_KEY; remove_key.val.idx.index = p_node->iscsi_index; remove_key.val.idx.index_type = ISCSI_IDX_KEY; ISNSdbDelete(&remove_key); - iSNS_stats.num_iscsi--; RemoveCert (&p_node->ptr_cert); DeleteList(&p_node->dd_id_list); --- 1246,1257 ---- } ! /* update entity in database by doing a write */ ! rval = ISNSdbWrite(&entity_key,entry4); /* Delete the iSCSI Node */ remove_key.tag = ISCSI_IDX_KEY; remove_key.val.idx.index = p_node->iscsi_index; remove_key.val.idx.index_type = ISCSI_IDX_KEY; ISNSdbDelete(&remove_key); RemoveCert (&p_node->ptr_cert); DeleteList(&p_node->dd_id_list); *************** *** 1324,1336 **** ISNSRemoveSCNEntry (ISNS_ISCSI_NODE_ID, iscsi_node_key); ! delete_key.tag = ISCSI_ID_KEY; ! strcpy(delete_key.val.node_name.v,iscsi_node_key); ! if ( ISNSdbDelete (&delete_key) != SUCCESS) { ! DEBUG_1 (isns_db_debug & 1, (ISCSI NODE Removal failed %s), ! iscsi_node_key); return (ERROR); } return ( ISNS_NO_ERR ); } --- 1263,1275 ---- ISNSRemoveSCNEntry (ISNS_ISCSI_NODE_ID, iscsi_node_key); ! rval = ISNSdbDelete(&key); ! if (rval != SUCCESS) { ! DEBUG_1 (isns_db_debug & 1, (ISCSI NODE Removal failed %s), iscsi_node_key); return (ERROR); } + iSNS_stats.num_iscsi--; + return ( ISNS_NO_ERR ); } Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSList.c 1 Dec 2006 21:49:29 -0000 1.4 --- iSNSList.c 4 Dec 2006 22:15:25 -0000 1.5 *************** *** 230,234 **** ! DEBUG_1 (isns_db_debug &1, FoundFlag%i,foundFlag); if ( foundFlag ) { --- 230,234 ---- ! DEBUG_1 (isns_db_debug &1, Remove Node FoundFlag: %i,foundFlag); if ( foundFlag ) { *************** *** 513,517 **** IsEmptyList(ISNS_LIST *plist) { ! DEBUG_1 (isns_db_debug &1,IsEmptyList:%i,plist->node_count); if (plist->node_count == 0) --- 513,517 ---- IsEmptyList(ISNS_LIST *plist) { ! DEBUG_1 (isns_db_debug &1,IsEmptyList node_count:%i,plist->node_count); if (plist->node_count == 0) *************** *** 540,547 **** ISNS_LIST *p_list; ! DEBUG_1 (isns_db_debug &1,GetNextNode list_id:%i,plist->list_id); ! DEBUG_1 (isns_db_debug &1,GetNextNode node_count:%i,plist->node_count); ! if (plist && plist->node_count == 0) { return ( NULL ); --- 540,546 ---- ISNS_LIST *p_list; ! DEBUG_2 (isns_db_debug &1,GetNextNode list_id:%i node_count:%i, plist->list_id,plist->node_count); ! if (!plist || plist->node_count == 0) { return ( NULL ); *************** *** 555,564 **** if ( pnode == NULL) { - if (plist->node_count == 0) - return NULL; - DEBUG_0 (isns_db_debug &1, AllocBuffer for first node); node = (ISNS_LIST_NODE *)ISNSAllocBuffer(sizeof(ISNS_LIST_NODE)); key.val.list.list_index = plist->first_index; } else --- 554,566 ---- if ( pnode == NULL) { DEBUG_0 (isns_db_debug &1, AllocBuffer for first node); node = (ISNS_LIST_NODE *)ISNSAllocBuffer(sizeof(ISNS_LIST_NODE)); key.val.list.list_index = plist->first_index; + if (key.val.list.list_index == 0 ) + { + DEBUG_0 (isns_db_debug &1,Error condition node count>0 but first_index is 0); + plist->node_count = 0; + return NULL; + } } else *************** *** 584,587 **** --- 586,590 ---- if (rval != SUCCESS) { + plist->node_count--; return NULL; } |
From: Robert W. <wrw...@us...> - 2006-12-01 21:49:32
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12467/src Modified Files: iSNSList.c iSNScomm.c iSNSdb.c iSNSdereg.c iSNStrcv.c Log Message: fix portal_entity_list Index: iSNScomm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNScomm.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNScomm.c 1 Dec 2006 15:35:17 -0000 1.5 --- iSNScomm.c 1 Dec 2006 21:49:29 -0000 1.6 *************** *** 388,392 **** char dot_not_addr[INET_ADDR_LEN]; - DEBUG_0 (1,ConvertPayload); SNSConvertPayloadHTON(&p_md->msg); --- 388,391 ---- *************** *** 404,410 **** p_md->msg.hdr.flags = htons(p_md->msg.hdr.flags); - DEBUG_0 (1,send); s_len = send(p_md->cb.sock.sockfd, (char *)&p_md->msg, len, 0); - DEBUG_0 (1,send); if (s_len<=0) { --- 403,407 ---- Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSList.c 22 Nov 2006 17:45:39 -0000 1.3 --- iSNSList.c 1 Dec 2006 21:49:29 -0000 1.4 *************** *** 207,211 **** SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_DB_Portal *p_portal; SOIP_Fc_Node *p_ifcp; ISNS_LIST *p_list; --- 207,211 ---- SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_Portal *p_portal; SOIP_Fc_Node *p_ifcp; ISNS_LIST *p_list; *************** *** 285,289 **** { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); } else if (plist->list_id == ESI_LIST) --- 285,290 ---- { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal.ip_addr,&p_portal->ip_addr,sizeof(IP_Address)); ! key.val.list.key.portal.ip_port = p_portal->ip_port; } else if (plist->list_id == ESI_LIST) *************** *** 396,400 **** SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_DB_Portal *p_portal; SOIP_Fc_Node *p_ifcp; --- 397,401 ---- SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_Portal *p_portal; SOIP_Fc_Node *p_ifcp; *************** *** 457,462 **** { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); ! memcpy(&entry.data.list.key.entity_id.id,pdata,data_size); } else if (plist->list_id == ESI_LIST) --- 458,464 ---- { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal.ip_addr,&p_portal->ip_addr,sizeof(IP_Address)); ! key.val.list.key.portal.ip_port = p_portal->ip_port; ! memcpy(&entry.data.list.key.portal,pdata,data_size); } else if (plist->list_id == ESI_LIST) *************** *** 534,538 **** SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_DB_Portal *p_portal; SOIP_Fc_Node *p_ifcp; ISNS_LIST *p_list; --- 536,540 ---- SOIP_Dds *p_dds; SOIP_Dd *p_dd; ! SOIP_Portal *p_portal; SOIP_Fc_Node *p_ifcp; ISNS_LIST *p_list; *************** *** 566,569 **** --- 568,577 ---- key.val.list.list_index = node->next_index; } + + if (key.val.list.list_index == 0) + { + DEBUG_0 (isns_db_debug &1, No More Entries in list); + return NULL; + } DEBUG_0 (isns_db_debug &1,Now Read entry); *************** *** 674,684 **** { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); rval = ISNSdbRead(&key,&entry); if (rval != SUCCESS) return NULL; ! node->data_size = sizeof(entry.data.list.key.entity_id.id); node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.entity_id.id,node->data_size); } else if (plist->list_id == ESI_LIST) --- 682,693 ---- { p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal.ip_addr,&p_portal->ip_addr,sizeof(IP_Address)); ! key.val.list.key.portal.ip_port = p_portal->ip_port; rval = ISNSdbRead(&key,&entry); if (rval != SUCCESS) return NULL; ! node->data_size = sizeof(entry.data.list.key.portal); node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.portal,node->data_size); } else if (plist->list_id == ESI_LIST) Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNSdereg.c 22 Nov 2006 17:45:39 -0000 1.5 --- iSNSdereg.c 1 Dec 2006 21:49:29 -0000 1.6 *************** *** 1271,1274 **** --- 1271,1275 ---- /* Deregister Entity if the period is not set and this is the last node */ + #if 0 if (/* p_entity->period == 0 && */ IsEmptyList(&p_entity->iscsi_node_list)) *************** *** 1305,1308 **** --- 1306,1310 ---- } } + #endif /* Delete the iSCSI Node */ Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** iSNSdb.c 1 Dec 2006 15:35:17 -0000 1.14 --- iSNSdb.c 1 Dec 2006 21:49:29 -0000 1.15 *************** *** 70,73 **** --- 70,74 ---- */ //extern ndb_error ndb_errno; + extern int gdbm_errno; /* *************** *** 229,249 **** break; case LIST_KEY: ! DEBUG_1 (isns_db_debug & 1,(read List %i),key->val.list.list_id); k.dptr = (char *)&key->val; switch (key->val.list.list_id) { case ENTITY_ISCSI_LIST: ! DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case ENTITY_FCP_LIST: ! DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case ENTITY_PORTAL_LIST: ! DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case PORTAL_ENTITY_LIST: k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); break; --- 230,251 ---- break; case LIST_KEY: ! DEBUG_2 (isns_db_debug & 1,(read listid:%i index:%i),key->val.list.list_id,key->val.list.list_index); k.dptr = (char *)&key->val; switch (key->val.list.list_id) { case ENTITY_ISCSI_LIST: ! DEBUG_1 (isns_db_debug & 1, (read list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case ENTITY_FCP_LIST: ! DEBUG_1 (isns_db_debug & 1, (read list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case ENTITY_PORTAL_LIST: ! DEBUG_1 (isns_db_debug & 1, (read list:%s),(char *)&key->val.list.key.entity_id.id); k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); break; case PORTAL_ENTITY_LIST: + DEBUG_1 (isns_db_debug & 1, (read list:%i),key->val.list.key.portal.ip_port); k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); break; *************** *** 331,337 **** k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) ! DEBUG_0 (isns_db_debug &1,ENTITY Write failed); //ISNSDisplay_Entity (&entry.data.entity,HI_DETAIL); break; --- 333,339 ---- k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); ! rc = ndb_store_sns (key->tag, k, d, GDBM_REPLACE); if (rc == ERROR) ! DEBUG_1 (isns_db_debug &1,ENTITY Write failed errno:%i,gdbm_errno); //ISNSDisplay_Entity (&entry.data.entity,HI_DETAIL); break; *************** *** 368,371 **** --- 370,375 ---- case LIST_KEY: k.dptr = (char *)&key->val; + DEBUG_2 (isns_db_debug & 1,(write listid:%i index:%i),key->val.list.list_id,key->val.list.list_index); + k.dptr = (char *)&key->val; switch (key->val.list.list_id) { *************** *** 383,386 **** --- 387,391 ---- break; case PORTAL_ENTITY_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%i),key->val.list.key.portal.ip_port); k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); break; Index: iSNStrcv.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNStrcv.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNStrcv.c 3 Nov 2006 20:22:29 -0000 1.3 --- iSNStrcv.c 1 Dec 2006 21:49:29 -0000 1.4 *************** *** 59,63 **** extern int sns_ready; extern int sns_comm_main_port; ! int sns_tcp_debug=1; #ifdef SNS_LINUX --- 59,63 ---- extern int sns_ready; extern int sns_comm_main_port; ! int sns_tcp_debug=0; #ifdef SNS_LINUX *************** *** 210,214 **** memcpy(&md.msg, p_msg, msg_size); ! DEBUG_1(sns_tcp_debug & 1, (TCP rcv size %d), msg_size); while (!sns_ready) { --- 210,214 ---- memcpy(&md.msg, p_msg, msg_size); ! DEBUG_1(sns_tcp_debug &1, (TCP rcv size %d), msg_size); while (!sns_ready) { |
From: Robert W. <wrw...@us...> - 2006-12-01 21:49:31
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12467/include Modified Files: iSNStypes.h Log Message: fix portal_entity_list Index: iSNStypes.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNStypes.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNStypes.h 22 Nov 2006 17:45:39 -0000 1.5 --- iSNStypes.h 1 Dec 2006 21:49:29 -0000 1.6 *************** *** 701,705 **** SOIP_Dd dd; SOIP_Node_Name node_name; ! SOIP_DB_Portal portal; } key; } SOIP_DB_List; --- 701,705 ---- SOIP_Dd dd; SOIP_Node_Name node_name; ! ENTITY_LIST_ENTRY portal; } key; } SOIP_DB_List; |
From: Robert W. <wrw...@us...> - 2006-12-01 15:35:54
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27242/isnsclient/src Modified Files: comm.c menu.c Log Message: fixes so it compiles on 64-bit Linux Index: menu.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/menu.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** menu.c 2 Apr 2002 20:56:54 -0000 1.2 --- menu.c 1 Dec 2006 15:35:17 -0000 1.3 *************** *** 111,115 **** {"Custom Register 3", 102, RegCustom3}, - {"Save DD/DDS", 200, SaveDb}, {"Toggle Hex Dump On/Off", 300, HexDumpToggle}, {"Toggle PDU Parser On/Off", 301, ParserToggle}, --- 111,114 ---- *************** *** 154,157 **** --- 153,158 ---- printf ("Item\t Menu Name\n"); printf ("----\t ---------\n"); + printf ("-1)\t exit.\n"); + printf ("0)\t Display Menu\n"); for (i = 0; i < MENU_SIZE; i++) { *************** *** 177,180 **** --- 178,183 ---- DisplayMenu (); } + else if (selection == -1) + break; else { Index: comm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/comm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comm.c 28 Nov 2006 22:00:47 -0000 1.3 --- comm.c 1 Dec 2006 15:35:17 -0000 1.4 *************** *** 580,584 **** char buffer[1048]; char rbuffer[1048]; ! LISTENER_CB_P p_cb = (LISTENER_CB_P)lparam; int ip = p_cb->ip; int port = p_cb->port; --- 580,584 ---- char buffer[1048]; char rbuffer[1048]; ! LISTENER_CB_P p_cb = (LISTENER_CB_P)&lparam; int ip = p_cb->ip; int port = p_cb->port; |
From: Robert W. <wrw...@us...> - 2006-12-01 15:35:23
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27242/isnsserver/src Modified Files: iSNSLinux.c iSNSMain.c iSNSUtil.c iSNScomm.c iSNSdb.c iSNSfsm.c iSNSipc.c iSNSparse.c Log Message: fixes so it compiles on 64-bit Linux Index: iSNSUtil.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSUtil.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSUtil.c 3 Nov 2006 20:22:29 -0000 1.7 --- iSNSUtil.c 1 Dec 2006 15:35:17 -0000 1.8 *************** *** 507,511 **** ISNSDisplay_Port_Cos (SOIP_COS *p_cos) { ! printf ("PORT COS : %08X \n", (unsigned int)p_cos); } --- 507,511 ---- ISNSDisplay_Port_Cos (SOIP_COS *p_cos) { ! printf ("PORT COS : %08X \n", *(unsigned int *)p_cos); } Index: iSNSipc.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSipc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSipc.c 3 Nov 2006 20:22:29 -0000 1.3 --- iSNSipc.c 1 Dec 2006 15:35:17 -0000 1.4 *************** *** 122,126 **** return (ERROR); ! if ((void *)ipc_ep[ep_name].s == NULL) return (ERROR); --- 122,126 ---- return (ERROR); ! if (ipc_ep[ep_name].s == 0) return (ERROR); *************** *** 161,165 **** if (!(VALID_EP_NAME (ep_name))) return (ERROR); ! if ((void *)ipc_ep[ep_name].s == NULL) return (ERROR); --- 161,165 ---- if (!(VALID_EP_NAME (ep_name))) return (ERROR); ! if (ipc_ep[ep_name].s == 0) return (ERROR); Index: iSNScomm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNScomm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNScomm.c 22 Nov 2006 21:01:52 -0000 1.4 --- iSNScomm.c 1 Dec 2006 15:35:17 -0000 1.5 *************** *** 388,391 **** --- 388,392 ---- char dot_not_addr[INET_ADDR_LEN]; + DEBUG_0 (1,ConvertPayload); SNSConvertPayloadHTON(&p_md->msg); *************** *** 403,407 **** --- 404,410 ---- p_md->msg.hdr.flags = htons(p_md->msg.hdr.flags); + DEBUG_0 (1,send); s_len = send(p_md->cb.sock.sockfd, (char *)&p_md->msg, len, 0); + DEBUG_0 (1,send); if (s_len<=0) { Index: iSNSparse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSparse.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSparse.c 3 Nov 2006 18:55:41 -0000 1.6 --- iSNSparse.c 1 Dec 2006 15:35:17 -0000 1.7 *************** *** 393,398 **** ptr = (char *) ptr + 4; default: ! while ((uint32_t) ptr < ! ((uint32_t) msg->msg.payload.payload_data + msg->msg.hdr.msg_len)) { --- 393,398 ---- ptr = (char *) ptr + 4; default: ! while ( ptr < ! (void *)(msg->msg.payload.payload_data + msg->msg.hdr.msg_len)) { *************** *** 414,418 **** // pattr->tag, pattr->tag); /* length */ ! ptr = (void *) ((uint32_t) ptr + 4); if ((pattr->len < 5000) && (pattr->len != 0)) { --- 414,418 ---- // pattr->tag, pattr->tag); /* length */ ! ptr = (void *)(ptr + 4); if ((pattr->len < 5000) && (pattr->len != 0)) { *************** *** 427,431 **** pattr->len = ntohl (pattr->len); } ! ptr = (void *) ((uint32_t) ptr + 4); switch (pattr->tag) { --- 427,431 ---- pattr->len = ntohl (pattr->len); } ! ptr = (void *)(ptr + 4); switch (pattr->tag) { *************** *** 546,551 **** } ! while ((uint32_t) ptr < ! ((uint32_t) msg->payload.payload_data + msg->hdr.msg_len)) { ISNS_Attr *pattr = (ISNS_Attr *)ptr; --- 546,551 ---- } ! while ( ptr < ! (void *)(msg->payload.payload_data + msg->hdr.msg_len)) { ISNS_Attr *pattr = (ISNS_Attr *)ptr; *************** *** 569,573 **** // } /* length */ ! ptr = (void *) ((uint32_t) ptr + 4); if (pattr->len > 5000) { --- 569,573 ---- // } /* length */ ! ptr = (void *)(ptr + 4); if (pattr->len > 5000) { *************** *** 583,587 **** pattr->len = ntohl (pattr->len); } ! ptr = (void *) ((uint32_t) ptr + 4); switch (tag) { --- 583,587 ---- pattr->len = ntohl (pattr->len); } ! ptr = (void *)(ptr + 4); switch (tag) { Index: iSNSfsm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSfsm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSfsm.c 3 Nov 2006 20:22:29 -0000 1.3 --- iSNSfsm.c 1 Dec 2006 15:35:17 -0000 1.4 *************** *** 540,544 **** /* delete any outstanding resync task */ if (tresync_pid) ! taskDelete((int)tresync_pid); inet_ntoa_b(*(struct in_addr *)SNSGetLocalAddr(), dot_not_local); --- 540,544 ---- /* delete any outstanding resync task */ if (tresync_pid) ! taskDelete((pthread_t)tresync_pid); inet_ntoa_b(*(struct in_addr *)SNSGetLocalAddr(), dot_not_local); Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** iSNSdb.c 22 Nov 2006 23:48:31 -0000 1.13 --- iSNSdb.c 1 Dec 2006 15:35:17 -0000 1.14 *************** *** 222,226 **** if (d.dptr == NULL) { ! DEBUG_1 (isns_db_debug & 1, (read failed index:%i),(int)&key->val); return (ISNS_NO_SUCH_ENTRY_ERR); } --- 222,226 ---- if (d.dptr == NULL) { ! DEBUG_1 (isns_db_debug & 1, (read failed index:%i),*(int *)&key->val); return (ISNS_NO_SUCH_ENTRY_ERR); } Index: iSNSMain.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSMain.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSMain.c 22 Nov 2006 17:45:39 -0000 1.8 --- iSNSMain.c 1 Dec 2006 15:35:17 -0000 1.9 *************** *** 40,44 **** #ifdef SNS_LINUX /* Linux */ - #define HANDLE pthread_t* #include <sched.h> #include <sys/types.h> --- 40,43 ---- *************** *** 154,158 **** void SNSCheckInitTxQueue (ISNS_Msg_Descp * p_md); ! HANDLE request_pid; DWORD request_id; --- 153,157 ---- void SNSCheckInitTxQueue (ISNS_Msg_Descp * p_md); ! int rc; DWORD request_id; *************** *** 222,227 **** /* Linux */ /*printf ("Creating thread for SNSReqTimeoutThread\n");*/ ! request_pid = (pthread_t *)pthread_create (&hdle, NULL, (void *)SNSReqTimeoutThread, NULL); ! if (request_pid != 0){ printf ("Thread creation failed.\n"); exit (-1); --- 221,226 ---- /* Linux */ /*printf ("Creating thread for SNSReqTimeoutThread\n");*/ ! rc =(int)pthread_create (&hdle, NULL, (void *)SNSReqTimeoutThread, NULL); ! if (rc != 0){ printf ("Thread creation failed.\n"); exit (-1); *************** *** 324,329 **** { SNS_WARN(SNS_BUFFER_WARN, "ProcessRequest out of buffs (size)\n", ! sizeof(ISNS_Msg_Cb) + sizeof(ISNS_Msg_Hdr) + ! p_md->msg.hdr.msg_len, 0, 0); return; } --- 323,328 ---- { SNS_WARN(SNS_BUFFER_WARN, "ProcessRequest out of buffs (size)\n", ! (int)(sizeof(ISNS_Msg_Cb) + sizeof(ISNS_Msg_Hdr) + ! p_md->msg.hdr.msg_len), 0, 0); return; } *************** *** 498,501 **** --- 497,501 ---- * Send a response back to the originator of the request */ + DEBUG_0 (isns_main_debug &16,Send response back to originator); msg->hdr.type = 0x8000 | msg_type; msg->hdr.flags = 0; *************** *** 517,520 **** --- 517,521 ---- * Send the registration response back to the client. */ + DEBUG_0 (isns_main_debug &16,Call ISNSSendMsg); ISNSSendMsg(p_md); } *************** *** 893,897 **** { SNS_WARN(SNS_BUFFER_WARN, "AttrGetList out of cb buffs (size)\n", ! sizeof (ISNS_ATTR_VALS_CB), 0, 0); } else --- 894,898 ---- { SNS_WARN(SNS_BUFFER_WARN, "AttrGetList out of cb buffs (size)\n", ! (int)sizeof (ISNS_ATTR_VALS_CB), 0, 0); } else *************** *** 927,931 **** { SNS_WARN(SNS_BUFFER_WARN, "regCallback out of buffs (size)\n", ! sizeof(ISNS_Msg_Descp), 0, 0); return; } --- 928,932 ---- { SNS_WARN(SNS_BUFFER_WARN, "regCallback out of buffs (size)\n", ! (int)sizeof(ISNS_Msg_Descp), 0, 0); return; } Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSLinux.c 22 Nov 2006 21:01:52 -0000 1.6 --- iSNSLinux.c 1 Dec 2006 15:35:17 -0000 1.7 *************** *** 93,97 **** void ! taskDelete (int task) { if (task == 0) --- 93,97 ---- void ! taskDelete (pthread_t task) { if (task == 0) *************** *** 100,104 **** if ((void *)task != NULL) { ! pthread_cancel ((pthread_t) task); } } --- 100,104 ---- if ((void *)task != NULL) { ! pthread_cancel (task); } } |
From: Robert W. <wrw...@us...> - 2006-12-01 15:35:23
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27242/isnsserver/include Modified Files: iSNSLinux.h Log Message: fixes so it compiles on 64-bit Linux Index: iSNSLinux.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSLinux.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSLinux.h 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSLinux.h 1 Dec 2006 15:35:17 -0000 1.3 *************** *** 98,102 **** void taskSuspend(void); ! void taskDelete(int task); int --- 98,102 ---- void taskSuspend(void); ! void taskDelete(pthread_t task); int |
From: Robert W. <wrw...@us...> - 2006-11-28 22:00:53
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2415 Modified Files: Makefile Log Message: upgrade make system and eliminate compile warnings Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 2 Apr 2002 20:56:53 -0000 1.2 --- Makefile 28 Nov 2006 22:00:46 -0000 1.3 *************** *** 1,27 **** ! #/*********************************************************************** ! #/ The contents of this file are subject to the Nishan Systems, Inc. Public ! #/ License Version 1.0 (the "License"); you may not use this file except in ! #/ compliance with the License included with the distribution. You may ! #/ obtain a copy of the License at www.NishanSystems.com. ! #/ ! #/ Software distributed under the License is distributed on an "AS IS" ! #/ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See ! #/ the License for the specific language governing rights and limitations ! #/ under the License. ! #/ ! #/ The Original Software is Release 1.0 of the iSNS Example Client and ! #/ Server. Portions created by Nishan Systems are Copyright 2001 Nishan ! #/ Systems, Inc. All Rights Reserved. ! #/ ! #/ This Original Software is subject to a standard specification issued ! #/ by the IETF. The Specification is titled iSNS Internet Storage Name ! #/ Service. ! #/ ! #/ The Initial Contributor of the Original Software is Nishan Systems, Inc. ! #/ Revision Contributor(s) are listed below: ! #/ ! #/ Submitted Revision Contributor Name and Date ! #/ ! #/***********************************************************************/ SHELL = /bin/sh --- 1,27 ---- ! # ! # The contents of this file are subject to the Nishan Systems, Inc. Public ! # License Version 1.0 (the "License"); you may not use this file except in ! # compliance with the License included with the distribution. You may ! # obtain a copy of the License at www.NishanSystems.com. ! # ! # Software distributed under the License is distributed on an "AS IS" ! # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See ! # the License for the specific language governing rights and limitations ! # under the License. ! # ! # The Original Software is Release 1.0 of the iSNS Example Client and ! # Server. Portions created by Nishan Systems are Copyright 2001 Nishan ! # Systems, Inc. All Rights Reserved. ! # ! # This Original Software is subject to a standard specification issued ! # by the IETF. The Specification is titled iSNS Internet Storage Name ! # Service. ! # ! # The Initial Contributor of the Original Software is Nishan Systems, Inc. ! # Revision Contributor(s) are listed below: ! # ! # Submitted Revision Contributor Name and Date ! # ! # SHELL = /bin/sh *************** *** 32,61 **** INCDIR += -I/usr/include/ ! CFLAGS += -Wall #CFLAGS += -Werror ! ! SRCS = $(SRCDIR)comm.c \ ! $(SRCDIR)custom.c \ ! $(SRCDIR)entity.c \ ! $(SRCDIR)fcnode.c \ ! $(SRCDIR)getarg.c \ ! $(SRCDIR)ifcp.c \ ! $(SRCDIR)iscsi.c \ ! $(SRCDIR)isns.c \ ! $(SRCDIR)main.c \ ! $(SRCDIR)menu.c \ ! $(SRCDIR)parse.c \ ! $(SRCDIR)portal.c \ ! $(SRCDIR)util.c CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG - CFLAGS += -DSNS_VERSION=1 ! all : $(SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o isnsc $(SRCS) ! clean : ! rm -f *.o isnsc --- 32,98 ---- INCDIR += -I/usr/include/ ! CFLAGS = -Wall #CFLAGS += -Werror ! OBJECTS = getarg.o ! OBJECTS += main.o ! OBJECTS += comm.o ! OBJECTS += entity.o ! OBJECTS += iscsi.o ! OBJECTS += parse.o ! OBJECTS += isns.o ! OBJECTS += ifcp.o ! OBJECTS += fcnode.o ! OBJECTS += custom.o ! OBJECTS += portal.o ! OBJECTS += util.o ! OBJECTS += menu.o CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG ! all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnsc $(OBJECTS) ! getarg.o : $(SRCDIR)getarg.c ! $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + main.o : $(SRCDIR)main.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + comm.o : $(SRCDIR)comm.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + menu.o : $(SRCDIR)menu.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + entity.o : $(SRCDIR)entity.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + parse.o : $(SRCDIR)parse.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + util.o : $(SRCDIR)util.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + isns.o : $(SRCDIR)isns.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + ifcp.o : $(SRCDIR)ifcp.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + fcnode.o : $(SRCDIR)fcnode.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + custom.o : $(SRCDIR)custom.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + portal.o : $(SRCDIR)portal.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + iscsi.o : $(SRCDIR)iscsi.c + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + + clean : + rm $(OBJECTS) isnsc |
From: Robert W. <wrw...@us...> - 2006-11-28 22:00:52
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2415/src Modified Files: comm.c entity.c fcnode.c ifcp.c iscsi.c isns.c parse.c portal.c util.c Log Message: upgrade make system and eliminate compile warnings Index: portal.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/portal.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** portal.c 6 Nov 2006 17:18:00 -0000 1.3 --- portal.c 28 Nov 2006 22:00:47 -0000 1.4 *************** *** 125,132 **** break; case ISNS_PORTAL_SYM_NAME: ! printf ("Portal Sym Name: %s\n", &p_attr->val); break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n", &p_attr->val); break; case ISNS_ENTITY_IDX: --- 125,132 ---- break; case ISNS_PORTAL_SYM_NAME: ! printf ("Portal Sym Name: %s\n",(char *)&p_attr->val); break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n",(char *)&p_attr->val); break; case ISNS_ENTITY_IDX: *************** *** 292,296 **** if (-1 ==GetSrc(&cmd,0)) ! return 0; --- 292,296 ---- if (-1 ==GetSrc(&cmd,0)) ! return; Index: fcnode.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/fcnode.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fcnode.c 2 Apr 2002 20:56:54 -0000 1.2 --- fcnode.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 147,151 **** break; case ISNS_NODE_SYM_NAME: ! printf ("Sym Name: %s\n", &p_attr->val); break; case ISNS_PORT_TYPE: --- 147,151 ---- break; case ISNS_NODE_SYM_NAME: ! printf ("Sym Name: %s\n",(char *)&p_attr->val); break; case ISNS_PORT_TYPE: Index: iscsi.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/iscsi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iscsi.c 25 Oct 2006 22:40:16 -0000 1.3 --- iscsi.c 28 Nov 2006 22:00:47 -0000 1.4 *************** *** 62,66 **** if (-1==GetSrc(&cmd,0)) ! return 0; if ( (rval = GetInput(cmdLine, "Entity ID", NULL, sizeof(cmdLine))) ) --- 62,66 ---- if (-1==GetSrc(&cmd,0)) ! return; if ( (rval = GetInput(cmdLine, "Entity ID", NULL, sizeof(cmdLine))) ) *************** *** 387,391 **** case ISNS_ISCSI_NODE_ID: printf ("---------------------------------\n"); ! printf ("iSCSI ID : %s\n", &p_attr->val); break; case ISNS_ISCSI_IDX: --- 387,391 ---- case ISNS_ISCSI_NODE_ID: printf ("---------------------------------\n"); ! printf ("iSCSI ID : %s\n",(char *)&p_attr->val); break; case ISNS_ISCSI_IDX: *************** *** 403,407 **** break; case ISNS_ISCSI_ALIAS: ! printf ("Alias : %s\n", &p_attr->val); break; case ISNS_DD_ID: --- 403,407 ---- break; case ISNS_ISCSI_ALIAS: ! printf ("Alias : %s\n",(char *)&p_attr->val); break; case ISNS_DD_ID: *************** *** 410,414 **** break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n", &p_attr->val); break; case ISNS_ENTITY_IDX: --- 410,414 ---- break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n",(char *)&p_attr->val); break; case ISNS_ENTITY_IDX: Index: isns.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/isns.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** isns.c 2 Apr 2002 20:56:54 -0000 1.2 --- isns.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 203,207 **** break; case ISNS_DDS_SYM_NAME: ! printf ("DDS Sym Name : %s\n", &p_attr->val); break; case ISNS_DDS_STATUS: --- 203,207 ---- break; case ISNS_DDS_SYM_NAME: ! printf ("DDS Sym Name : %s\n",(char *)&p_attr->val); break; case ISNS_DDS_STATUS: *************** *** 310,314 **** break; case ISNS_DD_SYM_NAME: ! printf ("DD Sym Name : %s\n", &p_attr->val); break; case ISNS_DDS_ID: --- 310,314 ---- break; case ISNS_DD_SYM_NAME: ! printf ("DD Sym Name : %s\n",(char *)&p_attr->val); break; case ISNS_DDS_ID: *************** *** 321,325 **** break; case ISNS_DD_ISCSI_MEMBER: ! printf ("DD iSCSI Member : %s\n", &p_attr->val); break; case ISNS_DD_IFCP_MEMBER: --- 321,325 ---- break; case ISNS_DD_ISCSI_MEMBER: ! printf ("DD iSCSI Member : %s\n",(char *)&p_attr->val); break; case ISNS_DD_IFCP_MEMBER: *************** *** 990,994 **** case ISNS_ENTITY_ID: printf ("---------------------------------\n"); ! printf ("Entity ID : %s\n", &p_attr->val); break; case ISNS_PORTAL_IP: --- 990,994 ---- case ISNS_ENTITY_ID: printf ("---------------------------------\n"); ! printf ("Entity ID : %s\n",(char *)&p_attr->val); break; case ISNS_PORTAL_IP: *************** *** 1081,1085 **** case ISNS_ENTITY_ID: case ISNS_ISCSI_NODE_ID: ! printf ("iSCSI ID : %s\n", &p_attr->val); break; case ISNS_TIMESTAMP: --- 1081,1085 ---- case ISNS_ENTITY_ID: case ISNS_ISCSI_NODE_ID: ! printf ("iSCSI ID : %s\n",(char *)&p_attr->val); break; case ISNS_TIMESTAMP: Index: util.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** util.c 2 Apr 2002 20:56:54 -0000 1.2 --- util.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 121,125 **** unsigned int two; ! ptr = srcbuffer; count = 0; while (ptr < (unsigned char *) srcbuffer + size) --- 121,125 ---- unsigned int two; ! ptr = (unsigned char *)srcbuffer; count = 0; while (ptr < (unsigned char *) srcbuffer + size) *************** *** 158,178 **** memset (two, 0, sizeof (two)); memcpy (two, cstr, 2); ! sscanf (two, "%x", &buffer[0]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 3, 2); ! sscanf (two, "%x", &buffer[1]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 6, 2); ! sscanf (two, "%x", &buffer[2]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 9, 2); ! sscanf (two, "%x", &buffer[3]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 12, 2); ! sscanf (two, "%x", &buffer[4]); } --- 158,178 ---- memset (two, 0, sizeof (two)); memcpy (two, cstr, 2); ! sscanf (two, "%x", (int *)&buffer[0]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 3, 2); ! sscanf (two, "%x", (int *)&buffer[1]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 6, 2); ! sscanf (two, "%x", (int *)&buffer[2]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 9, 2); ! sscanf (two, "%x", (int *)&buffer[3]); memset (two, 0, sizeof (two)); memcpy (two, cstr + 12, 2); ! sscanf (two, "%x", (int *)&buffer[4]); } *************** *** 206,210 **** memset (two, 0, sizeof (two)); memcpy (two, ptr, 2); ! sscanf (two, "%x", &cmdLine[count]); count++; ptr = (char *) ptr + 2; --- 206,210 ---- memset (two, 0, sizeof (two)); memcpy (two, ptr, 2); ! sscanf (two, "%x", (int *)&cmdLine[count]); count++; ptr = (char *) ptr + 2; Index: entity.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/entity.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** entity.c 6 Nov 2006 17:18:00 -0000 1.4 --- entity.c 28 Nov 2006 22:00:47 -0000 1.5 *************** *** 35,38 **** --- 35,39 ---- #include "util.h" + extern int replaceFlag; /***********************************************************************/ *************** *** 101,105 **** case ISNS_ENTITY_ID: printf ("---------------------------------\n"); ! printf ("Entity ID : %s\n", &p_attr->val); break; case ISNS_ENTITY_TYPE: --- 102,106 ---- case ISNS_ENTITY_ID: printf ("---------------------------------\n"); ! printf ("Entity ID : %s\n",(char *)&p_attr->val); break; case ISNS_ENTITY_TYPE: *************** *** 223,227 **** if (-1==GetSrc(&cmd,0)) ! return; /* Add Delimiter */ --- 224,228 ---- if (-1==GetSrc(&cmd,0)) ! return 0; /* Add Delimiter */ *************** *** 232,236 **** { ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), cmdLine, ! 0); } --- 233,237 ---- { ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), cmdLine, ! 0); } Index: parse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/parse.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** parse.c 2 Apr 2002 20:56:54 -0000 1.2 --- parse.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 251,255 **** case ISNS_DD_ISCSI_MEMBER : case ISNS_DD_IFCP_MEMBER : ! printf ("Tag: %s = \"%s\"\n", isnsTagText(attrtag), &p_attr->val); break; case ISNS_PORT_TYPE : --- 251,255 ---- case ISNS_DD_ISCSI_MEMBER : case ISNS_DD_IFCP_MEMBER : ! printf ("Tag: %s = \"%s\"\n", isnsTagText(attrtag),(char *)&p_attr->val); break; case ISNS_PORT_TYPE : *************** *** 290,294 **** printf ("Tag: %s = %08lX (%s)\n", isnsTagText(attrtag), ! type, iscsi_type_str); } break; --- 290,294 ---- printf ("Tag: %s = %08lX (%s)\n", isnsTagText(attrtag), ! (long)type, iscsi_type_str); } break; *************** *** 329,333 **** default: printf ("Tag: %s = ", isnsTagText(attrtag)); ! for (valword=&p_attr->val.etype, i = 0; (unsigned int) i<attrlen; i+=4) { printf("%08X ",ntohl(*valword++)); } --- 329,333 ---- default: printf ("Tag: %s = ", isnsTagText(attrtag)); ! for (valword=(int *)&p_attr->val.etype, i = 0; i<attrlen; i+=4) { printf("%08X ",ntohl(*valword++)); } Index: ifcp.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/ifcp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ifcp.c 2 Apr 2002 20:56:54 -0000 1.2 --- ifcp.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 66,70 **** break; case ISNS_PORT_SYM_NAME: ! printf ("Alias : %s\n", &p_attr->val); break; case ISNS_PORT_TYPE: --- 66,70 ---- break; case ISNS_PORT_SYM_NAME: ! printf ("Alias : %s\n",(char *)&p_attr->val); break; case ISNS_PORT_TYPE: *************** *** 108,112 **** break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n", &p_attr->val); break; default: --- 108,112 ---- break; case ISNS_ENTITY_ID: ! printf ("Entity ID : %s\n",(char *)&p_attr->val); break; default: Index: comm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/comm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** comm.c 2 Apr 2002 20:56:54 -0000 1.2 --- comm.c 28 Nov 2006 22:00:47 -0000 1.3 *************** *** 222,226 **** int e; int rcvSize; ! int len; if (tcpFlag) --- 222,226 ---- int e; int rcvSize; ! socklen_t len; if (tcpFlag) *************** *** 239,243 **** /* Using UDP */ len = sizeof (their_addr); ! e = recvfrom (fd, (char *)cmd, size, 0, (struct sockaddr *) &their_addr, &len); if (e < 0) --- 239,243 ---- /* Using UDP */ len = sizeof (their_addr); ! e = recvfrom (fd, (char *)cmd, size, 0, (struct sockaddr *) &their_addr,&len); if (e < 0) *************** *** 411,415 **** ISNS_CMD cmd; int e; ! int len; if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) --- 411,415 ---- ISNS_CMD cmd; int e; ! socklen_t len; if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) *************** *** 427,431 **** if (bind (fd, (struct sockaddr *) &my_addr, sizeof (my_addr)) < 0) { ! printf ("Fatal Error while Binding.\n"); return (-1); } --- 427,431 ---- if (bind (fd, (struct sockaddr *) &my_addr, sizeof (my_addr)) < 0) { ! printf ("Fatal Error while Binding using heartbeat.\n"); return (-1); } *************** *** 486,490 **** ISNS_CMD cmd; int e; ! int len; struct ip_mreq stMreq; int iRet; --- 486,490 ---- ISNS_CMD cmd; int e; ! socklen_t len; struct ip_mreq stMreq; int iRet; *************** *** 584,588 **** int port = p_cb->port; int e; ! int len; struct sockaddr_in their_addr; struct sockaddr_in my_addr; --- 584,588 ---- int port = p_cb->port; int e; ! socklen_t len; struct sockaddr_in their_addr; struct sockaddr_in my_addr; *************** *** 636,640 **** } ! printf ("RCV ESI for %s via UDP-->", &p_attr->val); DumpHex (buffer, e); --- 636,640 ---- } ! printf ("RCV ESI for %s via UDP-->",(char *)&p_attr->val); DumpHex (buffer, e); |
From: Robert W. <wrw...@us...> - 2006-11-22 23:48:35
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18650 Modified Files: Makefile Log Message: convert database to GDBM Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 3 Nov 2006 18:55:41 -0000 1.4 --- Makefile 22 Nov 2006 23:48:31 -0000 1.5 *************** *** 63,67 **** all : $(OBJECTS) ! $(CC) -lpthread -o isnss $(OBJECTS) getarg.o : $(SRCDIR)getarg.c --- 63,67 ---- all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnss $(OBJECTS) getarg.o : $(SRCDIR)getarg.c |
From: Robert W. <wrw...@us...> - 2006-11-22 23:48:34
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18650/src Modified Files: iSNSdb.c Log Message: convert database to GDBM Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** iSNSdb.c 22 Nov 2006 17:45:39 -0000 1.12 --- iSNSdb.c 22 Nov 2006 23:48:31 -0000 1.13 *************** *** 39,43 **** #include "iSNS.h" #include "iSNSdb.h" ! #include "ndb.h" #include "iSNStypes.h" #include "iSNSmsg.h" --- 39,44 ---- #include "iSNS.h" #include "iSNSdb.h" ! //#include "ndb.h" ! #include <gdbm.h> #include "iSNStypes.h" #include "iSNSmsg.h" *************** *** 47,54 **** #include "iSNSdebug.h" ! #ifndef SNS_LINUX ! extern void NTWriteToFile(int len, void *ptr); ! extern int NTReadFromFile(int *lenPtr, void *ptr); ! #endif /* Global */ --- 48,59 ---- #include "iSNSdebug.h" ! //#define ndb_store_sns(a,b,c,d) ndb_store(dbfp,b,c,d) ! ! #define ndb_fetch(a,b) gdbm_fetch(dbfp[a],b) ! #define ndb_fetch_sns(a,b,c) gdbm_fetch(dbfp[a],b); memcpy(c,d.dptr,d.dsize) ! #define ndb_store_sns(a,b,c,d) gdbm_store(dbfp[a],b,c,d) ! #define ndb_delete(a,b) gdbm_delete(dbfp[a],b) ! #define ndb_nextkey(a,b) gdbm_nextkey (dbfp[a],b) ! #define ndb_firstkey(a) gdbm_firstkey (dbfp[a]) /* Global */ *************** *** 58,67 **** * SoIP service Database file descriptor */ ! static NDB_FILE dbfp; /* * GDBM errno */ ! extern ndb_error ndb_errno; /* --- 63,73 ---- * SoIP service Database file descriptor */ ! //static NDB_FILE dbfp; ! static GDBM_FILE dbfp[25]; /* * GDBM errno */ ! //extern ndb_error ndb_errno; /* *************** *** 300,304 **** k.dptr = (char *)&key->val.dds_id; k.dsize = DDS_KEY_SIZE; ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DDS Write failed); --- 306,310 ---- k.dptr = (char *)&key->val.dds_id; k.dsize = DDS_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DDS Write failed); *************** *** 309,313 **** k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DD Write failed); --- 315,319 ---- k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,DD Write failed); *************** *** 317,321 **** k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ISCSI Write failed); --- 323,327 ---- k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ISCSI Write failed); *************** *** 325,329 **** k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ENTITY Write failed); --- 331,335 ---- k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,ENTITY Write failed); *************** *** 333,337 **** k.dptr = (char *)key->val.port_name.v; k.dsize = strlen(key->val.port_name.v); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORT_NAME Write failed); --- 339,343 ---- k.dptr = (char *)key->val.port_name.v; k.dsize = strlen(key->val.port_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORT_NAME Write failed); *************** *** 340,344 **** k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,FC NODE_NAME Write failed); --- 346,350 ---- k.dptr = (char *)key->val.node_name.v; k.dsize = strlen(key->val.node_name.v); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,FC NODE_NAME Write failed); *************** *** 347,351 **** k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_DB_Portal); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORTAL Name Write failed); --- 353,357 ---- k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_DB_Portal); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,PORTAL Name Write failed); *************** *** 356,360 **** k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_IDX_Key); ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,Index Write failed); --- 362,366 ---- k.dptr = (char *)&key->val; k.dsize = sizeof(SOIP_IDX_Key); ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,Index Write failed); *************** *** 399,403 **** break; } ! rc = ndb_store (dbfp, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,List Write failed); --- 405,409 ---- break; } ! rc = ndb_store_sns (key->tag, k, d, 0); if (rc == ERROR) DEBUG_0 (isns_db_debug &1,List Write failed); *************** *** 574,583 **** * Initialize database envirnoment and resources */ ! if ((dbfp = ndb_open(NULL, 0, 0, 0, ISNSExceptionHdlr)) == NULL) ! { ! printf("\nDatabase open error - GDBM error code: %d",ndb_errno); ! perror("\nndb_open"); ! return(ERROR); ! } ddmem=(SOIP_Dd_Member *)calloc( MAX_MEMBER_PER_DD, sizeof(SOIP_Dd_Member) ); --- 580,609 ---- * Initialize database envirnoment and resources */ ! //dbfp = ndb_open(NULL, 0, 0, 0, ISNSExceptionHdlr); ! ! dbfp[ISCSI_ID_KEY] = gdbm_open("isns1.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[ENTITY_ID_KEY] = gdbm_open("isns2.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[PORTAL_ID_KEY] = gdbm_open("isns3.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[DDS_ID_KEY] = gdbm_open("isns4.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[DD_ID_KEY] = gdbm_open("isns5.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[NODE_NAME_KEY] = gdbm_open("isns6.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[PORT_NAME_KEY] = gdbm_open("isns7.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[ESI_KEY] = gdbm_open("isns8.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[ENTITY_IDX_KEY] = gdbm_open("isns9.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[ISCSI_IDX_KEY] = gdbm_open("isns10.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[PORTAL_IDX_KEY] = gdbm_open("isns11.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ! dbfp[LIST_KEY] = gdbm_open("isns12.db",1024,GDBM_WRCREAT,0666, ! ISNSExceptionHdlr); ddmem=(SOIP_Dd_Member *)calloc( MAX_MEMBER_PER_DD, sizeof(SOIP_Dd_Member) ); *************** *** 599,603 **** ISNSdbClose(void) { ! ndb_close (dbfp); } --- 625,641 ---- ISNSdbClose(void) { ! //ndb_close (dbfp); ! gdbm_close(dbfp[ISCSI_ID_KEY]); ! gdbm_close(dbfp[ENTITY_ID_KEY]); ! gdbm_close(dbfp[PORTAL_ID_KEY]); ! gdbm_close(dbfp[DDS_ID_KEY]); ! gdbm_close(dbfp[DD_ID_KEY]); ! gdbm_close(dbfp[NODE_NAME_KEY]); ! gdbm_close(dbfp[PORT_NAME_KEY]); ! gdbm_close(dbfp[ESI_KEY]); ! gdbm_close(dbfp[ENTITY_IDX_KEY]); ! gdbm_close(dbfp[ISCSI_IDX_KEY]); ! gdbm_close(dbfp[PORTAL_IDX_KEY]); ! gdbm_close(dbfp[LIST_KEY]); } *************** *** 806,837 **** } - /******************************************************************** - ********************************************************************/ - int - ISNSInitESIList(void) - { - InitList(ESI_LIST, &esi_list); - - return (SUCCESS); - } - - /******************************************************************** - ********************************************************************/ - int - ISNSInitSCNCallbackList(void) - { - InitList(SCN_CALLBACK_LIST, &scn_callback_list); - - return (SUCCESS); - } - - /******************************************************************** - ********************************************************************/ - int - ISNSInitSCNList(void) - { - InitList(SCN_LIST, &scn_list ); - return ( SUCCESS ); - } /************************************************** **************************************************/ --- 844,847 ---- *************** *** 839,844 **** { DEBUG_0 (isns_db_debug &1, ISNSInitDBTables); ! ISNSInitESIList(); ! ISNSInitSCNList(); ! ISNSInitSCNCallbackList(); } --- 849,854 ---- { DEBUG_0 (isns_db_debug &1, ISNSInitDBTables); ! InitList(ESI_LIST, &esi_list); ! InitList(SCN_LIST, &scn_list ); ! InitList(SCN_CALLBACK_LIST, &scn_callback_list); } |
From: Robert W. <wrw...@us...> - 2006-11-22 21:02:06
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsclient Modified Files: README.txt Log Message: allow a default ip address Index: README.txt =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 2 Apr 2002 20:56:53 -0000 1.2 --- README.txt 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 75,95 **** NOTES: IP-Addresses must be in IP dotted notation. Options: ! [-i addr] IP-Address for SNSP traffic. [-b addr] Broadcast Address for SNSP traffic. ! [-l] Loads DD/DDS. ! [-u port] primary port for SNSP traffic. [-d] Full debug options on. [-?] Help. ! -i : This mandatory parameter indicates the IP-Address of the interface that will be used for the iSNS PDU's. -b : This mandatory parameter indicates the Layer 2 Broadcast IP-Address that will be used for heartbeat messages broadcast by the iSNS server. ! -l : This option loads, at startup, the stored Discovery Domains (DD's) ! and Discovery Domain Sets (DDS's) that were previously saved during ! operation. ! -u port : This option changes the primary port used for accepting iSNS registration and query PDU's. The default port used for UDP/TCP ! communication is 60000. -d : This option enables debug messages in the iSNS server. This allows the state machine and message receive / transmit to be traced --- 75,91 ---- NOTES: IP-Addresses must be in IP dotted notation. Options: ! [-a addr] IP-Address for SNSP traffic. [-b addr] Broadcast Address for SNSP traffic. ! [-p port] primary port for SNSP traffic. [-d] Full debug options on. [-?] Help. ! -a : This mandatory parameter indicates the IP-Address of the interface that will be used for the iSNS PDU's. -b : This mandatory parameter indicates the Layer 2 Broadcast IP-Address that will be used for heartbeat messages broadcast by the iSNS server. ! -p port : This option changes the primary port used for accepting iSNS registration and query PDU's. The default port used for UDP/TCP ! communication is 3205. -d : This option enables debug messages in the iSNS server. This allows the state machine and message receive / transmit to be traced *************** *** 107,113 **** Options: [-h] Listen for L2 heartbeat from an iSNS. ! [-s ip] iSNS Address. [-t] TCP mode. ! [-p port] Port used for sending. Default is port 60000. [-?] Help. --- 103,109 ---- Options: [-h] Listen for L2 heartbeat from an iSNS. ! [-a ip] iSNS Address. [-t] TCP mode. ! [-p port] Port used for sending. Default is port 3205. [-?] Help. *************** *** 121,125 **** networks. It does not work if the iSNS server is running on the same host as the client. ! -s ip : This option allows for static iSNS server configuration for the client. -t : This option specifies that a TCP connection shall be used for --- 117,121 ---- networks. It does not work if the iSNS server is running on the same host as the client. ! -a ip : This option allows for static iSNS server configuration for the client. -t : This option specifies that a TCP connection shall be used for *************** *** 127,131 **** communication is supported simultaneously. -p port : This option changes the primary port used for iSNS registration ! and query PDU's. The default port used for UDP/TCP communication is 60000. -? : This option prints the above message. _____________________ --- 123,127 ---- communication is supported simultaneously. -p port : This option changes the primary port used for iSNS registration ! and query PDU's. The default port used for UDP/TCP communication is 3205. -? : This option prints the above message. _____________________ *************** *** 210,217 **** 3) Launch the server ! >isnss -i 192.100.100.116 -b 192.100.100.255 4) Launch the client and use TCP for communication ! >isnsc -s 192.100.100.116 -t Or, to demonstrate the autodetection of the server in a layer 2 network, enter --- 206,213 ---- 3) Launch the server ! >isnss -a 192.100.100.116 -b 192.100.100.255 4) Launch the client and use TCP for communication ! >isnsc -a 192.100.100.116 -t Or, to demonstrate the autodetection of the server in a layer 2 network, enter *************** *** 238,242 **** The CLIENT command line options (on the same PC as the server) were: ! C:\ISNS\iSNSclient>isnsc -t -s 192.100.100.116 IETF iSNS Client, v1.1. Connecting to 192.100.100.116... --- 234,238 ---- The CLIENT command line options (on the same PC as the server) were: ! C:\ISNS\iSNSclient>isnsc -t -a 192.100.100.116 IETF iSNS Client, v1.1. Connecting to 192.100.100.116... *************** *** 1598,1600 **** --- 1594,1597 ---- Please select an option (0 for Help): + End of Steps <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
From: Robert W. <wrw...@us...> - 2006-11-22 21:02:00
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsserver/include Modified Files: iSNScomm.h Log Message: allow a default ip address Index: iSNScomm.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNScomm.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNScomm.h 2 Apr 2002 20:56:54 -0000 1.2 --- iSNScomm.h 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 55,61 **** */ #define SNS_SCGRP_IPMC_ADDR "255.255.255.255" ! #define SNS_UDP_PORT 60000 ! #define SNS_MC_UDP_PORT 60001 #define SNS_LAYER_2 1 --- 55,62 ---- */ #define SNS_SCGRP_IPMC_ADDR "255.255.255.255" + #define SNS_BROADCAST_ADDR "255.255.255.255" ! #define SNS_UDP_PORT 3205 ! #define SNS_MC_UDP_PORT 3206 #define SNS_LAYER_2 1 |
From: Robert W. <wrw...@us...> - 2006-11-22 21:01:59
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsserver/src Modified Files: iSNSLinux.c iSNScomm.c iSNSnt.c Log Message: allow a default ip address Index: iSNScomm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNScomm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNScomm.c 3 Nov 2006 20:22:29 -0000 1.3 --- iSNScomm.c 22 Nov 2006 21:01:52 -0000 1.4 *************** *** 37,61 **** #include "iSNSmsg.h" #include "iSNSparse.h" - #include "iSNSdebug.h" int sns_comm_debug = 0; int sns_comm_msg_filter = 0; ! #define SNSifAddrGet(a, b) ifAddrGet(a,b) ! ! ! ! char snsp_ip[16]; ! char snsp_bip[16]; int snsp_port; ! char sns_if_name[10] = {SNS_IF_NAME}; int ifAddrGet(char *ifname, char *ip) { ! if (strcmp(ifname, sns_if_name) == 0) { strcpy(ip, snsp_ip); } else ! printf("unknown interface\n"); return(SUCCESS); --- 37,61 ---- #include "iSNSmsg.h" #include "iSNSparse.h" #include "iSNSdebug.h" + int sns_comm_debug = 0; int sns_comm_msg_filter = 0; ! char snsp_ip[16]=""; ! char snsp_bip[16]=SNS_BROADCAST_ADDR; int snsp_port; ! char sns_if_name[10] = {SNS_IF_NAME}; int ifAddrGet(char *ifname, char *ip) { ! //if (strcmp(ifname, sns_if_name) == 0) { ! if (strlen (snsp_ip) != 0) { strcpy(ip, snsp_ip); } else ! { ! //printf("unknown interface\n"); ! return (ERROR); ! } return(SUCCESS); *************** *** 163,173 **** } - /* Allow reuse of addresses */ #ifdef SNS_LINUX ! if (setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) != 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif --- 163,173 ---- } #ifdef SNS_LINUX ! /* Allow reuse of addresses */ ! if (setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) != 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif *************** *** 178,188 **** } - /* Allow reuse of addresses */ #ifdef SNS_LINUX ! if (setsockopt (mc_sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) != 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif --- 178,188 ---- } #ifdef SNS_LINUX ! /* Allow reuse of addresses */ ! if (setsockopt (mc_sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) != 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif *************** *** 199,216 **** mc_sock.sin_port = htons ((short)sns_comm_mcast_port); - #ifdef GENERIC_NIC local_sock.sin_addr.s_addr = SNSGetIfAddr(); - #else - SNSifAddrGet(sns_if_name, ip_addr); - local_sock.sin_addr.s_addr = inet_addr(ip_addr); - #endif - /* Allow reuse of addresses */ #ifdef SNS_LINUX ! if (setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) < 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif --- 199,211 ---- mc_sock.sin_port = htons ((short)sns_comm_mcast_port); local_sock.sin_addr.s_addr = SNSGetIfAddr(); #ifdef SNS_LINUX ! /* Allow reuse of addresses */ ! if (setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, ¬_needed, sizeof(not_needed)) < 0) ! { ! perror ("Reuse address"); ! return (-1); ! } #endif *************** *** 745,752 **** char ip_addr[16]; ! if (SNSifAddrGet(sns_if_name, ip_addr) == ERROR) ! return(htonl(INADDR_ANY)); else ! return(htonl(inet_addr(ip_addr))); } --- 740,747 ---- char ip_addr[16]; ! if (ifAddrGet(sns_if_name, ip_addr) == ERROR) ! return(INADDR_ANY); else ! return(inet_addr(ip_addr)); } Index: iSNSnt.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSnt.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSnt.c 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSnt.c 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 152,159 **** NOTES: IP-Addresses must be in IP dotted notation.\n\ Options:\n\ ! [-i addr] IP-Address for SNSP traffic.\n\ [-b addr] Broadcast Address for SNSP traffic.\n\ ! [-l] Loads DD/DDS.\n\ ! [-u port] primary port for SNSP traffic.\n\ [-d] Full debug options on.\n\ [-?] Help.\n\ --- 152,158 ---- NOTES: IP-Addresses must be in IP dotted notation.\n\ Options:\n\ ! [-a addr] IP-Address for SNSP traffic.\n\ [-b addr] Broadcast Address for SNSP traffic.\n\ ! [-p port] primary port for SNSP traffic.\n\ [-d] Full debug options on.\n\ [-?] Help.\n\ *************** *** 174,178 **** memset (snsp_ip, 0, sizeof (snsp_ip)); - memset (snsp_bip, 0, sizeof (snsp_bip)); if (argc < 3) --- 173,176 ---- *************** *** 185,189 **** while (optind != argc) { ! c = getopt (argc, argv, "ldi:b:u:c:"); switch (c) --- 183,187 ---- while (optind != argc) { ! c = getopt (argc, argv, "da:b:p:c:"); switch (c) *************** *** 194,202 **** break; ! case 'l': ! loadFlag = TRUE; ! break; ! ! case 'i': strcpy (snsp_ip, optarg); break; --- 192,196 ---- break; ! case 'a': strcpy (snsp_ip, optarg); break; *************** *** 210,214 **** break; ! case 'u': sns_comm_main_port_set = atoi (optarg); break; --- 204,208 ---- break; ! case 'p': sns_comm_main_port_set = atoi (optarg); break; *************** *** 218,224 **** break; - case 'p': - break; - case '?': default: --- 212,215 ---- *************** *** 228,232 **** } ! if (strlen (snsp_ip) == 0 || strlen (snsp_bip) == 0) { fprintf (stderr, Usage); --- 219,223 ---- } ! if (strlen (snsp_ip) == 0 ) { fprintf (stderr, Usage); Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNSLinux.c 31 Oct 2006 19:00:17 -0000 1.5 --- iSNSLinux.c 22 Nov 2006 21:01:52 -0000 1.6 *************** *** 132,139 **** NOTES: IP-Addresses must be in IP dotted notation.\n\ Options:\n\ ! [-i addr] IP-Address for SNSP traffic.\n\ [-b addr] Broadcast Address for SNSP traffic.\n\ ! [-l] Loads DD/DDS.\n\ ! [-u port] primary port for SNSP traffic.\n\ [-d] Full debug options on.\n\ [-?] Help.\n"; --- 132,138 ---- NOTES: IP-Addresses must be in IP dotted notation.\n\ Options:\n\ ! [-a addr] IP-Address for SNSP traffic.\n\ [-b addr] Broadcast Address for SNSP traffic.\n\ ! [-p port] primary port for SNSP traffic.\n\ [-d] Full debug options on.\n\ [-?] Help.\n"; *************** *** 148,164 **** ISNS_Entity role = ISNS_SECONDARY_SERVER; - memset (snsp_ip, 0, sizeof (snsp_ip)); - memset (snsp_bip, 0, sizeof (snsp_bip)); - - if (argc < 3) - { - fprintf (stderr, Usage); - exit (0); - } - /* Don't forget to init the rest */ while (optind != argc) { ! c = getopt (argc, argv, "ldi:b:u:c:"); switch (c) --- 147,154 ---- ISNS_Entity role = ISNS_SECONDARY_SERVER; /* Don't forget to init the rest */ while (optind != argc) { ! c = getopt (argc, argv, "da:b:p:c:"); switch (c) *************** *** 169,177 **** break; ! case 'l': ! loadFlag = TRUE; ! break; ! ! case 'i': strcpy (snsp_ip, optarg); break; --- 159,163 ---- break; ! case 'a': strcpy (snsp_ip, optarg); break; *************** *** 185,189 **** break; ! case 'u': sns_comm_main_port_set = atoi (optarg); break; --- 171,175 ---- break; ! case 'p': sns_comm_main_port_set = atoi (optarg); break; *************** *** 193,199 **** break; - case 'p': - break; - case '?': default: --- 179,182 ---- *************** *** 203,213 **** } - if (strlen (snsp_ip) == 0 || strlen (snsp_bip) == 0) - { - fprintf (stderr, Usage); - exit (0); - } - - pauseFlag = FALSE; --- 186,189 ---- |
From: Robert W. <wrw...@us...> - 2006-11-22 21:01:58
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsserver Modified Files: README.txt Log Message: allow a default ip address Index: README.txt =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 2 Apr 2002 20:56:54 -0000 1.2 --- README.txt 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 75,95 **** NOTES: IP-Addresses must be in IP dotted notation. Options: ! [-i addr] IP-Address for SNSP traffic. [-b addr] Broadcast Address for SNSP traffic. ! [-l] Loads DD/DDS. ! [-u port] primary port for SNSP traffic. [-d] Full debug options on. [-?] Help. ! -i : This mandatory parameter indicates the IP-Address of the interface that will be used for the iSNS PDU's. -b : This mandatory parameter indicates the Layer 2 Broadcast IP-Address that will be used for heartbeat messages broadcast by the iSNS server. ! -l : This option loads, at startup, the stored Discovery Domains (DD's) ! and Discovery Domain Sets (DDS's) that were previously saved during ! operation. ! -u port : This option changes the primary port used for accepting iSNS registration and query PDU's. The default port used for UDP/TCP ! communication is 60000. -d : This option enables debug messages in the iSNS server. This allows the state machine and message receive / transmit to be traced --- 75,91 ---- NOTES: IP-Addresses must be in IP dotted notation. Options: ! [-a addr] IP-Address for SNSP traffic. [-b addr] Broadcast Address for SNSP traffic. ! [-p port] primary port for SNSP traffic. [-d] Full debug options on. [-?] Help. ! -a : This mandatory parameter indicates the IP-Address of the interface that will be used for the iSNS PDU's. -b : This mandatory parameter indicates the Layer 2 Broadcast IP-Address that will be used for heartbeat messages broadcast by the iSNS server. ! -p port : This option changes the primary port used for accepting iSNS registration and query PDU's. The default port used for UDP/TCP ! communication is 3205. -d : This option enables debug messages in the iSNS server. This allows the state machine and message receive / transmit to be traced *************** *** 107,113 **** Options: [-h] Listen for L2 heartbeat from an iSNS. ! [-s ip] iSNS Address. [-t] TCP mode. ! [-p port] Port used for sending. Default is port 60000. [-?] Help. --- 103,109 ---- Options: [-h] Listen for L2 heartbeat from an iSNS. ! [-a ip] iSNS Address. [-t] TCP mode. ! [-p port] Port used for sending. Default is port 3205. [-?] Help. *************** *** 121,125 **** networks. It does not work if the iSNS server is running on the same host as the client. ! -s ip : This option allows for static iSNS server configuration for the client. -t : This option specifies that a TCP connection shall be used for --- 117,121 ---- networks. It does not work if the iSNS server is running on the same host as the client. ! -a ip : This option allows for static iSNS server configuration for the client. -t : This option specifies that a TCP connection shall be used for *************** *** 127,131 **** communication is supported simultaneously. -p port : This option changes the primary port used for iSNS registration ! and query PDU's. The default port used for UDP/TCP communication is 60000. -? : This option prints the above message. _____________________ --- 123,127 ---- communication is supported simultaneously. -p port : This option changes the primary port used for iSNS registration ! and query PDU's. The default port used for UDP/TCP communication is 3205. -? : This option prints the above message. _____________________ *************** *** 210,217 **** 3) Launch the server ! >isnss -i 192.100.100.116 -b 192.100.100.255 4) Launch the client and use TCP for communication ! >isnsc -s 192.100.100.116 -t Or, to demonstrate the autodetection of the server in a layer 2 network, enter --- 206,213 ---- 3) Launch the server ! >isnss -a 192.100.100.116 -b 192.100.100.255 4) Launch the client and use TCP for communication ! >isnsc -a 192.100.100.116 -t Or, to demonstrate the autodetection of the server in a layer 2 network, enter *************** *** 238,242 **** The CLIENT command line options (on the same PC as the server) were: ! C:\ISNS\iSNSclient>isnsc -t -s 192.100.100.116 IETF iSNS Client, v1.1. Connecting to 192.100.100.116... --- 234,238 ---- The CLIENT command line options (on the same PC as the server) were: ! C:\ISNS\iSNSclient>isnsc -t -a 192.100.100.116 IETF iSNS Client, v1.1. Connecting to 192.100.100.116... *************** *** 1598,1600 **** --- 1594,1597 ---- Please select an option (0 for Help): + End of Steps <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
From: Robert W. <wrw...@us...> - 2006-11-22 21:01:57
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsclient/include Modified Files: isns.h Log Message: allow a default ip address Index: isns.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/include/isns.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** isns.h 2 Apr 2002 20:56:54 -0000 1.2 --- isns.h 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 201,206 **** #define MAX_SEND (1024*1024) ! #define ISNS_SERVER_PORT (60000) ! #define ISNS_HEARTBEAT_PORT (60001) /* This should be a string */ --- 201,206 ---- #define MAX_SEND (1024*1024) ! #define ISNS_SERVER_PORT (3205) ! #define ISNS_HEARTBEAT_PORT (3206) /* This should be a string */ |
From: Robert W. <wrw...@us...> - 2006-11-22 21:01:57
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15087/isnsclient/src Modified Files: main.c Log Message: allow a default ip address Index: main.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.c 2 Apr 2002 20:56:54 -0000 1.2 --- main.c 22 Nov 2006 21:01:52 -0000 1.3 *************** *** 74,80 **** Options:\n\ [-h] Listen for L2 heartbeat from an iSNS.\n\ ! [-s ip] iSNS Address.\n\ [-t] TCP mode.\n\ ! [-p port] Port used for sending. Default is port 60000.\n\ [-?] Help.\n\ \n\ --- 74,80 ---- Options:\n\ [-h] Listen for L2 heartbeat from an iSNS.\n\ ! [-a ip] iSNS Address.\n\ [-t] TCP mode.\n\ ! [-p port] Port used for sending. Default is port 3205.\n\ [-?] Help.\n\ \n\ *************** *** 115,119 **** while (optind != argc) { ! c = getopt (argc, argv, "htd:p:s:m:"); switch (c) --- 115,119 ---- while (optind != argc) { ! c = getopt (argc, argv, "htd:p:a:m:"); switch (c) *************** *** 135,139 **** break; ! case 's': strcpy (p_ip, optarg); break; --- 135,139 ---- break; ! case 'a': strcpy (p_ip, optarg); break; |
From: Robert W. <wrw...@us...> - 2006-11-22 17:46:36
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31703/src Modified Files: iSNSList.c iSNSMain.c iSNSdb.c iSNSdereg.c iSNSreg.c Log Message: Add database support for the list structure Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSreg.c 6 Nov 2006 18:04:38 -0000 1.4 --- iSNSreg.c 22 Nov 2006 17:45:39 -0000 1.5 *************** *** 395,399 **** } ! DEBUG_0 (isns_db_debug &1,create new protal entry); /* Create new entry */ if ( rval != SUCCESS ) --- 395,399 ---- } ! DEBUG_0 (isns_db_debug &1,create new portal entry); /* Create new entry */ if ( rval != SUCCESS ) *************** *** 427,431 **** rval = ISNSdbWrite(&idx_key,entry3); ! InitList(&p_portal->entity_list); /* Update Entity's portal Bitmap */ eidKeyIndex = ISNSFindTag (0, ISNS_ENTITY_ID, key_indx); --- 427,431 ---- rval = ISNSdbWrite(&idx_key,entry3); ! InitList(PORTAL_ENTITY_LIST, p_portal); /* Update Entity's portal Bitmap */ eidKeyIndex = ISNSFindTag (0, ISNS_ENTITY_ID, key_indx); *************** *** 470,474 **** foundFlag = FALSE; pnode = NULL; ! DEBUG_0 (isns_db_debug &1,(Find iportal_list in in entity)); while ((pnode=GetNextNode(&p_entity->iportal_list, pnode))) { --- 470,474 ---- foundFlag = FALSE; pnode = NULL; ! DEBUG_0 (isns_db_debug &1,(Find iportal_list in entity)); while ((pnode=GetNextNode(&p_entity->iportal_list, pnode))) { *************** *** 905,909 **** } ! InitList(&p_dds->dd_list); newRegFlag = TRUE; --- 905,909 ---- } ! InitList(DDS_DD_LIST, p_dds); newRegFlag = TRUE; *************** *** 911,925 **** } - if ( entry.data_type != DDS_ID_KEY ) - { - DEBUG_2 (isns_db_debug & 1, (database key does not match %u %u), - entry.data_type, DDS_ID_KEY); - - if (newRegFlag) - DeleteList(&p_dds->dd_list); - - return ISNS_UNKNOWN_ERR; - } - new_scn_bitmap = 0; newMemberFlag = FALSE; --- 911,914 ---- *************** *** 932,935 **** --- 921,926 ---- status_changed_flag = FALSE; + DEBUG_0 (isns_db_debug &1,Process the message attributes); + for (ii = saveIndex; (ii < SNS_MAX_ATTRS) && (attr_indx[ii]) && !stopFlag; ii++) *************** *** 1240,1249 **** } ! InitList( &p_dd->dds_list ); ! InitList( &p_dd->member_list ); newRegFlag = TRUE; } /* Prep the SCN message */ updateFlag = FALSE; --- 1231,1243 ---- } ! InitList(DD_DDS_LIST, p_dd ); ! InitList(DD_MEMBER_LIST, p_dd ); newRegFlag = TRUE; } + DEBUG_1 (isns_db_debug &1, p_dd dds_dds_list id:%i,p_dd->dds_list.list_id); + DEBUG_1 (isns_db_debug &1, p_dd member_list id:%i,p_dd->member_list.list_id); + /* Prep the SCN message */ updateFlag = FALSE; *************** *** 1354,1357 **** --- 1348,1352 ---- /* Store Entry */ /* ISNSDisplay_DD ( p_dd, HI_DETAIL ); */ + DEBUG_1 (isns_db_debug &1, now write dd record dds_list id:%i,entry.data.dd.dds_list.list_id); add_key.tag = DD_ID_KEY; add_key.val.dd_id = dd_key.id; *************** *** 1381,1384 **** --- 1376,1380 ---- break; } + return (ISNS_NO_ERR); } *************** *** 1565,1571 **** strncpy (p_entity->eid.id, db_entity_id.id, sizeof(p_entity->eid.id) ); ! InitList(&p_entity->iportal_list); ! InitList(&p_entity->iscsi_node_list); ! InitList(&p_entity->ifcp_node_list); if ( ISNSFindTag (0, ISNS_ENTITY_TYPE, attr_indx) == -1 ) --- 1561,1567 ---- strncpy (p_entity->eid.id, db_entity_id.id, sizeof(p_entity->eid.id) ); ! InitList(ENTITY_PORTAL_LIST, p_entity); ! InitList(ENTITY_ISCSI_LIST, p_entity); ! InitList(ENTITY_FCP_LIST, p_entity); if ( ISNSFindTag (0, ISNS_ENTITY_TYPE, attr_indx) == -1 ) *************** *** 1586,1595 **** p_entity->timestamp.t_time = time (&t); ! if ( entry.data_type != ENTITY_ID_KEY ) ! { ! DEBUG_2 (isns_db_debug & 1, (database key does not match %u %u), ! entry.data_type, ENTITY_ID_KEY); ! return ( ISNS_UNKNOWN_ERR ); ! } updateFlag = FALSE; --- 1582,1586 ---- p_entity->timestamp.t_time = time (&t); ! DEBUG_1 (isns_db_debug &1,nodecount:%i,p_entity->iscsi_node_list.node_count); updateFlag = FALSE; *************** *** 1776,1780 **** memcpy ((char *) entry.data.node.node_name.v, (char *) db_node_name.v, ISNS_NODE_NAME_SIZE); ! InitList(&p_node->port_list); newKeyFlag = TRUE; --- 1767,1771 ---- memcpy ((char *) entry.data.node.node_name.v, (char *) db_node_name.v, ISNS_NODE_NAME_SIZE); ! InitList(FCP_PORTAL_LIST, p_node); newKeyFlag = TRUE; *************** *** 2004,2008 **** (char *) p_wwpn, PORT_NAME_SIZE); memcpy (p_ifcp_node->entity_id.id, entity_id, entity_len); ! InitList(&p_ifcp_node->dd_id_list); /* Search for free port */ --- 1995,1999 ---- (char *) p_wwpn, PORT_NAME_SIZE); memcpy (p_ifcp_node->entity_id.id, entity_id, entity_len); ! InitList(FCP_DD_LIST, &p_ifcp_node->dd_id_list); /* Search for free port */ *************** *** 2352,2356 **** rval = ISNSdbWrite(&idx_key,entry3); strncpy ( p_node->entity_id.id, db_entity.id, sizeof(p_node->entity_id.id) ); ! InitList( &p_node->dd_id_list ); /* Setup for an entity fetch */ --- 2343,2347 ---- rval = ISNSdbWrite(&idx_key,entry3); strncpy ( p_node->entity_id.id, db_entity.id, sizeof(p_node->entity_id.id) ); ! InitList(ISCSI_DD_LIST, p_node ); /* Setup for an entity fetch */ *************** *** 2374,2377 **** --- 2365,2370 ---- } + DEBUG_1 (isns_db_debug &1,iscsi_node_count:%i,p_entity->iscsi_node_list.node_count); + /* Insert into iscsi_node_list */ if (!FindNode( &p_entity->iscsi_node_list, p_node->id.v, PAD4(strlen (p_node->id.v)) )) *************** *** 2890,2893 **** --- 2883,2888 ---- int rval; + DEBUG_0 (isns_db_debug &1, Add_dds_to_dd ); + scnFlag = FALSE; dd_key.id = dd_id; *************** *** 3065,3068 **** --- 3060,3065 ---- int foundFlag; + DEBUG_0 (isns_db_debug &1,ISNSAddSCNEntry); + memset( &new_entry, 0, sizeof( new_entry ) ); new_entry.type = type; *************** *** 3115,3118 **** --- 3112,3116 ---- } + DEBUG_0 (isns_db_debug &1,ISNSAddSCNEntry return); return ( SUCCESS ); } Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** iSNSdb.c 6 Nov 2006 18:04:38 -0000 1.11 --- iSNSdb.c 22 Nov 2006 17:45:39 -0000 1.12 *************** *** 109,112 **** --- 109,113 ---- { case DDS_ID_KEY: + DEBUG_1 (isns_db_debug & 1,(read DDS %i),key->val.dds_id); k.dptr = (char *)&key->val.dds_id; k.dsize = DDS_KEY_SIZE; *************** *** 119,124 **** --- 120,127 ---- if (entry->data_type != DDS_ID_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.dds.dd_list.p_entry = &entry->data.dds; break; case DD_ID_KEY: + DEBUG_1 (isns_db_debug & 1,(read DD %i),key->val.dd_id); k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; *************** *** 129,134 **** return (ISNS_NO_SUCH_ENTRY_ERR); } ! if (entry->data_type != DDS_ID_KEY) return (ISNS_UNKNOWN_ERR); break; case ISCSI_ID_KEY: --- 132,141 ---- return (ISNS_NO_SUCH_ENTRY_ERR); } ! if (entry->data_type != DD_ID_KEY) return (ISNS_UNKNOWN_ERR); + + entry->data.dd.member_list.p_entry = &entry->data.dd; + entry->data.dd.dds_list.p_entry = &entry->data.dd; + DEBUG_1 (isns_db_debug &1,read dd - dds list_id:%i,entry->data.dd.dds_list.list_id); break; case ISCSI_ID_KEY: *************** *** 144,150 **** if (entry->data_type != ISCSI_ID_KEY) return (ISNS_UNKNOWN_ERR); break; case ENTITY_ID_KEY: ! //DEBUG_1 (isns_db_debug & 1,(read ENTITY node %s),key->val.entity_id.id); k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); --- 151,158 ---- if (entry->data_type != ISCSI_ID_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.scsi_node.dd_id_list.p_entry = &entry->data.scsi_node; break; case ENTITY_ID_KEY: ! DEBUG_1 (isns_db_debug & 1,(read ENTITY node %s),key->val.entity_id.id); k.dptr = (char *)key->val.entity_key.id; k.dsize = strlen(key->val.entity_key.id); *************** *** 157,160 **** --- 165,171 ---- if (entry->data_type != ENTITY_ID_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.entity.iportal_list.p_entry = &entry->data.entity; + entry->data.entity.iscsi_node_list.p_entry = &entry->data.entity; + entry->data.entity.ifcp_node_list.p_entry = &entry->data.entity; break; case PORT_NAME_KEY: *************** *** 169,172 **** --- 180,184 ---- if (entry->data_type != PORT_NAME_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.port.dd_id_list.p_entry = &entry->data.port; break; case NODE_NAME_KEY: *************** *** 181,184 **** --- 193,197 ---- if (entry->data_type != NODE_NAME_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.node.port_list.p_entry = &entry->data.node; break; case PORTAL_ID_KEY: *************** *** 193,196 **** --- 206,210 ---- if (entry->data_type != PORTAL_ID_KEY) return (ISNS_UNKNOWN_ERR); + entry->data.portal.entity_list.p_entry = &entry->data.portal; break; case ENTITY_IDX_KEY: *************** *** 208,215 **** --- 222,280 ---- return (ISNS_UNKNOWN_ERR); break; + case LIST_KEY: + DEBUG_1 (isns_db_debug & 1,(read List %i),key->val.list.list_id); + k.dptr = (char *)&key->val; + switch (key->val.list.list_id) + { + case ENTITY_ISCSI_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_FCP_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_PORTAL_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case PORTAL_ENTITY_LIST: + k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); + break; + case ISCSI_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_PORTAL_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case DD_MEMBER_LIST: + case DD_DDS_LIST: + case DDS_DD_LIST: + k.dsize = 4 + LIST_KEY_SIZE; + break; + case ESI_LIST: + case SCN_LIST: + case SCN_CALLBACK_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + } + d = ndb_fetch_sns (key->tag, k, (char *)entry); + if (d.dptr == NULL) + { + DEBUG_1 (isns_db_debug & 1, (read failed list:%s),(char *)&key->val.list.key.entity_id.id); + return (ISNS_NO_SUCH_ENTRY_ERR); + } + if (entry->data_type != key->tag) + return (ISNS_UNKNOWN_ERR); + break; default: + DEBUG_0 (isns_db_debug &1,undefined database key); return ERROR; break; } + return SUCCESS; *************** *** 241,244 **** --- 306,310 ---- case DD_ID_KEY: DEBUG_1 (isns_db_debug &1,(Write DD Entry:%i),key->val.dd_id); + DEBUG_1 (isns_db_debug &1,write dd - dds list_id:%i,entry.data.dd.dds_list.list_id); k.dptr = (char *)&key->val.dd_id; k.dsize = DD_KEY_SIZE; *************** *** 294,297 **** --- 360,409 ---- DEBUG_0 (isns_db_debug &1,Index Write failed); break; + case LIST_KEY: + k.dptr = (char *)&key->val; + switch (key->val.list.list_id) + { + case ENTITY_ISCSI_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_FCP_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_PORTAL_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case PORTAL_ENTITY_LIST: + k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); + break; + case ISCSI_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_PORTAL_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case DD_MEMBER_LIST: + case DD_DDS_LIST: + case DDS_DD_LIST: + k.dsize = 4 + LIST_KEY_SIZE; + break; + case ESI_LIST: + case SCN_LIST: + case SCN_CALLBACK_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + } + rc = ndb_store (dbfp, k, d, 0); + if (rc == ERROR) + DEBUG_0 (isns_db_debug &1,List Write failed); + break; + default: + DEBUG_0 (isns_db_debug &1,Undefined database); + break; } return SUCCESS; *************** *** 372,375 **** --- 484,533 ---- DEBUG_0 (isns_db_debug &1, Index Delete failed); break; + case LIST_KEY: + k.dptr = (char *)&key->val; + switch (key->val.list.list_id) + { + case ENTITY_ISCSI_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_FCP_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case ENTITY_PORTAL_LIST: + DEBUG_1 (isns_db_debug & 1, (write list:%s),(char *)&key->val.list.key.entity_id.id); + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.entity_id.id); + break; + case PORTAL_ENTITY_LIST: + k.dsize = LIST_KEY_SIZE + sizeof(SOIP_DB_Portal); + break; + case ISCSI_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_PORTAL_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case FCP_DD_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + case DD_MEMBER_LIST: + case DD_DDS_LIST: + case DDS_DD_LIST: + k.dsize = 4 + LIST_KEY_SIZE; + break; + case ESI_LIST: + case SCN_LIST: + case SCN_CALLBACK_LIST: + k.dsize = LIST_KEY_SIZE + strlen(key->val.list.key.node_name.v); + break; + } + rc = ndb_delete (key->tag, k); + if (rc == ERROR) + DEBUG_0 (isns_db_debug &1, List Delete failed); + break; + default: + DEBUG_1 (isns_db_debug &1, Undefined Delete:%i,key->tag); + break; } return SUCCESS; *************** *** 653,657 **** ISNSInitESIList(void) { ! InitList(&esi_list); return (SUCCESS); --- 811,815 ---- ISNSInitESIList(void) { ! InitList(ESI_LIST, &esi_list); return (SUCCESS); *************** *** 663,667 **** ISNSInitSCNCallbackList(void) { ! InitList(&scn_callback_list); return (SUCCESS); --- 821,825 ---- ISNSInitSCNCallbackList(void) { ! InitList(SCN_CALLBACK_LIST, &scn_callback_list); return (SUCCESS); *************** *** 673,677 **** ISNSInitSCNList(void) { ! InitList( &scn_list ); return ( SUCCESS ); } --- 831,835 ---- ISNSInitSCNList(void) { ! InitList(SCN_LIST, &scn_list ); return ( SUCCESS ); } *************** *** 680,686 **** void ISNSInitDBTables(void) { ISNSInitESIList(); ISNSInitSCNList(); ISNSInitSCNCallbackList(); } - --- 838,844 ---- void ISNSInitDBTables(void) { + DEBUG_0 (isns_db_debug &1, ISNSInitDBTables); ISNSInitESIList(); ISNSInitSCNList(); ISNSInitSCNCallbackList(); } Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSdereg.c 6 Nov 2006 18:04:38 -0000 1.4 --- iSNSdereg.c 22 Nov 2006 17:45:39 -0000 1.5 *************** *** 679,693 **** } DeleteList( &p_entity->iportal_list ); - ISNS_Key key; - key.tag = ENTITY_ID_KEY; - strcpy(key.val.entity_id.id,db_entity_id.id); - rval = ISNSdbWrite(&key,entry); - /* Remove nodes */ if ( p_entity->eid_type == ENTITY_TYPE_IFCP ) { /* Remove IFCP Nodes */ while ((pnode = GetNextNode(&p_entity->ifcp_node_list, NULL /* head of list */))) { --- 679,690 ---- } + DEBUG_0 (isns_db_debug &1,Remove iportal_list); DeleteList( &p_entity->iportal_list ); /* Remove nodes */ if ( p_entity->eid_type == ENTITY_TYPE_IFCP ) { /* Remove IFCP Nodes */ + DEBUG_0 (isns_db_debug &1,Remove ifcp_node_list); while ((pnode = GetNextNode(&p_entity->ifcp_node_list, NULL /* head of list */))) { *************** *** 700,706 **** else if (p_entity->eid_type == ENTITY_TYPE_ISCSI) { ! /* Remove ISCSI Nodes */ ! while ((pnode = GetNextNode(&p_entity->iscsi_node_list, NULL /* head of list */))) { rval = SNSRemoveISCSINodeEntry (GetNodeData(pnode), NULL, --- 697,706 ---- else if (p_entity->eid_type == ENTITY_TYPE_ISCSI) { ! /* Remove ISCSI Nodes */ ! DEBUG_0 (isns_db_debug &1,Remove iscsi_node_list); ! pnode = NULL; ! while ((pnode = GetNextNode(&p_entity->iscsi_node_list, pnode /* head of list */))) { + DEBUG_0 (isns_db_debug &1, Call SNSRemoveISCSINodeEntry); rval = SNSRemoveISCSINodeEntry (GetNodeData(pnode), NULL, Index: iSNSMain.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSMain.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSMain.c 3 Nov 2006 20:22:29 -0000 1.7 --- iSNSMain.c 22 Nov 2006 17:45:39 -0000 1.8 *************** *** 522,526 **** if (unparsed_md) ISNSFreeBuffer((char*)unparsed_md); ! DEBUG_0 (isns_main_debug & 0x400, (Registration complete)); } break; --- 522,526 ---- if (unparsed_md) ISNSFreeBuffer((char*)unparsed_md); ! DEBUG_0 (isns_main_debug & 0x400, (Process Request Complete)); } break; Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSList.c 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSList.c 22 Nov 2006 17:45:39 -0000 1.3 *************** *** 35,39 **** --- 35,43 ---- #include "iSNStypes.h" #include "iSNSList.h" + #include "iSNSdb.h" #include "iSNSbuffer.h" + #include "iSNSdebug.h" + + extern int isns_db_debug; /******************************************************************** *************** *** 42,53 **** ********************************************************************/ int ! InitList(ISNS_LIST *plist) { ! ISNS_LIST_NODE *newNode; ! memset(plist, 0, sizeof(ISNS_LIST)); ! newNode = (ISNS_LIST_NODE *)ISNSAllocBuffer(sizeof(ISNS_LIST_NODE)); ! memset(newNode, 0, sizeof(ISNS_LIST_NODE)); ! plist->head = newNode; return ( SUCCESS ); --- 46,169 ---- ********************************************************************/ int ! InitList(int list_id, void * record) { ! ISNS_LIST *plist; ! switch (list_id) ! { ! case ISCSI_DD_LIST: ! { ! SOIP_Iscsi *p_entry; ! p_entry = record; ! plist = &p_entry->dd_id_list; ! plist->p_entry = p_entry; ! break; ! } ! case PORTAL_ENTITY_LIST: ! { ! SOIP_Portal *p_entry; ! p_entry = record; ! plist = &p_entry->entity_list; ! plist->p_entry = p_entry; ! break; ! } ! case DDS_DD_LIST: ! { ! SOIP_Dds *p_entry; ! p_entry = record; ! plist = &p_entry->dd_list; ! plist->p_entry = p_entry; ! break; ! } ! case DD_DDS_LIST: ! { ! SOIP_Dd *p_entry; ! p_entry = record; ! plist = &p_entry->dds_list; ! plist->p_entry = p_entry; ! break; ! } ! case DD_MEMBER_LIST: ! { ! SOIP_Dd *p_entry; ! p_entry = record; ! plist = &p_entry->member_list; ! plist->p_entry = p_entry; ! break; ! } ! case ENTITY_PORTAL_LIST: ! { ! SOIP_Entity *p_entry; ! p_entry = record; ! plist = &p_entry->iportal_list; ! plist->p_entry = p_entry; ! break; ! } ! case ENTITY_ISCSI_LIST: ! { ! SOIP_Entity *p_entry; ! p_entry = record; ! plist = &p_entry->iscsi_node_list; ! plist->p_entry = p_entry; ! break; ! } ! case ENTITY_FCP_LIST: ! { ! SOIP_Entity *p_entry; ! p_entry = record; ! plist = &p_entry->ifcp_node_list; ! plist->p_entry = p_entry; ! break; ! } ! case FCP_PORTAL_LIST: ! { ! SOIP_Fc_Node *p_entry; ! p_entry = record; ! plist = &p_entry->port_list; ! plist->p_entry = p_entry; ! break; ! } ! case FCP_DD_LIST: ! { ! SOIP_Ifcp *p_entry; ! p_entry = record; ! plist = &p_entry->dd_id_list; ! plist->p_entry = p_entry; ! break; ! } ! case ESI_LIST: ! { ! ISNS_LIST *p_entry; ! p_entry = record; ! plist = p_entry; ! plist->p_entry = p_entry; ! break; ! } ! case SCN_CALLBACK_LIST: ! { ! ISNS_LIST *p_entry; ! p_entry = record; ! plist = p_entry; ! plist->p_entry = p_entry; ! break; ! } ! case SCN_LIST: ! { ! ISNS_LIST *p_entry; ! p_entry = record; ! plist = p_entry; ! plist->p_entry = p_entry; ! break; ! } ! ! } ! ! plist->list_id = list_id; ! plist->first_index = 0; ! plist->last_index = 0; ! plist->node_count = 0; ! ! DEBUG_1 (isns_db_debug &1,InitList list_id:%i,plist->list_id); ! DEBUG_1 (isns_db_debug &1,InitList node_count:%i,plist->node_count); return ( SUCCESS ); *************** *** 60,74 **** DeleteList(ISNS_LIST *plist) { ! while (!IsEmptyList(plist)) ! { ! RemoveNode(plist, plist->head->next); ! } ! /* Delete the dummy node */ ! if ( plist->head ) { ! ISNSFreeBuffer((char *)plist->head); ! plist->head = 0; ! plist->node_count = 0; } --- 176,187 ---- DeleteList(ISNS_LIST *plist) { ! ISNS_LIST_NODE pnode; ! DEBUG_1 (isns_db_debug &1,DeleteList list_id:%i,plist->list_id); ! ! while (!IsEmptyList(plist)) { ! pnode.index = plist->first_index; ! RemoveNode(plist, &pnode); } *************** *** 83,123 **** { int foundFlag; ISNS_LIST_NODE *curr_node; ! ISNS_LIST_NODE *prev_node; ! ISNS_LIST_NODE *dummy_node; curr_node = NULL; ! prev_node = NULL; foundFlag = FALSE; ! while ( (curr_node = GetNextNode(plist, curr_node)) ) { ! if (curr_node == pnode) { foundFlag = TRUE; break; } ! ! prev_node = curr_node; } ! dummy_node = plist->head; if ( foundFlag ) { ! if (prev_node) ! prev_node->next = curr_node->next; ! else ! dummy_node->next = curr_node->next; ! if (curr_node->next) ! curr_node->next->prev = prev_node; ! if (curr_node->data) ! ISNSFreeBuffer(curr_node->data); ! ISNSFreeBuffer((char *)curr_node); ! curr_node = NULL; ! plist->node_count--; } --- 196,346 ---- { int foundFlag; + ISNS_LIST_NODE *curr_node; ! int rval; ! ISNS_Key key; ! SOIP_DB_Entry entry; ! int next_index; ! int prev_index; ! SOIP_Entity *p_entity; ! SOIP_Iscsi *p_iscsi; ! SOIP_Dds *p_dds; ! SOIP_Dd *p_dd; ! SOIP_DB_Portal *p_portal; ! SOIP_Fc_Node *p_ifcp; ! ISNS_LIST *p_list; curr_node = NULL; ! ! DEBUG_0 (isns_db_debug &1,Remove Node); foundFlag = FALSE; ! ! curr_node = GetNextNode(plist, curr_node); ! while ( curr_node != NULL ) { ! DEBUG_2 (isns_db_debug &1, curr_node:%i pnode:%i,curr_node->index,pnode->index); ! if (curr_node->index == pnode->index ) { foundFlag = TRUE; break; } ! curr_node = GetNextNode(plist, curr_node); } ! ! DEBUG_1 (isns_db_debug &1, FoundFlag%i,foundFlag); if ( foundFlag ) { ! DEBUG_0 (isns_db_debug &1, FoundFlag); ! /* read current node */ ! memset(&key,0,sizeof(ISNS_Key)); ! key.tag = LIST_KEY; ! key.val.list.list_id = plist->list_id; ! key.val.list.list_index = pnode->index; ! memset(&entry,0,sizeof(SOIP_DB_Entry)); ! if (plist->list_id == ENTITY_ISCSI_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! } ! else if (plist->list_id == ENTITY_FCP_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! } ! else if (plist->list_id == ENTITY_PORTAL_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! } ! else if (plist->list_id == ISCSI_DD_LIST) ! { ! p_iscsi = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_iscsi->id.v); ! } ! else if (plist->list_id == DDS_DD_LIST) ! { ! p_dds = plist->p_entry; ! key.val.list.key.dds.id = p_dds->id; ! } ! else if (plist->list_id == DD_MEMBER_LIST) ! { ! p_dd = plist->p_entry; ! key.val.list.key.dd.id = p_dd->id; ! } ! else if (plist->list_id == FCP_PORTAL_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! } ! else if (plist->list_id == FCP_DD_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! } ! else if (plist->list_id == PORTAL_ENTITY_LIST) ! { ! p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); ! } ! else if (plist->list_id == ESI_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"esi_list"); ! } ! else if (plist->list_id == SCN_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"scn_list"); ! } ! else if (plist->list_id == SCN_CALLBACK_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"scn_callback_list"); ! } ! rval = ISNSdbRead(&key,&entry); ! next_index = entry.data.list.next_index; ! prev_index = entry.data.list.prev_index; ! /*delete current node*/ ! rval = ISNSdbDelete(&key); ! ! /*pdate first_index if necessary*/ ! if (plist->first_index == key.val.list.list_index ) ! { ! plist->first_index = next_index; ! } ! ! /*update last_index if necessary*/ ! if (plist->last_index == key.val.list.list_index ) ! { ! plist->last_index = prev_index; ! } ! ! /*update previous node*/ ! if (prev_index != 0) ! { ! key.val.list.list_index = prev_index; ! rval = ISNSdbRead(&key,&entry); ! entry.data.list.next_index = next_index; ! rval = ISNSdbWrite(&key,entry); ! } ! ! /*update next node*/ ! if (next_index != 0) ! { ! key.val.list.list_index = next_index; ! rval = ISNSdbRead(&key,&entry); ! entry.data.list.prev_index = prev_index; ! rval = ISNSdbWrite(&key,entry); ! } ! ! /*update node_count*/ ! DEBUG_1 (isns_db_debug &1, RemoveNode - node_count:%i,plist->node_count); ! plist->node_count--; } *************** *** 129,134 **** ********************************************************************/ char * ! GetNodeData( ISNS_LIST_NODE *pnode ) { return ( pnode->data ); } --- 352,358 ---- ********************************************************************/ char * ! GetNodeData(ISNS_LIST_NODE *pnode ) { + DEBUG_0 (isns_db_debug &1, GetNodeData); return ( pnode->data ); } *************** *** 142,145 **** --- 366,371 ---- ISNS_LIST_NODE *ptr; + DEBUG_0 (isns_db_debug &1,FindNode); + ptr = NULL; *************** *** 162,195 **** AddNode(ISNS_LIST *plist, char *pdata, int data_size) { ! ISNS_LIST_NODE *dummy_head; ! ISNS_LIST_NODE *new_head; ! ! dummy_head = plist->head; ! /* List has nodes */ ! /* Insert at the head */ ! new_head = (ISNS_LIST_NODE *)ISNSAllocBuffer(sizeof(ISNS_LIST_NODE)); ! if (!new_head) ! return (ERROR); ! memset(new_head, 0, sizeof(ISNS_LIST_NODE)); ! if (pdata && data_size) { ! new_head->data = ISNSAllocBuffer(data_size); ! if (!new_head->data) ! return (ERROR); ! memcpy(new_head->data, pdata, data_size); } ! new_head->data_size = data_size; ! /* Insert it right after the dummy head */ ! new_head->next = dummy_head->next; ! new_head->prev = NULL; - dummy_head->next = new_head; plist->node_count++; return ( SUCCESS ); --- 388,504 ---- AddNode(ISNS_LIST *plist, char *pdata, int data_size) { ! ISNS_Key key; ! SOIP_DB_Entry entry; ! int rval; ! SOIP_Entity *p_entity; ! SOIP_Iscsi *p_iscsi; ! SOIP_Dds *p_dds; ! SOIP_Dd *p_dd; ! SOIP_DB_Portal *p_portal; ! SOIP_Fc_Node *p_ifcp; ! DEBUG_1 (isns_db_debug &1, AddNode - list_id:%i,plist->list_id); ! memset(&key,0,sizeof(ISNS_Key)); ! key.tag = LIST_KEY; ! key.val.list.list_id = plist->list_id; ! memset(&entry,0,sizeof(SOIP_DB_Entry)); ! if (plist->list_id == ENTITY_ISCSI_LIST) { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! memcpy(entry.data.list.key.node_name.v,pdata,data_size); ! } ! else if (plist->list_id == ENTITY_FCP_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! memcpy(entry.data.list.key.node_name.v,pdata,data_size); ! } ! else if (plist->list_id == ENTITY_PORTAL_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! memcpy(&entry.data.list.key.portal,pdata,data_size); ! } ! else if (plist->list_id == ISCSI_DD_LIST) ! { ! p_iscsi = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_iscsi->id.v); ! memcpy(&entry.data.list.key.dd,pdata,data_size); ! } ! else if (plist->list_id == DDS_DD_LIST) ! { ! p_dds = plist->p_entry; ! key.val.list.key.dds.id = p_dds->id; ! memcpy(&entry.data.list.key.dd,pdata,data_size); ! } ! else if (plist->list_id == DD_MEMBER_LIST) ! { ! p_dd = plist->p_entry; ! key.val.list.key.dd.id = p_dd->id; ! memcpy(&entry.data.list.key.dds,pdata,data_size); ! } ! else if (plist->list_id == FCP_PORTAL_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! memcpy(&entry.data.list.key.portal,pdata,data_size); ! } ! else if (plist->list_id == FCP_DD_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! memcpy(&entry.data.list.key.dd,pdata,data_size); ! } ! else if (plist->list_id == PORTAL_ENTITY_LIST) ! { ! p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); ! memcpy(&entry.data.list.key.entity_id.id,pdata,data_size); ! } ! else if (plist->list_id == ESI_LIST) ! { ! strcpy (key.val.list.key.node_name.v,"esi_list"); ! memcpy(&entry.data.list.key.node_name.v,pdata,data_size); ! } ! else if (plist->list_id == SCN_LIST) ! { ! strcpy (key.val.list.key.node_name.v,"scn_list"); ! memcpy(&entry.data.list.key.node_name.v,pdata,data_size); ! } ! else if (plist->list_id == SCN_CALLBACK_LIST) ! { ! strcpy (key.val.list.key.node_name.v,"scn_callback_list"); ! memcpy(&entry.data.list.key.node_name.v,pdata,data_size); } + + DEBUG_0 (isns_db_debug &1, update last_index); ! plist->last_index++; ! key.val.list.list_index = plist->last_index; ! entry.data_type = LIST_KEY; ! entry.data.list.index = plist->last_index; ! entry.data.list.prev_index = plist->last_index-1; ! entry.data.list.next_index = 0; ! ! if (plist->first_index == 0) ! plist->first_index = plist->last_index; ! ! rval = ISNSdbWrite(&key,entry); ! ! if (entry.data.list.prev_index != 0 ) ! { ! key.val.list.list_index = entry.data.list.prev_index; ! rval = ISNSdbRead(&key,&entry); ! entry.data.list.next_index = plist->last_index; ! rval = ISNSdbWrite(&key,entry); ! } plist->node_count++; + DEBUG_1 (isns_db_debug &1, AddNode node_count:%i,plist->node_count); return ( SUCCESS ); *************** *** 202,208 **** IsEmptyList(ISNS_LIST *plist) { ! if ( (plist && plist->head && plist->head->next == NULL) ! || plist->node_count == 0 ) return (TRUE); else return (FALSE); --- 511,519 ---- IsEmptyList(ISNS_LIST *plist) { ! DEBUG_1 (isns_db_debug &1,IsEmptyList:%i,plist->node_count); ! ! if (plist->node_count == 0) return (TRUE); + else return (FALSE); *************** *** 215,225 **** GetNextNode(ISNS_LIST *plist, ISNS_LIST_NODE *pnode) { if (plist && plist->node_count == 0) return ( NULL ); if ( pnode == NULL) ! /* Skipping the dummy node */ ! return ( plist?plist->head->next:NULL ); else ! return ( pnode?pnode->next:NULL ); } --- 526,727 ---- GetNextNode(ISNS_LIST *plist, ISNS_LIST_NODE *pnode) { + ISNS_LIST_NODE *node; + ISNS_Key key; + SOIP_DB_Entry entry; + int rval; + SOIP_Entity *p_entity; + SOIP_Iscsi *p_iscsi; + SOIP_Dds *p_dds; + SOIP_Dd *p_dd; + SOIP_DB_Portal *p_portal; + SOIP_Fc_Node *p_ifcp; + ISNS_LIST *p_list; + + DEBUG_1 (isns_db_debug &1,GetNextNode list_id:%i,plist->list_id); + DEBUG_1 (isns_db_debug &1,GetNextNode node_count:%i,plist->node_count); + if (plist && plist->node_count == 0) + { return ( NULL ); + } + + memset(&key,0,sizeof(ISNS_Key)); + key.tag = LIST_KEY; + key.val.list.list_id = plist->list_id; + memset(&entry,0,sizeof(SOIP_DB_Entry)); + if ( pnode == NULL) ! { ! if (plist->node_count == 0) ! return NULL; ! ! DEBUG_0 (isns_db_debug &1, AllocBuffer for first node); ! node = (ISNS_LIST_NODE *)ISNSAllocBuffer(sizeof(ISNS_LIST_NODE)); ! key.val.list.list_index = plist->first_index; ! } else ! { ! node = pnode; ! DEBUG_1 (isns_db_debug &1, next_index:%i,node->next_index); ! key.val.list.list_index = node->next_index; ! } ! ! DEBUG_0 (isns_db_debug &1,Now Read entry); ! if (plist->list_id == ENTITY_ISCSI_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! DEBUG_0 (isns_db_debug &1, read list entry); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! { ! return NULL; ! } ! node->data_size = strlen(entry.data.list.key.node_name.v); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,entry.data.list.key.node_name.v,node->data_size); ! DEBUG_0 (isns_db_debug &1, Successfully read list entry); ! } ! else if (plist->list_id == ENTITY_FCP_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = strlen(entry.data.list.key.node_name.v); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,entry.data.list.key.node_name.v,node->data_size); ! } ! else if (plist->list_id == ENTITY_PORTAL_LIST) ! { ! p_entity = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_entity->eid.id); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(SOIP_DB_Portal); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.portal,node->data_size); ! } ! else if (plist->list_id == ISCSI_DD_LIST) ! { ! p_iscsi = plist->p_entry; ! strcpy(key.val.list.key.node_name.v,p_iscsi->id.v); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.dd); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.dd,node->data_size); ! } ! else if (plist->list_id == DDS_DD_LIST) ! { ! p_dds = plist->p_entry; ! key.val.list.key.dds.id = p_dds->id; ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.dd); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.dd,node->data_size); ! } ! else if (plist->list_id == DD_DDS_LIST) ! { ! p_dd = plist->p_entry; ! key.val.list.key.dd.id = p_dd->id; ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.dds); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.dds,node->data_size); ! } ! else if (plist->list_id == DD_MEMBER_LIST) ! { ! p_dd = plist->p_entry; ! key.val.list.key.dd.id = p_dd->id; ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.dd); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.dd,node->data_size); ! } ! else if (plist->list_id == FCP_PORTAL_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(SOIP_DB_Portal); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.portal,node->data_size); ! } ! else if (plist->list_id == FCP_DD_LIST) ! { ! p_ifcp = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,p_ifcp->node_name.v); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.dd); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.dd,node->data_size); ! } ! else if (plist->list_id == PORTAL_ENTITY_LIST) ! { ! p_portal = plist->p_entry; ! memcpy(&key.val.list.key.portal,p_portal,sizeof(SOIP_DB_Portal)); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(entry.data.list.key.entity_id.id); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.entity_id.id,node->data_size); ! } ! else if (plist->list_id == ESI_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"esi_list"); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(SOIP_ESI); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.entity_id.id,node->data_size); ! } ! else if (plist->list_id == SCN_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"scn_list"); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(SOIP_Scn_Entry); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.entity_id.id,node->data_size); ! } ! else if (plist->list_id == SCN_CALLBACK_LIST) ! { ! p_list = plist->p_entry; ! strcpy (key.val.list.key.node_name.v,"scn_callback_list"); ! rval = ISNSdbRead(&key,&entry); ! if (rval != SUCCESS) ! return NULL; ! node->data_size = sizeof(SOIP_Scn_Callback_Entry); ! node->data = (char *)ISNSAllocBuffer(node->data_size+1); ! memcpy(node->data,&entry.data.list.key.entity_id.id,node->data_size); ! } ! ! node->next_index = entry.data.list.next_index; ! node->prev_index = entry.data.list.prev_index; ! node->index = entry.data.list.index; ! node->list_id= plist->list_id; ! node->p_entry = plist->p_entry; ! ! DEBUG_0 (isns_db_debug &1, return GetNextNode node); ! return node; } *************** *** 230,234 **** GetPrevNode(ISNS_LIST *plist, ISNS_LIST_NODE *pnode) { ! return ( pnode?pnode->prev:NULL ); } --- 732,737 ---- GetPrevNode(ISNS_LIST *plist, ISNS_LIST_NODE *pnode) { ! //return ( pnode?pnode->prev:NULL ); ! return NULL; } |
From: Robert W. <wrw...@us...> - 2006-11-22 17:46:30
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31703/include Modified Files: iSNSList.h iSNSdb.h iSNStypes.h Log Message: Add database support for the list structure Index: iSNStypes.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNStypes.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNStypes.h 6 Nov 2006 18:04:38 -0000 1.4 --- iSNStypes.h 22 Nov 2006 17:45:39 -0000 1.5 *************** *** 280,283 **** --- 280,284 ---- ISCSI_IDX_KEY, PORTAL_IDX_KEY, + LIST_KEY, END_SNS_DEVI_KEY *************** *** 660,663 **** --- 661,708 ---- } SOIP_Iscsi; + /* ids for identifying which list */ + typedef enum { + ISCSI_DD_LIST = 1, + FCP_DD_LIST, + FCP_PORTAL_LIST, + ENTITY_PORTAL_LIST, + ENTITY_FCP_LIST, + ENTITY_ISCSI_LIST, + DD_MEMBER_LIST, + DD_DDS_LIST, + DDS_DD_LIST, + PORTAL_ENTITY_LIST, + ESI_LIST, + SCN_CALLBACK_LIST, + SCN_LIST + } DATA_LIST_ID; + + #define LIST_KEY_SIZE (8) + + typedef struct soip_list_key { + int list_id; + int list_index; + union { /* The key to which the list belongs */ + SOIP_Entity_Id entity_id; + SOIP_Dds dds; + SOIP_Dd dd; + SOIP_Node_Name node_name; + SOIP_DB_Portal portal; + } key; + } SOIP_LIST_Key; + + typedef struct soip_list { + int index; + int next_index; + int prev_index; + union { + SOIP_Entity_Id entity_id; + SOIP_Dds dds; + SOIP_Dd dd; + SOIP_Node_Name node_name; + SOIP_DB_Portal portal; + } key; + } SOIP_DB_List; + typedef struct soip_db_entry { *************** *** 683,687 **** SOIP_ISCSI_Node_Id iscsi_idx; SOIP_DB_Portal portal_idx; ! } data; --- 728,732 ---- SOIP_ISCSI_Node_Id iscsi_idx; SOIP_DB_Portal portal_idx; ! SOIP_DB_List list; } data; *************** *** 713,716 **** --- 758,762 ---- uint32_t integer32; SOIP_IDX_Key idx; + SOIP_LIST_Key list; } val; Index: iSNSList.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSList.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSList.h 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSList.h 22 Nov 2006 17:45:39 -0000 1.3 *************** *** 41,52 **** int data_size; ! struct _list_node *next; ! struct _list_node *prev; } ISNS_LIST_NODE; typedef struct _list { - ISNS_LIST_NODE *head; int node_count; } ISNS_LIST; --- 41,60 ---- int data_size; ! int list_id; ! int index; ! void *p_entry; ! int next_index; ! int prev_index; ! } ISNS_LIST_NODE; typedef struct _list { int node_count; + int list_id; + int first_index; + int last_index; + void *p_entry; + } ISNS_LIST; *************** *** 76,80 **** int ! InitList(ISNS_LIST *plist); #endif --- 84,88 ---- int ! InitList(int list_id, void * record); #endif Index: iSNSdb.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSdb.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSdb.h 3 Nov 2006 20:22:29 -0000 1.4 --- iSNSdb.h 22 Nov 2006 17:45:39 -0000 1.5 *************** *** 109,120 **** ISNSdbDelete (ISNS_Key *key); - void * - ISNSGetDataFromIdxHashTable(IDX_HASH_ENTRY **table, uint32_t index); - uint32_t ISNSGetNewPortalIdx(void); - void ISNSAddToIdxHashTable(IDX_HASH_ENTRY **table, uint32_t index, void*p_data,int size); - uint32_t ISNSGetIdxFromIdxHashTableByData(IDX_HASH_ENTRY **table, void *ptr, int len); - int ISNS_GetNewDDS_ID (void); int ISNS_GetNewDD_ID (void); --- 109,114 ---- *************** *** 124,128 **** uint32_t ISNSGetNewPortalIdx(void); - void ISNSRemoveFromIdxHashTable(IDX_HASH_ENTRY **table, uint32_t index); #endif --- 118,121 ---- |