From: Robert W. <wrw...@us...> - 2007-08-13 22:56:54
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26510/isnsclient/src Modified Files: isns.c main.c main_ui.c parse.c payloads.c Log Message: add attribute copy checking Index: main_ui.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/main_ui.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main_ui.c 2 Feb 2007 23:21:38 -0000 1.1 --- main_ui.c 13 Aug 2007 22:56:44 -0000 1.2 *************** *** 73,77 **** -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\ --- 73,77 ---- -h Listen for L2 heartbeat from an iSNS.\n\ -a ip iSNS Address.\n\ ! //-u TCP mode.\n\ -p port Port used for sending. Default is port 3205.\n\ -? Help.\n\ *************** *** 102,106 **** /* Default Values */ isns_port = ISNS_SERVER_PORT; ! tcpFlag = FALSE; enableESIFlag = TRUE; hb_flag = FALSE; --- 102,107 ---- /* Default Values */ isns_port = ISNS_SERVER_PORT; ! // tcpFlag = FALSE; ! tcpFlag = TRUE; enableESIFlag = TRUE; hb_flag = FALSE; Index: payloads.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/payloads.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** payloads.c 30 Mar 2007 22:55:22 -0000 1.4 --- payloads.c 13 Aug 2007 22:56:44 -0000 1.5 *************** *** 50,54 **** queryDDS (char *id) { ! char buffer[1024]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof(cmd), 0); --- 50,54 ---- queryDDS (char *id) { ! char buffer[MAX_PAYLOAD_SIZE]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof(cmd), 0); *************** *** 85,89 **** queryDD (char *id) { ! char buffer[1024]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof(cmd), 0); --- 85,89 ---- queryDD (char *id) { ! char buffer[MAX_PAYLOAD_SIZE]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof(cmd), 0); *************** *** 412,416 **** queryISCSI (char * id) { ! char buffer[2048]; if (strlen(id) ) --- 412,416 ---- queryISCSI (char * id) { ! char buffer[MAX_PAYLOAD_SIZE]={0}; if (strlen(id) ) *************** *** 446,450 **** queryEntity (void) { ! char buffer[2048]; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof (cmd), 0); --- 446,450 ---- queryEntity (void) { ! char buffer[MAX_PAYLOAD_SIZE]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof (cmd), 0); *************** *** 466,470 **** queryPortal (void) { ! char buffer[2048]; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof (cmd), 0); --- 466,470 ---- queryPortal (void) { ! char buffer[MAX_PAYLOAD_SIZE]={0}; ISNSCreateHdr (ISNS_DEV_ATTR_QRY_REQ, &cmd, sizeof (cmd), 0); Index: main.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.c 30 Mar 2007 22:55:22 -0000 1.5 --- main.c 13 Aug 2007 22:56:44 -0000 1.6 *************** *** 75,82 **** 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\ -q type Query\n\ type: dds\n\ --- 75,82 ---- Options:\n\ -h Listen for L2 heartbeat from an iSNS.\n\ + -? Help.\n\ + \n\ -a ip iSNS Address.\n\ -p port Port used for sending. Default is port 3205.\n\ -q type Query\n\ type: dds\n\ *************** *** 129,133 **** /* Default Values */ isns_port = ISNS_SERVER_PORT; ! tcpFlag = FALSE; enableESIFlag = TRUE; hb_flag = FALSE; --- 129,134 ---- /* Default Values */ isns_port = ISNS_SERVER_PORT; ! //tcpFlag = FALSE; ! tcpFlag = TRUE; enableESIFlag = TRUE; hb_flag = FALSE; Index: isns.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/isns.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** isns.c 16 Jan 2007 20:22:54 -0000 1.9 --- isns.c 13 Aug 2007 22:56:44 -0000 1.10 *************** *** 238,242 **** GetDDS (void) { ! char buffer[2048]; char cmdLine[256]; int id; --- 238,242 ---- GetDDS (void) { ! char buffer[MAX_PAYLOAD_SIZE]; char cmdLine[256]; int id; *************** *** 310,314 **** pdu = (struct isns_hdr *)buffer; ptr = buffer + sizeof (ISNS_HDR) + 4; ! while (ptr < buffer + sizeof (ISNS_HDR) + pdu->len) { p_attr = (struct ISNS_attr *)ptr; --- 310,316 ---- pdu = (struct isns_hdr *)buffer; ptr = buffer + sizeof (ISNS_HDR) + 4; ! printf("pdu->len:%d\n",pdu->len); ! ! while (ptr < (buffer + sizeof (ISNS_HDR) + pdu->len) ) { p_attr = (struct ISNS_attr *)ptr; *************** *** 360,364 **** GetDD (void) { ! char buffer[2048]; char cmdLine[256]; int id; --- 362,366 ---- GetDD (void) { ! char buffer[MAX_PAYLOAD_SIZE]; char cmdLine[256]; int id; *************** *** 938,958 **** ISNSAppendAttr (&cmd, ISNS_PORT_NAME, 8, cmdLine, 0); ! scn_bitmap_type = ISNS_ENTITY_SCN_BITMAP; ! } ! else if (key_type == 2) ! { ! c_size = ! GetInput (cmdLine, "Entity ID", "(none)", sizeof (cmdLine)); ! if (c_size == 0) ! { ! printf ("***ERROR: You must enter a node id.\n"); ! return; ! } ! ! ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), ! cmdLine, 0); ! ! scn_bitmap_type = ISNS_ENTITY_SCN_BITMAP; } else if (key_type == 3) { --- 940,960 ---- ISNSAppendAttr (&cmd, ISNS_PORT_NAME, 8, cmdLine, 0); ! scn_bitmap_type = ISNS_ISCSI_SCN_BITMAP; } + // else if (key_type == 2) + // { + // c_size = + // GetInput (cmdLine, "Entity ID", "(none)", sizeof (cmdLine)); + // if (c_size == 0) + // { + // printf ("***ERROR: You must enter a node id.\n"); + // return; + // } + // + // ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), + // cmdLine, 0); + // + // scn_bitmap_type = ISNS_ENTITY_SCN_BITMAP; + // } else if (key_type == 3) { *************** *** 1214,1236 **** else if (src_type == 3) { ! if (0 == ! GetInput (cmdLine, "KEY: Entity ID", "(none)", ! sizeof (cmdLine))) ! { ! return (-1); ! } ! ! ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), cmdLine, ! 0); ! ! if (0 != ! GetInput (cmdLine, "Event Bitmap (int)", "0x1F", sizeof (cmdLine))) ! { ! scn_bitmap = atoi (cmdLine); ! } ! ! ISNSAppendAttr (&cmd, 0, 0, NULL, 0); ! ! ISNSAppendAttr (&cmd, ISNS_ENTITY_SCN_BITMAP, 4, NULL, scn_bitmap); } --- 1216,1238 ---- else if (src_type == 3) { ! // if (0 == ! // GetInput (cmdLine, "KEY: Entity ID", "(none)", ! // sizeof (cmdLine))) ! // { ! // return (-1); ! // } ! // ! // ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (cmdLine)), cmdLine, ! // 0); ! // ! // if (0 != ! // GetInput (cmdLine, "Event Bitmap (int)", "0x1F", sizeof (cmdLine))) ! // { ! // scn_bitmap = atoi (cmdLine); ! // } ! // ! // ISNSAppendAttr (&cmd, 0, 0, NULL, 0); ! // ! // ISNSAppendAttr (&cmd, ISNS_ENTITY_SCN_BITMAP, 4, NULL, scn_bitmap); } *************** *** 1408,1412 **** static char currentValue2[256]={0}; ! char buffer[1024]={0}; char cmdLine[256]={0}; --- 1410,1414 ---- static char currentValue2[256]={0}; ! char buffer[MAX_PAYLOAD_SIZE]={0}; char cmdLine[256]={0}; Index: parse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/parse.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** parse.c 16 Jan 2007 20:22:54 -0000 1.7 --- parse.c 13 Aug 2007 22:56:44 -0000 1.8 *************** *** 98,102 **** case ISNS_PROT_VER : return("Protocol Version Range"); case ISNS_ENTITY_PERIOD : return("Entity Period"); - case ISNS_ENTITY_SCN_BITMAP : return("Entity SCN Bitmap"); case ISNS_ENTITY_CERT : return("Entity Certificate"); case ISNS_PORTAL_IP : return("Portal IP-Address"); --- 98,101 ---- *************** *** 315,319 **** ntohl(p_attr->val.etype)?"Enabled":"Disabled"); break; - case ISNS_ENTITY_SCN_BITMAP : case ISNS_ENTITY_CERT : case ISNS_PORTAL_CERT : --- 314,317 ---- |