From: Robert W. <wrw...@us...> - 2006-11-03 01:10:30
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30716/src Modified Files: iSNSdb.c Added Files: iSNSdereg.c iSNSquery.c iSNSreg.c Log Message: Divide into reg,dereg, and query modules --- NEW FILE: iSNSreg.c --- /*********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Nishan Systems, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. [...3705 lines suppressed...] DEBUG_1( isns_db_debug & 1, (Sending SCN re-reg msg node = %s), pdata->name.v); /* SRC */ ISNSAppendKey(&p_scn_md->msg, 0, 0, NULL, 0); /* Key */ ISNSAppendKey(&p_scn_md->msg, ISNS_ISCSI_NODE_ID, PAD4(strlen(pdata->name.v)), pdata->name.v, 0); ISNSAppendKey(&p_scn_md->msg, ISNS_DELIMITER, ISNS_DELIMITER_SIZE, NULL, 0); /* Attr */ ISNSAppendKey(&p_scn_md->msg, ISNS_ISCSI_SCN_BITMAP, ISNS_SCN_BITMAP_SIZE, NULL, pdata->bitmap); ISNSSendMsg2Server(&p_scn_md->msg); lnode = GetNextNode(&scn_callback_list, lnode); } return (SUCCESS); } #endif Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSdb.c 2 Nov 2006 21:19:21 -0000 1.7 --- iSNSdb.c 3 Nov 2006 01:10:24 -0000 1.8 *************** *** 104,111 **** static SOIP_DB_Entry entry; /* top level fetches ONLY */ static SOIP_DB_Entry entry2; /* secondary fetches */ - static SOIP_DB_Entry entry3; - static SOIP_DB_Entry entry4; - static SOIP_DB_Entry entry5; - static SOIP_DB_Entry show_entry; static SOIP_DB_Entry scn_entry; --- 104,107 ---- *************** [...10599 lines suppressed...] ! /******************************************************************** ! ********************************************************************/ ! void ! iSNSDumpStats( void ) ! { ! printf("Entity count: %d\n", iSNS_stats.num_entity); ! printf("Portal count: %d\n", iSNS_stats.num_portals); ! printf("iSCSI count : %d\n", iSNS_stats.num_iscsi); ! printf("iFCP count : %d\n", iSNS_stats.num_ifcp); ! printf("DD count : %d\n", iSNS_stats.num_dd); ! printf("DDS count : %d\n", iSNS_stats.num_dds); } --- 3261,3266 ---- } } ! return ( errorCode ); } --- NEW FILE: iSNSdereg.c --- /*********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Nishan Systems, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. [...2589 lines suppressed...] while (SNSdbGetNextOfKey (&key) == SUCCESS) { /* Fetch entity from hash */ if (ISNS_NO_ERR != SNSdbFetchEntity (key.val.entity_key.id, &p_entity, &entry)) { return; } if (p_entity->period == 0) continue; if (secs<(int)p_entity->period+(int)p_entity->timestamp.t_time) continue; /* Period has expired, deregister */ ISNSdbRemoveAttrEntityEntry (p_entity->eid.id, NULL, NULL); } } --- NEW FILE: iSNSquery.c --- /*********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Nishan Systems, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. [...4240 lines suppressed...] { if (p_dlist_node[ii]==0) break; for (jj = 0; jj < MAX_DD_PER_LIST; jj++) { if (p_dlist_node[jj]==0) break; if (p_dlist_src[ii] == p_dlist_node[jj]) return (TRUE); } } if (ddmem[0].type==0) // no discovery domains created - use default return TRUE; return (FALSE); } |