From: Robert W. <wrw...@us...> - 2007-08-07 14:41:53
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17288/src Modified Files: iSNSInit.c iSNSLinux.c iSNSList.c iSNSMain.c iSNSUtil.c iSNScomm.c iSNSdb.c iSNSdereg.c iSNSesi.c iSNSfsm.c iSNSipc.c iSNSnt.c iSNSparse.c iSNSquery.c iSNSrcv.c iSNSreg.c iSNSscn.c iSNStrcv.c Log Message: Add logging system Index: iSNSInit.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSInit.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSInit.c 2 Jan 2007 20:15:24 -0000 1.6 --- iSNSInit.c 7 Aug 2007 14:41:47 -0000 1.7 *************** *** 68,72 **** sprintf (sns_errmsg, "%s:%d - Error creating SNS_EP IPC endpoint\n", __FILE__,__LINE__); ! SNS_FATAL(SNS_IPC_ERR, sns_errmsg, 0); taskDelete(taskIdSelf()); } --- 68,72 ---- sprintf (sns_errmsg, "%s:%d - Error creating SNS_EP IPC endpoint\n", __FILE__,__LINE__); ! __LOG_ERROR("Error creating SNS_EP IPC endpoint"); taskDelete(taskIdSelf()); } *************** *** 77,84 **** if (CreateIPCEndPoint(DEVICE_MGMT_EP) == ERROR) { ! sprintf(sns_errmsg, ! "%s:%d - Error creating DEVICE_MGMT_EP IPC endpoint\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_IPC_ERR, sns_errmsg, 0); taskDelete(taskIdSelf()); } --- 77,81 ---- if (CreateIPCEndPoint(DEVICE_MGMT_EP) == ERROR) { ! __LOG_ERROR("Error creating DEVICE_MGMT_EP IPC endpoint"); taskDelete(taskIdSelf()); } *************** *** 88,94 **** if (ISNSdbOpen() == ERROR) { ! sprintf (sns_errmsg, "%s:%d - Error in Opening iSNS DB File\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_DBOPEN_ERR, sns_errmsg, 0); taskDelete(taskIdSelf()); } --- 85,89 ---- if (ISNSdbOpen() == ERROR) { ! __LOG_ERROR("Error in opening iSNS DB file"); taskDelete(taskIdSelf()); } *************** *** 99,106 **** if (SNSCommInit(sns_role) == -1) { ! sprintf (sns_errmsg, ! "%s:%d - Error in Initializing socket Communications\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_COMM_ERR, sns_errmsg, 0); /* * clean up and bail out --- 94,98 ---- if (SNSCommInit(sns_role) == -1) { ! __LOG_ERROR ("Error in Initialing socket communication"); /* * clean up and bail out *************** *** 116,122 **** if (SNSQInit(SNS_TRANSACTION_QUEUE) == ERROR) { ! sprintf(sns_errmsg, "%s:%d - Error initing queue IPC msgs\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_QINIT_ERR, sns_errmsg, 0); ISNSdbClose(); taskDelete(taskIdSelf()); --- 108,112 ---- if (SNSQInit(SNS_TRANSACTION_QUEUE) == ERROR) { ! __LOG_ERROR("Error initing queue IPC msgs"); ISNSdbClose(); taskDelete(taskIdSelf()); *************** *** 135,142 **** #endif { ! sprintf (sns_errmsg, ! "%s:%d - Error spawning iSNS UDP receive task\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_SPAWN_ERR, sns_errmsg, 0); ISNSdbClose(); taskDelete(taskIdSelf()); --- 125,129 ---- #endif { ! __LOG_ERROR("Error spawning iSNS UDP receive task"); ISNSdbClose(); taskDelete(taskIdSelf()); *************** *** 153,159 **** if ( SNSStartFSM() == ERROR ) { ! sprintf (sns_errmsg, "%s:%d : Unable to Start iSNS FSM\n", ! __FILE__,__LINE__); ! SNS_FATAL(SNS_FSM_ERR, sns_errmsg, 0); ISNSdbClose(); taskDelete(taskIdSelf()); --- 140,144 ---- if ( SNSStartFSM() == ERROR ) { ! __LOG_ERROR("Unable to Start iSNS FSM"); ISNSdbClose(); taskDelete(taskIdSelf()); Index: iSNSUtil.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSUtil.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** iSNSUtil.c 28 Jun 2007 19:46:08 -0000 1.16 --- iSNSUtil.c 7 Aug 2007 14:41:47 -0000 1.17 *************** *** 1,3 **** ! /*********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. --- 1,3 ---- ! /********************************************************************** Copyright (c) 2001, Nishan Systems, Inc. All rights reserved. *************** *** 66,81 **** case DEREG_DEVI_REQ: [...1213 lines suppressed...] + switch (level) + { + case LOG_ERR: + fprintf(stderr,"ERROR: "); + break; + case LOG_WARNING: + fprintf(stderr,"WARNING: "); + break; + case LOG_DEBUG: + fprintf(stderr,"Debug: "); + break; + case LOG_INFO: + fprintf(stderr,"Info: "); + break; + } + vfprintf(stderr, format, ptr); + } + va_end(ptr); + } + Index: iSNScomm.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNScomm.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** iSNScomm.c 4 Jan 2007 19:00:06 -0000 1.10 --- iSNScomm.c 7 Aug 2007 14:41:47 -0000 1.11 *************** *** 39,42 **** --- 39,43 ---- #include "iSNSparse.h" #include "iSNSdebug.h" + #include "errno.h" int sns_comm_debug = 0; *************** *** 50,54 **** int ifAddrGet(char *ifname, char *ip) { - //if (strcmp(ifname, sns_if_name) == 0) { if (strlen (snsp_ip) != 0) { strcpy(ip, snsp_ip); --- 51,54 ---- *************** *** 56,60 **** else { - //printf("unknown interface\n"); return (ERROR); } --- 56,59 ---- *************** *** 110,114 **** void pipe_handler(int n) { ! printf("SIGPIPE received:%i\n",n); } --- 109,113 ---- void pipe_handler(int n) { ! __LOG_INFO ("SIGPIPE received:%i",n); } *************** *** 328,345 **** &md->cb.sock.len) == -1 ) { ! // printf ("\n%s:%d sd %d",__FILE__,__LINE__,sd); ! // perror("\nSNSGetMsg(recvfrom):"); ! // status = ERROR; } else { - #if 0 - if (md->cb.sock.addr.sin_addr.s_addr == local_sock.sin_addr.s_addr) - continue; - #endif - if (sns3) ! printf("Receive from %x\n", (int)md->cb.sock.addr.sin_addr.s_addr); { /* iSNS msg */ --- 327,338 ---- &md->cb.sock.len) == -1 ) { ! __LOG_ERROR ("Error recform "); ! status = ERROR; } else { if (sns3) ! __LOG_INFO ("Receive from %x", (int)md->cb.sock.addr.sin_addr.s_addr); { /* iSNS msg */ *************** *** 368,372 **** int rval; ! DEBUG_0 (sns_comm_debug &1,ISNSSendMsg); p_md->msg.hdr.flags |= ISNS_FLAG_SND_SERVER; --- 361,365 ---- int rval; ! __DEBUG (sns_comm_debug &1,ISNSSendMsg); p_md->msg.hdr.flags |= ISNS_FLAG_SND_SERVER; *************** *** 388,392 **** /* UDP */ rval = SNSSendMsg_UDP(p_md); ! printf("***WARNING: Wrong Socket Type.\n"); return (rval); --- 381,385 ---- /* UDP */ rval = SNSSendMsg_UDP(p_md); ! __LOG_WARNING ("WARNING: Wrong Socket Type."); return (rval); *************** *** 422,426 **** if (s_len<=0) { ! printf("***ERROR: send() error=%d.\n", s_len); return (ERROR); } --- 415,419 ---- if (s_len<=0) { ! __LOG_INFO ("send() error=%d %s",s_len, strerror(errno) ); return (ERROR); } *************** *** 489,493 **** (struct sockaddr *)&p_md->cb.sock.addr, p_md->cb.sock.len); ! DEBUG_4 (display_debug, (iSNS Sending msg id %d, len %d, xid %d to %s), p_md->msg.hdr.type, p_md->msg.hdr.msg_len, --- 482,486 ---- (struct sockaddr *)&p_md->cb.sock.addr, p_md->cb.sock.len); ! __DEBUG (display_debug, (iSNS Sending msg id %d, len %d, xid %d to %s), p_md->msg.hdr.type, p_md->msg.hdr.msg_len, *************** *** 510,514 **** (struct sockaddr *)&p_md->cb.sock.addr, p_md->cb.sock.len); ! DEBUG_4 (display_debug, (iSNS Sending msg id %#x, len %d, xid %d to %s), ntohs(p_md->msg.hdr.type), ntohs(p_md->msg.hdr.msg_len), --- 503,507 ---- (struct sockaddr *)&p_md->cb.sock.addr, p_md->cb.sock.len); ! __DEBUG (display_debug, (iSNS Sending msg id %#x, len %d, xid %d to %s), ntohs(p_md->msg.hdr.type), ntohs(p_md->msg.hdr.msg_len), *************** *** 638,642 **** else { ! printf("***Warning: type is already in network byte order.\n"); } --- 631,635 ---- else { ! __LOG_WARNING("Warning: type is already in network byte order."); } *************** *** 651,655 **** sizeof(struct sockaddr_in)) == ERROR) { ! DEBUG_1 (sns_comm_debug, (Error in Sending message to %s), dot_not_addr); status = ERROR; --- 644,648 ---- sizeof(struct sockaddr_in)) == ERROR) { ! __DEBUG (sns_comm_debug, (Error in Sending message to %s), dot_not_addr); status = ERROR; *************** *** 657,661 **** else { ! DEBUG_1 (display_debug, (Sending message to %s), dot_not_addr); status = SUCCESS; } --- 650,654 ---- else { ! __DEBUG (display_debug, (Sending message to %s), dot_not_addr); status = SUCCESS; } *************** *** 729,733 **** display_debug = (p_msg->hdr.type != sns_comm_msg_filter); ! DEBUG_4 (display_debug, (iSNS Sending bcast/mcast msg id %d, len %d, xid %d to %s), p_msg->hdr.type, p_msg->hdr.msg_len, --- 722,726 ---- display_debug = (p_msg->hdr.type != sns_comm_msg_filter); ! __DEBUG (display_debug, (iSNS Sending bcast/mcast msg id %d, len %d, xid %d to %s), p_msg->hdr.type, p_msg->hdr.msg_len, Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** iSNSLinux.c 15 Dec 2006 01:13:29 -0000 1.11 --- iSNSLinux.c 7 Aug 2007 14:41:47 -0000 1.12 *************** *** 46,49 **** --- 46,50 ---- #include "iSNSbuffer.h" #include "iSNSipc.h" + #include "iSNSdebug.h" #ifndef SNS_LINUX *************** *** 69,72 **** --- 70,76 ---- extern pthread_mutex_t sns_esi_timer; + /* log */ + int daemon_state = TRUE; + /* debug */ extern int sns_bcast_debug; *************** *** 149,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\ ! [-f] Foreground - no daemon.\n\ ! [-?] Help.\n"; --- 153,162 ---- 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 switch] debug options: parse,db,list,reg,fsm,esi,scn,all \n\ ! [-f] Foreground - no daemon.\n\ ! [-?] Help.\n"; *************** *** 160,164 **** main (int argc, char **argv) { - int daemon = TRUE; pid_t pid; int c; --- 164,167 ---- *************** *** 198,216 **** break; case 'f': ! daemon = FALSE; break; case '?': default: ! fprintf (stderr, Usage); exit (0); } } ! if (daemon == TRUE) { pid = fork(); if (pid < 0) { ! printf("starting daemon failed\n"); exit(1); } --- 201,219 ---- break; case 'f': ! daemon_state = FALSE; break; case '?': default: ! fprintf(stderr,Usage); exit (0); } } ! if (daemon_state == TRUE) { pid = fork(); if (pid < 0) { ! __LOG_ERROR("starting daemon failed\n"); exit(1); } *************** *** 233,238 **** if (lockf(fd_pid, F_TLOCK, 0) < 0) { ! printf("unable to lock pid file already is use\n"); ! printf("isnss daemon not started\n"); exit (1); } --- 236,241 ---- if (lockf(fd_pid, F_TLOCK, 0) < 0) { ! __LOG_ERROR("unable to lock pid file already is use\n"); ! __LOG_INFO("isnss daemon not started\n"); exit (1); } *************** *** 241,254 **** sprintf(buf,"%d\n",getpid()); rc = write(fd_pid, buf, strlen(buf)); ! printf("isns daemon started as pid:%i\n",getpid()); - int fd; - char log_file[256]="/var/opt/isns/isns_log"; - printf("log output in %s\n",log_file); - fd = open(log_file, O_CREAT | O_WRONLY | O_TRUNC, 0644 ); - close(0); - dup2(fd,0); - dup2(fd,1); - dup2(fd,2); setsid(); } --- 244,249 ---- sprintf(buf,"%d\n",getpid()); rc = write(fd_pid, buf, strlen(buf)); ! __LOG_INFO ("isns daemon started as pid:%i",getpid()); setsid(); } *************** *** 273,277 **** int rc; ! printf ("SNSReqTimeoutHdlr Started.\n"); while (1) --- 268,272 ---- int rc; ! __DEBUG ( isns_main_debug & 16,"SNSReqTimeoutHdlr Started."); while (1) *************** *** 307,311 **** int rc; ! printf ("SNSFSMTimeoutHdlr thread started.\n"); while (1) --- 302,306 ---- int rc; ! __DEBUG (isns_main_debug & 1666666,"SNSFSMTimeoutHdlr thread started."); while (1) *************** *** 344,348 **** int rc; ! printf ("SNSESITimeoutHdlr thread started.\n"); while (1) --- 339,343 ---- int rc; ! __DEBUG (isns_main_debug & 16,"SNSESITimeoutHdlr thread started."); while (1) *************** *** 431,435 **** sns_scn_debug = -1; } ! else { sns_bcast_debug = -1; --- 426,430 ---- sns_scn_debug = -1; } ! else if (!strcmp(type,"all")) { sns_bcast_debug = -1; Index: iSNSquery.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSquery.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** iSNSquery.c 31 May 2007 21:16:36 -0000 1.22 --- iSNSquery.c 7 Aug 2007 14:41:47 -0000 1.23 *************** *** 126,130 **** if (attr == NULL) { ! DEBUG_0 (isns_query_debug & 1, (No attr in query msg)); return ( ISNS_MSG_FMT_ERR ); } --- 126,130 ---- if (attr == NULL) { ! __DEBUG (isns_query_debug & 1, (No attr in query msg)); return ( ISNS_MSG_FMT_ERR ); } *************** *** 247,251 **** iSCSINodeIdxKeyFlag = -1; ! DEBUG_0 (isns_query_debug &1,(GetAttrEntity)); ISNSTouchEntity( src_attr ); --- 247,251 ---- iSCSINodeIdxKeyFlag = -1; ! __DEBUG (isns_query_debug &1,(GetAttrEntity)); ISNSTouchEntity( src_attr ); *************** *** 325,329 **** /* Entity ID found in key */ key = (ISNS_Key *)(key_indx[entityKeyFlag]); ! DEBUG_1 (isns_query_debug &1,(Find Entity Index:%i),key->val.index); ISNS_DBKey read_key; read_key.tag = ENTITY_IDX_KEY; --- 325,329 ---- /* Entity ID found in key */ key = (ISNS_Key *)(key_indx[entityKeyFlag]); ! __DEBUG (isns_query_debug &1,(Find Entity Index:%i),key->val.index); ISNS_DBKey read_key; read_key.tag = ENTITY_IDX_KEY; *************** *** 335,339 **** ptr = (char *)&entry3.data.entity_idx.id; ! DEBUG_1 (isns_query_debug &1,(entity_idx.id:%s),ptr); if (!ptr) --- 335,339 ---- ptr = (char *)&entry3.data.entity_idx.id; ! __DEBUG (isns_query_debug &1,(entity_idx.id:%s),ptr); if (!ptr) *************** *** 361,365 **** if ((portalIpKeyFlag == -1) || (portalPortKeyFlag == -1)) { ! printf ("***Located only one required portal key.\n"); return (ISNS_MSG_FMT_ERR); } --- 361,365 ---- if ((portalIpKeyFlag == -1) || (portalPortKeyFlag == -1)) { ! __LOG_ERROR ("***Located only one required portal key."); return (ISNS_MSG_FMT_ERR); } *************** *** 619,631 **** else if (ddKeyIndex != -1) { ! DEBUG_0(isns_query_debug & 1, (Not implemented)); } else if (ifcpKeyIndex != -1) { ! DEBUG_0 (isns_query_debug & 1, (Not implemented)); } else if (iscsiKeyIndex != -1) { ! DEBUG_0 (isns_query_debug & 1, (Not implemented)); } else --- 619,631 ---- else if (ddKeyIndex != -1) { ! __DEBUG(isns_query_debug & 1, (Not implemented)); } else if (ifcpKeyIndex != -1) { ! __DEBUG (isns_query_debug & 1, (Not implemented)); } else if (iscsiKeyIndex != -1) { ! __DEBUG (isns_query_debug & 1, (Not implemented)); } else *************** *** 680,684 **** int rval; ! DEBUG_0 (isns_query_debug &1, SNSdbGetAttrDDEntry); dd_key.id = id; --- 680,684 ---- int rval; ! __DEBUG (isns_query_debug &1, SNSdbGetAttrDDEntry); dd_key.id = id; *************** *** 720,724 **** ISNS_LIST_NODE *pnode; ! DEBUG_0 (isns_query_debug &1, SNSdbGetAttrDD); rval = Check_Authorization (src_attr); --- 720,724 ---- ISNS_LIST_NODE *pnode; ! __DEBUG (isns_query_debug &1, SNSdbGetAttrDD); rval = Check_Authorization (src_attr); *************** *** 1053,1057 **** if (portalPortKeyFlag == -1 || portalIpKeyFlag == -1) { ! printf ("***Located only one required portal key.\n"); return (ISNS_MSG_FMT_ERR); } --- 1053,1057 ---- if (portalPortKeyFlag == -1 || portalIpKeyFlag == -1) { ! __LOG_ERROR ("***Located only one required portal key."); return (ISNS_MSG_FMT_ERR); } *************** *** 1212,1216 **** if (rval != SUCCESS) { ! DEBUG_0(isns_query_debug & 1, "***ERROR Invalid dd"); return (ISNS_NO_SUCH_ENTRY_ERR); } --- 1212,1216 ---- if (rval != SUCCESS) { ! __DEBUG(isns_query_debug & 1, "***ERROR Invalid dd"); return (ISNS_NO_SUCH_ENTRY_ERR); } *************** *** 1453,1457 **** if ((portalIpKeyFlag == -1) || (portalPortKeyFlag == -1)) { ! printf ("***Located only one required portal key.\n"); return (ISNS_INVALID_QUERY_ERR); } --- 1453,1457 ---- if ((portalIpKeyFlag == -1) || (portalPortKeyFlag == -1)) { ! __LOG_ERROR ("***Located only one required portal key."); return (ISNS_INVALID_QUERY_ERR); } *************** *** 1508,1512 **** else if (fc4TypesKeyFlag != -1) { ! DEBUG_0 (isns_query_debug & 1, (Not Implemented)); return (ERROR); } --- 1508,1512 ---- else if (fc4TypesKeyFlag != -1) { ! __DEBUG (isns_query_debug & 1, (Not Implemented)); return (ERROR); } *************** *** 1561,1565 **** int rval; ! DEBUG_1 (isns_query_debug &1,(Attribute Query - ISCSI:%s),(char *)&src_attr->val); foundFlag = FALSE; --- 1561,1565 ---- int rval; ! __DEBUG (isns_query_debug &1,(Attribute Query - ISCSI:%s),(char *)&src_attr->val); foundFlag = FALSE; *************** *** 1608,1612 **** if (nodeKeyIndex != -1) { ! DEBUG_0 (isns_query_debug &1,nodeKeyIndex); nodeKeyIndex = ISNSFindTag (0, ISNS_ISCSI_NODE_ID, key_indx); --- 1608,1612 ---- if (nodeKeyIndex != -1) { ! __DEBUG (isns_query_debug &1,nodeKeyIndex); nodeKeyIndex = ISNSFindTag (0, ISNS_ISCSI_NODE_ID, key_indx); *************** *** 1630,1634 **** if (rval == SUCCESS) { ! DEBUG_0 (isns_query_debug &1,call ISNSdbProcessICSCIOpAttr); ISNSdbProcessISCSIOpAttr (p_rspmsg, (ISNS_Attr **)attr_indx, p_node); foundFlag = TRUE; --- 1630,1634 ---- if (rval == SUCCESS) { ! __DEBUG (isns_query_debug &1,call ISNSdbProcessICSCIOpAttr); ISNSdbProcessISCSIOpAttr (p_rspmsg, (ISNS_Attr **)attr_indx, p_node); foundFlag = TRUE; *************** *** 1699,1703 **** if (p_entity->eid_type != ENTITY_TYPE_ISCSI) { ! printf ("***ERROR: Expected an iSCSI Entity.\n"); return (ERROR); } --- 1699,1703 ---- if (p_entity->eid_type != ENTITY_TYPE_ISCSI) { ! __LOG_ERROR ("***ERROR: Expected an iSCSI Entity."); return (ERROR); } *************** *** 1732,1736 **** SOIP_Portal * p_portal; ! DEBUG_0 (isns_query_debug &1,(Search for Portal)); memset (&db_portal, 0, sizeof (db_portal)); --- 1732,1736 ---- SOIP_Portal * p_portal; ! __DEBUG (isns_query_debug &1,(Search for Portal)); memset (&db_portal, 0, sizeof (db_portal)); *************** *** 1738,1742 **** if (portalPortKeyIndex == -1 || portalIpKeyIndex == -1) { ! printf ("***ERROR: Didn't have all the Portal Keys.\n"); return (ERROR); } --- 1738,1742 ---- if (portalPortKeyIndex == -1 || portalIpKeyIndex == -1) { ! __LOG_ERROR ("***ERROR: Didn't have all the Portal Keys."); return (ERROR); } *************** *** 1798,1802 **** ISNS_DBKey qkey = { 0 }; ! DEBUG_0 (isns_query_debug &1,search node table); /* Search the node table */ --- 1798,1802 ---- ISNS_DBKey qkey = { 0 }; ! __DEBUG (isns_query_debug &1,search node table); /* Search the node table */ *************** *** 1838,1842 **** return (ISNS_NO_SUCH_ENTRY_ERR); ! DEBUG_0 (isns_query_debug &1,return from GetAttrISCSI); return ISNS_NO_ERR; --- 1838,1842 ---- return (ISNS_NO_SUCH_ENTRY_ERR); ! __DEBUG (isns_query_debug &1,return from GetAttrISCSI); return ISNS_NO_ERR; *************** *** 1869,1873 **** int rval; ! DEBUG_0 (isns_query_debug &1, (ISNSGetNextAttr)); ISNSParseMsg( &p_md->msg, attr_indx, key_indx,&src_attr ); --- 1869,1873 ---- int rval; ! __DEBUG (isns_query_debug &1, (ISNSGetNextAttr)); ISNSParseMsg( &p_md->msg, attr_indx, key_indx,&src_attr ); *************** *** 1888,1892 **** { key = (ISNS_Key *)(key_indx[ii]); ! DEBUG_2 (isns_query_debug &1,(keytag:%i (%s)),key->tag,isnsTagText(key->tag)); switch (key->tag) { --- 1888,1892 ---- { key = (ISNS_Key *)(key_indx[ii]); ! __DEBUG (isns_query_debug &1,(keytag:%i (%s)),key->tag,isnsTagText(key->tag)); switch (key->tag) { *************** *** 2012,2016 **** else if ( nodeKeyIndex != -1 || iscsiIdxKeyIndex!=-1 ) { ! DEBUG_0 (isns_query_debug &1,process nodeKeyIndex); memset(&qkey, 0, sizeof(qkey)); qkey.tag = ISCSI_ID_KEY; --- 2012,2016 ---- else if ( nodeKeyIndex != -1 || iscsiIdxKeyIndex!=-1 ) { ! __DEBUG (isns_query_debug &1,process nodeKeyIndex); memset(&qkey, 0, sizeof(qkey)); qkey.tag = ISCSI_ID_KEY; *************** *** 2018,2025 **** if ( nodeKeyIndex !=-1 ) { ! DEBUG_1 (isns_query_debug &1,(nodeKeyIndex:%i),nodeKeyIndex); key=(ISNS_Key *)(key_indx[nodeKeyIndex]); ! DEBUG_1 (isns_query_debug &1,key length:%i,key->len); ! DEBUG_1 (isns_query_debug &1,key:%s,(char *)&key->val); if (key->len) { --- 2018,2025 ---- if ( nodeKeyIndex !=-1 ) { ! __DEBUG (isns_query_debug &1,(nodeKeyIndex:%i),nodeKeyIndex); key=(ISNS_Key *)(key_indx[nodeKeyIndex]); ! __DEBUG (isns_query_debug &1,key length:%i,key->len); ! __DEBUG (isns_query_debug &1,key:%s,(char *)&key->val); if (key->len) { *************** *** 2057,2062 **** while (!found) { ! DEBUG_1 (isns_query_debug &1, (GetNextOfKey:%s),(char *)&qkey.val); ! DEBUG_1 (isns_query_debug &1, (GetNextOfKey length:%i),qkey.len); if (SNSdbGetNextOfKey (&qkey) != SUCCESS) { --- 2057,2062 ---- while (!found) { ! __DEBUG (isns_query_debug &1, (GetNextOfKey:%s),(char *)&qkey.val); ! __DEBUG (isns_query_debug &1, (GetNextOfKey length:%i),qkey.len); if (SNSdbGetNextOfKey (&qkey) != SUCCESS) { *************** *** 2066,2070 **** if (rval != SUCCESS) { ! DEBUG_0 (isns_query_debug &1,(ERROR reading Key)); return rval; } --- 2066,2070 ---- if (rval != SUCCESS) { ! __DEBUG (isns_query_debug &1,(ERROR reading Key)); return rval; } *************** *** 2181,2185 **** if (rval != SUCCESS) { ! DEBUG_0 (isns_query_debug &1,(Error reading getnext)); return 0; } --- 2181,2185 ---- if (rval != SUCCESS) { ! __DEBUG (isns_query_debug &1,(Error reading getnext)); return 0; } *************** *** 2264,2268 **** if (rval != SUCCESS) { ! DEBUG_0 (isns_query_debug &1,(getnextkey error)); } --- 2264,2268 ---- if (rval != SUCCESS) { ! __DEBUG (isns_query_debug &1,(getnextkey error)); } *************** *** 2768,2776 **** q_attr = (ISNS_Attr *) attr_indx[ ii ]; ! DEBUG_1 (isns_query_debug &1, process attribute for iscsi and entity objects (%s),isnsTagText(q_attr->tag)); switch ( q_attr->tag ) { case ISNS_ISCSI_NODE_ID: ! DEBUG_1 (isns_query_debug &1,ISCSI NODE ID %s,p_node->id.v); ISNSAppendAttr ( p_msg, ISNS_ISCSI_NODE_ID, PAD4 (strlen (p_node->id.v)), p_node->id.v, 0 ); --- 2768,2776 ---- q_attr = (ISNS_Attr *) attr_indx[ ii ]; ! __DEBUG (isns_query_debug &1, process attribute for iscsi and entity objects (%s),isnsTagText(q_attr->tag)); switch ( q_attr->tag ) { case ISNS_ISCSI_NODE_ID: ! __DEBUG (isns_query_debug &1,ISCSI NODE ID %s,p_node->id.v); ISNSAppendAttr ( p_msg, ISNS_ISCSI_NODE_ID, PAD4 (strlen (p_node->id.v)), p_node->id.v, 0 ); *************** *** 2863,2872 **** if ( fetchPortalFlag ) { ! DEBUG_0 (isns_query_debug &1, (fetchPortalFlag)); /* Cycle through all portals */ pnode = NULL; while ( (pnode = GetNextNode(&p_entity->iportal_list, pnode)) ) { ! DEBUG_0 (isns_query_debug &1, Get portal record ); ISNS_DBKey read_key; read_key.tag = PORTAL_ID_KEY; --- 2863,2872 ---- if ( fetchPortalFlag ) { ! __DEBUG (isns_query_debug &1, (fetchPortalFlag)); /* Cycle through all portals */ pnode = NULL; while ( (pnode = GetNextNode(&p_entity->iportal_list, pnode)) ) { ! __DEBUG (isns_query_debug &1, Get portal record ); ISNS_DBKey read_key; read_key.tag = PORTAL_ID_KEY; *************** *** 2875,2879 **** if (rval != SUCCESS ) { ! DEBUG_0 (isns_query_debug &1, portal record not found ); return rval; } --- 2875,2879 ---- if (rval != SUCCESS ) { ! __DEBUG (isns_query_debug &1, portal record not found ); return rval; } *************** *** 2881,2885 **** p_portal = &entry5.data.portal; ! DEBUG_0 (isns_query_debug &1, Get portal group record ); memset(&key_portal_group, 0, sizeof(SOIP_Portal_Group_Key)); key_portal_group.ip_port = p_portal->ip_port; --- 2881,2885 ---- p_portal = &entry5.data.portal; ! __DEBUG (isns_query_debug &1, Get portal group record ); memset(&key_portal_group, 0, sizeof(SOIP_Portal_Group_Key)); key_portal_group.ip_port = p_portal->ip_port; *************** *** 2893,2897 **** if (rval != SUCCESS ) { ! DEBUG_0 (isns_query_debug &1, portal group record not found ); return rval; } --- 2893,2897 ---- if (rval != SUCCESS ) { ! __DEBUG (isns_query_debug &1, portal group record not found ); return rval; } *************** *** 2902,2906 **** { q_attr = (ISNS_Attr *) attr_indx[jj]; ! DEBUG_1 (isns_query_debug &1, process attribute for portal objects (%s),isnsTagText(q_attr->tag)); switch ( q_attr->tag ) --- 2902,2906 ---- { q_attr = (ISNS_Attr *) attr_indx[jj]; ! __DEBUG (isns_query_debug &1, process attribute for portal objects (%s),isnsTagText(q_attr->tag)); switch ( q_attr->tag ) *************** *** 2912,2916 **** break; case ISNS_PORTAL_IP: ! DEBUG_0 (isns_query_debug &1,Add ISNS_PORTAL_IP); ISNSAppendAttr (p_msg, ISNS_PORTAL_IP, ISNS_PORTAL_IP_SIZE, p_portal->ip_addr.v, 0); --- 2912,2916 ---- break; case ISNS_PORTAL_IP: ! __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_IP); ISNSAppendAttr (p_msg, ISNS_PORTAL_IP, ISNS_PORTAL_IP_SIZE, p_portal->ip_addr.v, 0); *************** *** 2941,2950 **** break; case ISNS_PORTAL_GROUP_PORT: ! DEBUG_1 (isns_query_debug &1,ISNS_PORTAL_GROUP_PORT:%i,p_portal->ip_port); ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_PORT, ISNS_PORTAL_GROUP_PORT_SIZE, NULL, p_portal_group->ip_port); break; case ISNS_PORTAL_GROUP_IP: ! DEBUG_0 (isns_query_debug &1,Add ISNS_PORTAL_GROUP_IP); ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_IP, ISNS_PORTAL_GROUP_IP_SIZE, p_portal_group->ip_addr.v, 0); --- 2941,2950 ---- break; case ISNS_PORTAL_GROUP_PORT: ! __DEBUG (isns_query_debug &1,ISNS_PORTAL_GROUP_PORT:%i,p_portal->ip_port); ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_PORT, ISNS_PORTAL_GROUP_PORT_SIZE, NULL, p_portal_group->ip_port); break; case ISNS_PORTAL_GROUP_IP: ! __DEBUG (isns_query_debug &1,Add ISNS_PORTAL_GROUP_IP); ISNSAppendAttr (p_msg, ISNS_PORTAL_GROUP_IP, ISNS_PORTAL_GROUP_IP_SIZE, p_portal_group->ip_addr.v, 0); *************** *** 3313,3321 **** pnode = NULL; ! DEBUG_0 (isns_query_debug &1,(Get_Active_DD_list)); while ( (pnode=GetNextNode(dd_list, pnode)) ) { ! DEBUG_0 (isns_query_debug &1,(Get_Active_DD_List - node data)); /* First, look at the Node's Local DD_LIST. */ if (flag) --- 3313,3321 ---- pnode = NULL; ! __DEBUG (isns_query_debug &1,(Get_Active_DD_list)); while ( (pnode=GetNextNode(dd_list, pnode)) ) { ! __DEBUG (isns_query_debug &1,(Get_Active_DD_List - node data)); /* First, look at the Node's Local DD_LIST. */ if (flag) *************** *** 3429,3433 **** int rval; ! DEBUG_1(isns_query_debug & 1, (Get_Active_DD_List_From_ISCSI_Node nodename=%s),nodename); /* Fetch the node */ --- 3429,3433 ---- int rval; ! __DEBUG(isns_query_debug & 1, (Get_Active_DD_List_From_ISCSI_Node nodename=%s),nodename); /* Fetch the node */ *************** *** 3482,3486 **** else { ! printf ("***ERROR: Invalid SOURCE Tag.\n"); return (ISNS_MSG_FMT_ERR); } --- 3482,3486 ---- else { ! __LOG_ERROR ("***ERROR: Invalid SOURCE Tag."); return (ISNS_MSG_FMT_ERR); } *************** *** 3521,3525 **** else { ! DEBUG_0(isns_query_debug & 1, (ISNSTouchEntity(): Not implemented)); return (ERROR); } --- 3521,3525 ---- else { ! __DEBUG(isns_query_debug & 1, (ISNSTouchEntity(): Not implemented)); return (ERROR); } *************** *** 3575,3579 **** int rval; ! DEBUG_1 (isns_query_debug &1,(Check_Permission src_node_name=%s),src_attr->val.node_name.v); /* check if control node */ --- 3575,3579 ---- int rval; ! __DEBUG (isns_query_debug &1,(Check_Permission src_node_name=%s),src_attr->val.node_name.v); /* check if control node */ *************** *** 3597,3606 **** memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! DEBUG_0 (isns_query_debug &1, call Get_Active_DD_List); Get_Active_DD_List (&pnode->dd_id_list, dlist_node, 0); if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! DEBUG_0(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } --- 3597,3606 ---- memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! __DEBUG (isns_query_debug &1, call Get_Active_DD_List); Get_Active_DD_List (&pnode->dd_id_list, dlist_node, 0); if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! __DEBUG(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } *************** *** 3621,3625 **** if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! DEBUG_0(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } --- 3621,3625 ---- if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! __DEBUG(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } *************** *** 3637,3641 **** if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! DEBUG_0(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } --- 3637,3641 ---- if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! __DEBUG(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } *************** *** 3650,3659 **** memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! DEBUG_0 (isns_query_debug &1, Get_Active_DD_List); Get_Active_DD_List (&p_port->dd_id_list, dlist_node, 0); if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! DEBUG_0(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } --- 3650,3659 ---- memset (dlist_node, 0, MAX_DD_PER_LIST*sizeof(uint32_t)); ! __DEBUG (isns_query_debug &1, Get_Active_DD_List); Get_Active_DD_List (&p_port->dd_id_list, dlist_node, 0); if (FALSE == Check_Overlap_DD (dlist_src, dlist_node)) { ! __DEBUG(isns_query_debug & 1,"src attribute not found in a Discovery Domain"); return (ISNS_AUTH_FAILED_ERR); } Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** iSNSList.c 16 Jan 2007 20:21:50 -0000 1.12 --- iSNSList.c 7 Aug 2007 14:41:47 -0000 1.13 *************** *** 148,153 **** plist->node_count = 0; ! DEBUG_1 (isns_list_debug &1,InitList list_id:%i,plist->list_id); ! DEBUG_1 (isns_list_debug &1,InitList node_count:%i,plist->node_count); return ( SUCCESS ); --- 148,153 ---- plist->node_count = 0; ! __DEBUG (isns_list_debug &1,InitList list_id:%i,plist->list_id); ! __DEBUG (isns_list_debug &1,InitList node_count:%i,plist->node_count); return ( SUCCESS ); *************** *** 162,166 **** ISNS_LIST_NODE pnode; ! DEBUG_1 (isns_list_debug &1,DeleteList list_id:%i,plist->list_id); while (!IsEmptyList(plist)) --- 162,166 ---- ISNS_LIST_NODE pnode; ! __DEBUG (isns_list_debug &1,DeleteList list_id:%i,plist->list_id); while (!IsEmptyList(plist)) *************** *** 196,200 **** ! DEBUG_0 (isns_list_debug &1,Remove Node); foundFlag = FALSE; --- 196,200 ---- ! __DEBUG (isns_list_debug &1,Remove Node); foundFlag = FALSE; *************** *** 204,208 **** while ( curr_node != NULL ) { ! DEBUG_2 (isns_list_debug &1, curr_node:%i pnode:%i,curr_node->index,pnode->index); if (curr_node->index == pnode->index ) { --- 204,208 ---- while ( curr_node != NULL ) { ! __DEBUG (isns_list_debug &1, curr_node:%i pnode:%i,curr_node->index,pnode->index); if (curr_node->index == pnode->index ) { *************** *** 215,227 **** if ( (curr_node == NULL) && (plist->node_count > 0) ) { ! DEBUG_1 (isns_list_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_list_debug &1, Remove Node FoundFlag: %i,foundFlag); if ( foundFlag ) { ! DEBUG_0 (isns_list_debug &1, FoundFlag); /* read current node */ --- 215,227 ---- if ( (curr_node == NULL) && (plist->node_count > 0) ) { ! __DEBUG (isns_list_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 (isns_list_debug &1, Remove Node FoundFlag: %i,foundFlag); if ( foundFlag ) { ! __DEBUG (isns_list_debug &1, FoundFlag); /* read current node */ *************** *** 332,336 **** /*update node_count*/ ! DEBUG_1 (isns_list_debug &1, RemoveNode - node_count:%i,plist->node_count); plist->node_count--; } --- 332,336 ---- /*update node_count*/ ! __DEBUG (isns_list_debug &1, RemoveNode - node_count:%i,plist->node_count); plist->node_count--; } *************** *** 345,349 **** GetNodeData(ISNS_LIST_NODE *pnode ) { ! DEBUG_0 (isns_list_debug &1, GetNodeData); return ( pnode->data ); } --- 345,349 ---- GetNodeData(ISNS_LIST_NODE *pnode ) { ! __DEBUG (isns_list_debug &1, GetNodeData); return ( pnode->data ); } *************** *** 357,361 **** ISNS_LIST_NODE *ptr; ! DEBUG_0 (isns_list_debug &1,FindNode); ptr = NULL; --- 357,361 ---- ISNS_LIST_NODE *ptr; ! __DEBUG (isns_list_debug &1,FindNode); ptr = NULL; *************** *** 390,394 **** SOIP_Fc_Node *p_ifcp; ! DEBUG_1 (isns_list_debug &1, AddNode - list_id:%i,plist->list_id); memset(&key,0,sizeof(ISNS_DBKey)); --- 390,394 ---- SOIP_Fc_Node *p_ifcp; ! __DEBUG (isns_list_debug &1, AddNode - list_id:%i,plist->list_id); memset(&key,0,sizeof(ISNS_DBKey)); *************** *** 469,473 **** } ! DEBUG_0 (isns_list_debug &1, update last_index); plist->last_index++; --- 469,473 ---- } ! __DEBUG (isns_list_debug &1, update last_index); plist->last_index++; *************** *** 493,497 **** plist->node_count++; ! DEBUG_1 (isns_list_debug &1, AddNode node_count:%i,plist->node_count); return ( SUCCESS ); --- 493,497 ---- plist->node_count++; ! __DEBUG (isns_list_debug &1, AddNode node_count:%i,plist->node_count); return ( SUCCESS ); *************** *** 504,508 **** IsEmptyList(ISNS_LIST *plist) { ! DEBUG_1 (isns_list_debug &1,IsEmptyList node_count:%i,plist->node_count); if (plist->node_count == 0) --- 504,508 ---- IsEmptyList(ISNS_LIST *plist) { ! __DEBUG (isns_list_debug &1,IsEmptyList node_count:%i,plist->node_count); if (plist->node_count == 0) *************** *** 531,535 **** ISNS_LIST *p_list; ! DEBUG_2 (isns_list_debug &1,GetNextNode list_id:%i node_count:%i, plist->list_id,plist->node_count); if (!plist || plist->node_count == 0) --- 531,535 ---- ISNS_LIST *p_list; ! __DEBUG (isns_list_debug &1,GetNextNode list_id:%i node_count:%i, plist->list_id,plist->node_count); if (!plist || plist->node_count == 0) *************** *** 545,554 **** if ( pnode == NULL) { ! DEBUG_0 (isns_list_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_list_debug &1,Error condition node count>0 but first_index is 0); plist->node_count = 0; return NULL; --- 545,554 ---- if ( pnode == NULL) { ! __DEBUG (isns_list_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 (isns_list_debug &1,Error condition node count>0 but first_index is 0); plist->node_count = 0; return NULL; *************** *** 558,562 **** { node = pnode; ! DEBUG_1 (isns_list_debug &1, next_index:%i,node->next_index); key.val.list.list_index = node->next_index; } --- 558,562 ---- { node = pnode; ! __DEBUG (isns_list_debug &1, next_index:%i,node->next_index); key.val.list.list_index = node->next_index; } *************** *** 564,577 **** if (key.val.list.list_index == 0) { ! DEBUG_0 (isns_list_debug &1, No More Entries in list); return NULL; } ! DEBUG_0 (isns_list_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_list_debug &1, read list entry); rval = ISNSdbRead(&key,&entry); if (rval != SUCCESS) --- 564,577 ---- if (key.val.list.list_index == 0) { ! __DEBUG (isns_list_debug &1, No More Entries in list); return NULL; } ! __DEBUG (isns_list_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 (isns_list_debug &1, read list entry); rval = ISNSdbRead(&key,&entry); if (rval != SUCCESS) *************** *** 583,587 **** node->data = (char *)ISNSAllocBuffer(node->data_size+1); memcpy(node->data,entry.data.list.key.node_name.v,node->data_size); ! DEBUG_0 (isns_list_debug &1, Successfully read list entry); } else if (plist->list_id == ENTITY_FCP_LIST) --- 583,587 ---- node->data = (char *)ISNSAllocBuffer(node->data_size+1); memcpy(node->data,entry.data.list.key.node_name.v,node->data_size); ! __DEBUG (isns_list_debug &1, Successfully read list entry); } else if (plist->list_id == ENTITY_FCP_LIST) *************** *** 714,718 **** node->p_entry = plist->p_entry; ! DEBUG_0 (isns_list_debug &1, return GetNextNode node); return node; } --- 714,718 ---- node->p_entry = plist->p_entry; ! __DEBUG (isns_list_debug &1, return GetNextNode node); return node; } Index: iSNSesi.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSesi.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** iSNSesi.c 4 Jan 2007 19:00:07 -0000 1.10 --- iSNSesi.c 7 Aug 2007 14:41:47 -0000 1.11 *************** *** 80,84 **** ISNS_DBKey read_key = { 0 }; ! DEBUG_0 (isns_esi_debug &1, ISNS_SendESI); p_md = p_rspMd; --- 80,84 ---- ISNS_DBKey read_key = { 0 }; ! __DEBUG (isns_esi_debug &1, ISNS_SendESI); p_md = p_rspMd; *************** *** 90,94 **** } ! DEBUG_0 (isns_esi_debug &1, process each portal record); read_key.tag = PORTAL_ID_KEY; --- 90,94 ---- } ! __DEBUG (isns_esi_debug &1, process each portal record); read_key.tag = PORTAL_ID_KEY; *************** *** 96,100 **** while ( SNSdbGetNextOfKey (&read_key) == SUCCESS ) { ! DEBUG_0 (isns_esi_debug &1, Next Portal Record found); rval = ISNSdbRead(&read_key,&entry2); --- 96,100 ---- while ( SNSdbGetNextOfKey (&read_key) == SUCCESS ) { ! __DEBUG (isns_esi_debug &1, Next Portal Record found); rval = ISNSdbRead(&read_key,&entry2); *************** *** 107,111 **** if ( p_portal->esi_interval == 0 ) { ! DEBUG_0 (isns_esi_debug &1, esi_interval not set); continue; } --- 107,111 ---- if ( p_portal->esi_interval == 0 ) { ! __DEBUG (isns_esi_debug &1, esi_interval not set); continue; } *************** *** 115,122 **** if (p_portal->esi_timer > 0 && (p_portal->esi_timer + p_portal->esi_interval) > mytime) { ! DEBUG_0 (isns_esi_debug &1, esi_timer plus interval not reached yet); ! DEBUG_1 (isns_esi_debug &1, esi_timer:%ld,p_portal->esi_timer); ! DEBUG_1 (isns_esi_debug &1, esi_interval:%i,p_portal->esi_interval); ! DEBUG_1 (isns_esi_debug &1, mytime:%ld,mytime); continue; } --- 115,122 ---- if (p_portal->esi_timer > 0 && (p_portal->esi_timer + p_portal->esi_interval) > mytime) { ! __DEBUG (isns_esi_debug &1, esi_timer plus interval not reached yet); ! __DEBUG (isns_esi_debug &1, esi_timer:%ld,p_portal->esi_timer); ! __DEBUG (isns_esi_debug &1, esi_interval:%i,p_portal->esi_interval); ! __DEBUG (isns_esi_debug &1, mytime:%ld,mytime); continue; } *************** *** 126,134 **** rval = ISNSdbWrite(&read_key,entry2); ! DEBUG_1 (isns_esi_debug &1, esi_timer Timer Expired esiSend:%i,p_portal->esiSent); if ( p_portal->esiSent < esi_sent_limit ) { ! DEBUG_1 (isns_esi_debug & 2, (Sending ESI to Entity %s), p_portal->entity_id.id); /* Send a msg to the client & update the counter */ --- 126,134 ---- rval = ISNSdbWrite(&read_key,entry2); ! __DEBUG (isns_esi_debug &1, esi_timer Timer Expired esiSend:%i,p_portal->esiSent); if ( p_portal->esiSent < esi_sent_limit ) { ! __DEBUG (isns_esi_debug & 2, (Sending ESI to Entity %s), p_portal->entity_id.id); /* Send a msg to the client & update the counter */ *************** *** 162,166 **** } ! DEBUG_1 (isns_esi_debug & 2, (Call ISNSSendMsg to Send ESI to Entity %s), p_portal->entity_id.id); rval = ISNSSendMsg ( p_md ); } --- 162,166 ---- } ! __DEBUG (isns_esi_debug & 2, (Call ISNSSendMsg to Send ESI to Entity %s), p_portal->entity_id.id); rval = ISNSSendMsg ( p_md ); } *************** *** 168,174 **** else { ! DEBUG_0 (isns_esi_debug &1,esi timed out - remove portal record); ! DEBUG_1 (isns_esi_debug &1,portal ip_addr:%s,inet_ntoa(*(struct in_addr *)(p_portal->ip_addr.v+12)) ); ! DEBUG_1 (isns_esi_debug &1,port:%i,p_portal->ip_port); /* remove portal */ --- 168,174 ---- else { ! __DEBUG (isns_esi_debug &1,esi timed out - remove portal record); ! __DEBUG (isns_esi_debug &1,portal ip_addr:%s,inet_ntoa(*(struct in_addr *)(p_portal->ip_addr.v+12)) ); ! __DEBUG (isns_esi_debug &1,port:%i,p_portal->ip_port); /* remove portal */ *************** *** 203,207 **** ISNS_DBKey update_key; ! DEBUG_0 (isns_esi_debug &1, ISNS_ProcessESI); ISNSParseMsg( &p_md->msg, attr_indx, key_indx, NULL ); --- 203,207 ---- ISNS_DBKey update_key; ! __DEBUG (isns_esi_debug &1, ISNS_ProcessESI); ISNSParseMsg( &p_md->msg, attr_indx, key_indx, NULL ); *************** *** 209,213 **** if (i == -1) { ! DEBUG_0 (isns_esi_debug & 1, (Entity ID tag not found in msg)); return ( ERROR ); } --- 209,213 ---- if (i == -1) { ! __DEBUG (isns_esi_debug & 1, (Entity ID tag not found in msg)); return ( ERROR ); } *************** *** 231,236 **** p_entity->timestamp.t_pad = 0; p_entity->timestamp.t_time = mytime; ! DEBUG_1 (isns_esi_debug &1,(Time in seconds since UTC 1/1/70: %ld),mytime); ! DEBUG_1 (isns_esi_debug &1,(UNIX time and date: %s),ctime(&mytime) ); /* Store Entry */ --- 231,236 ---- p_entity->timestamp.t_pad = 0; p_entity->timestamp.t_time = mytime; ! __DEBUG (isns_esi_debug &1,(Time in seconds since UTC 1/1/70: %ld),mytime); ! __DEBUG (isns_esi_debug &1,(UNIX time and date: %s),ctime(&mytime) ); /* Store Entry */ *************** *** 243,247 **** if ( i == -1 ) { ! DEBUG_0 (isns_esi_debug & 1, (Portal IP tag not found in msg)); return ( ERROR ); } --- 243,247 ---- if ( i == -1 ) { ! __DEBUG (isns_esi_debug & 1, (Portal IP tag not found in msg)); return ( ERROR ); } *************** *** 252,256 **** if (i == -1) { ! DEBUG_0 (isns_esi_debug & 1, (Portal PORT tag not found in msg)); return ( ERROR ); } --- 252,256 ---- if (i == -1) { ! __DEBUG (isns_esi_debug & 1, (Portal PORT tag not found in msg)); return ( ERROR ); } Index: iSNSipc.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSipc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSipc.c 1 Dec 2006 15:35:17 -0000 1.4 --- iSNSipc.c 7 Aug 2007 14:41:47 -0000 1.5 *************** *** 40,43 **** --- 40,44 ---- #include "iSNSmsg.h" #include "iSNSipc.h" + #include "iSNSdebug.h" /* *************** *** 84,88 **** if (ipc_ep[ep_name].s < 0) { ! printf("Error: While calling socket.\n"); return (ERROR); } --- 85,89 ---- if (ipc_ep[ep_name].s < 0) { ! __LOG_ERROR ("Error: While calling socket."); return (ERROR); } *************** *** 91,95 **** sizeof (my_addr)) < 0) { ! printf ("Fatal Error while Binding.\n"); return (0); } --- 92,96 ---- sizeof (my_addr)) < 0) { ! __LOG_ERROR ("Fatal Error while Binding."); return (0); } *************** *** 130,134 **** if (cnt < 0) { ! printf("Error: sendto.\n"); exit(1); } --- 131,135 ---- if (cnt < 0) { ! __LOG_ERROR ("Error: sendto."); exit(1); } *************** *** 170,174 **** if (cnt < 0) { ! printf("Receive error.\n"); exit(1); } --- 171,175 ---- if (cnt < 0) { ! __LOG_ERROR ("Receive error."); exit(1); } Index: iSNSrcv.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSrcv.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSrcv.c 8 Dec 2006 20:05:50 -0000 1.3 --- iSNSrcv.c 7 Aug 2007 14:41:47 -0000 1.4 *************** *** 47,50 **** --- 47,53 ---- #include "iSNSdebug.h" + + extern int isns_main_debug; + int sns_recv_debug = 0; int sns_recv_msg_filter = 0; *************** *** 102,106 **** memset((char *)&frag_md, 0, sizeof(ISNS_Msg_Descp)); ! printf("Starting SNSReceiveMain thread.\n"); /* * Wait for a message to arrive on the socket. --- 105,109 ---- memset((char *)&frag_md, 0, sizeof(ISNS_Msg_Descp)); ! __DEBUG (isns_main_debug & 1, "Starting SNSReceiveMain thread."); /* * Wait for a message to arrive on the socket. *************** *** 128,132 **** /* got another while waiting: drop previous message */ sns_recv_num_dropped++; ! printf("dropped frame %d\n", sns_recv_num_dropped); awaiting_fragment = 0; frag_len = 0; --- 131,135 ---- /* got another while waiting: drop previous message */ sns_recv_num_dropped++; ! __LOG_ERROR("dropped frame %d", sns_recv_num_dropped); awaiting_fragment = 0; frag_len = 0; *************** *** 145,149 **** sns_recv_num_dropped++; ! printf("dropped frame %d\n", sns_recv_num_dropped); awaiting_fragment = 0; frag_len = 0; --- 148,152 ---- sns_recv_num_dropped++; ! __LOG_ERROR("dropped frame %d", sns_recv_num_dropped); awaiting_fragment = 0; frag_len = 0; *************** *** 181,187 **** * SNS_VERSION, p_msg->hdr.version, 0); */ ! printf("NOTE: Newer version (v %d) of iSNS detected in the", p_msg->hdr.version); ! printf("network. Current version is v %d.\n", (int)SNS_VERSION); first_warn = FALSE; --- 184,190 ---- * SNS_VERSION, p_msg->hdr.version, 0); */ ! __LOG_WARNING("NOTE: Newer version (v %d) of iSNS detected in the", p_msg->hdr.version); ! __LOG_WARNING("network. Current version is v %d.", (int)SNS_VERSION); first_warn = FALSE; *************** *** 193,197 **** IPC_MSG_PRI_HI) == ERROR) { ! printf ("%s %d: Error forwarding fsm message (xid %d)\n", __FILE__, __LINE__, p_msg->hdr.xid); } --- 196,200 ---- IPC_MSG_PRI_HI) == ERROR) { ! __LOG_ERROR ("%s %d: Error forwarding fsm message (xid %d)", __FILE__, __LINE__, p_msg->hdr.xid); } *************** *** 203,207 **** p_msg->hdr.msg_len, 0) == ERROR) { ! printf ("%s %d: Error forwarding res message (xid %d)\n", __FILE__, __LINE__, p_msg->hdr.xid); } --- 206,210 ---- p_msg->hdr.msg_len, 0) == ERROR) { ! __LOG_ERROR ("%s %d: Error forwarding res message (xid %d)", __FILE__, __LINE__, p_msg->hdr.xid); } *************** *** 210,214 **** sns_recv_num_cli_fwd++; sns_recv_num_dropped++; ! printf("dropped frame %d\n", sns_recv_num_dropped); } } --- 213,217 ---- sns_recv_num_cli_fwd++; sns_recv_num_dropped++; ! __LOG_ERROR("dropped frame %d", sns_recv_num_dropped); } } *************** *** 219,223 **** p_msg->hdr.msg_len, 0) == ERROR) { ! printf ("%s %d: Error forwarding op message (xid %d)\n", __FILE__, __LINE__, p_msg->hdr.xid); } --- 222,226 ---- p_msg->hdr.msg_len, 0) == ERROR) { ! __LOG_ERROR ("%s %d: Error forwarding op message (xid %d)", __FILE__, __LINE__, p_msg->hdr.xid); } *************** *** 225,234 **** { sns_recv_num_dropped++; ! printf("dropped frame %d\n", sns_recv_num_dropped); } } else { ! printf ("%s %d: Socket Error\n", __FILE__, __LINE__); taskDelay(1*sysClkRateGet()); } --- 228,237 ---- { sns_recv_num_dropped++; ! __LOG_ERROR("dropped frame %d", sns_recv_num_dropped); } } else { ! __LOG_ERROR ("Socket Error"); taskDelay(1*sysClkRateGet()); } *************** *** 252,257 **** display_debug = (p_md->msg.hdr.type == sns_recv_msg_filter); ! DEBUG_4 (display_debug, (recv msg %d, len %d, xid %d from %s), ! p_md->msg.hdr.type, p_md->msg.hdr.msg_len, p_md->msg.hdr.xid, dot_not_addr); --- 255,259 ---- display_debug = (p_md->msg.hdr.type == sns_recv_msg_filter); ! __DEBUG (display_debug, "recv msg %d, len %d, xid %d from %s", p_md->msg.hdr.type, p_md->msg.hdr.msg_len, p_md->msg.hdr.xid, dot_not_addr); *************** *** 280,301 **** int ii, jj; ! printf("SNSReceiveMain num dropped %d\n", sns_recv_num_dropped); ! printf("SNSReceiveMain num pri res %d\n", sns_recv_num_pri_res); ! printf("SNSReceiveMain num cli fwd %d\n", sns_recv_num_cli_fwd); ! printf("Msgs received:\n"); if ((num_display < 0) || (num_display > ARRAY_DEPTH)) num_display = ARRAY_DEPTH; for (ii = 0; ii < num_display; ii++) { ! printf("time %08x, src %08x\n", sns_recv_msg_array[ii][0], sns_recv_msg_array[ii][1]); for (jj = 0; jj < ARRAY_WIDTH; jj++) { ! printf("%08x ", sns_recv_msg_array[ii][2 + jj]); if (jj == 7) ! printf("\n\t"); } - printf("\n"); } } --- 282,302 ---- int ii, jj; ! __LOG_INFO("SNSReceiveMain num dropped %d", sns_recv_num_dropped); ! __LOG_INFO("SNSReceiveMain num pri res %d", sns_r... [truncated message content] |