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-11 04:40:04
|
Update of /cvsroot/linuxisns/iscsiClient/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3328/include Modified Files: initiator.h isns.h target.h Log Message: upgrade to latest rfc Index: isns.h =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/include/isns.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** isns.h 2 Apr 2002 02:57:40 -0000 1.1.1.1 --- isns.h 11 Dec 2006 04:27:37 -0000 1.2 *************** *** 207,212 **** #define MAX_SEND (1024*1024) ! #define ISNS_SERVER_PORT (60000) ! #define ISNS_HEARTBEAT_PORT (60001) #define ISNS_VERSION 1 --- 207,212 ---- #define MAX_SEND (1024*1024) ! #define ISNS_SERVER_PORT (3205) ! #define ISNS_HEARTBEAT_PORT (3206) #define ISNS_VERSION 1 Index: target.h =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/include/target.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** target.h 2 Apr 2002 02:57:40 -0000 1.1.1.1 --- target.h 11 Dec 2006 04:27:37 -0000 1.2 *************** *** 59,66 **** } target; - int InitTarget (target*, char*, int); - void RegTarget (target*); void InitializeTarget (target*); void ReadFile (FILE *, target *, char*); void TargetRegISCSI (target *); int TargetRegDD (target *); --- 59,67 ---- } target; void InitializeTarget (target*); + int Read_cfg (target*, char*); void ReadFile (FILE *, target *, char*); + + void RegTarget (target*); void TargetRegISCSI (target *); int TargetRegDD (target *); *************** *** 70,76 **** void TargetAdd_ISCSI_to_DD (target*); void TargetAdd_ISCSI_to_DD2 (target *); ! int TargetSendCmd (ISNS_CMD*, char*, int, target*); ! void TargetParseQuery (char *, target*); ! int InitCommunications( int hb_flag, int t_flag, int file_flag); #endif --- 71,75 ---- void TargetAdd_ISCSI_to_DD (target*); void TargetAdd_ISCSI_to_DD2 (target *); ! void ParseQuery (char *, target*); #endif Index: initiator.h =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/include/initiator.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** initiator.h 2 Apr 2002 02:57:40 -0000 1.1.1.1 --- initiator.h 11 Dec 2006 04:27:37 -0000 1.2 *************** *** 50,54 **** void RegInitiator (initiator*); void InitializeInitiator (initiator*); ! void ParseTargetQuery (char *, initiator*); void GetTargets (initiator*); void InitiatorRegISCSI (initiator*); --- 50,54 ---- void RegInitiator (initiator*); void InitializeInitiator (initiator*); ! void ParseQuery (char *, initiator*); void GetTargets (initiator*); void InitiatorRegISCSI (initiator*); |
From: Robert W. <wrw...@us...> - 2006-12-11 04:37:54
|
Update of /cvsroot/linuxisns/iscsiClient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3328/src Modified Files: initiator.c target.c Log Message: upgrade to latest rfc Index: initiator.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/initiator.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** initiator.c 11 Dec 2006 00:42:28 -0000 1.3 --- initiator.c 11 Dec 2006 04:27:37 -0000 1.4 *************** *** 73,77 **** int c; int tcpFlag; ! memset (p_ip, 0, sizeof (p_ip)); /* Default Values */ --- 73,79 ---- int c; int tcpFlag; ! initiator junk; ! ! memset (p_ip, 0, sizeof (p_ip)); /* Default Values */ *************** *** 97,195 **** } /* Init the Communications sockets */ ! if (-1==InitCommunications(hb_flag, tcpFlag)) exit(-1); return (0); } - /***********************************************************************/ - /* Initializes communications */ - /***********************************************************************/ - int - InitCommunications( int hb_flag, /* Set to non-zero if using heartbeat to find iSNS */ - int t_flag /* Set to non-zero if using TCP */) - { - int result; - pthread_t thread1; - initiator junk; - - tcpFlag=t_flag; - - hb_flag = InitInitiator (&junk, p_ip); - - if (hb_flag) - { - if (-1==HeartBeatListener()) - exit(-1); - } - - /*if (tcpFlag)*/ - { - /* TCP Mode */ - if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) - { - perror ("Fatal Error while calling socket"); - exit(-1); - } - - /* Setup Variables, Addresses, Etc. */ - their_addr.sin_family = AF_INET; /* host byte order */ - their_addr.sin_port = htons ((short) isns_port); /* short, network byte order */ - their_addr.sin_addr.s_addr = inet_addr (p_ip); - - /* Do a Connect */ - printf ("Connecting to %s...\n", p_ip); - if (connect (fd, (struct sockaddr *) &their_addr, sizeof (their_addr)) < 0) - - { - printf ("Fatal Error: Connect.\n"); - exit(-1); - } - - /* Spawn TCP Recv Thread*/ - { - /*DWORD junk;*/ - result = pthread_create (&thread1, NULL, (void*) (TCPReceiveMain) , NULL); - if (result != 0) - printf ("\n\nThread Creation Failed!\n\n"); - - - } - - } - - RegInitiator (&junk); - - return (0); - } /************************************************************************* *************************************************************************/ ! ! ! int InitInitiator (initiator* hold, char ip[]) { FILE* InitiatorFile; - InitializeInitiator (hold); - - /* Open the file for reading */ - InitiatorFile = fopen ("init.cfg", "r"); - - /* Read in the target information */ - ReadFile (InitiatorFile, hold, ip); - - fclose (InitiatorFile); - - return hold->hb_flag; - } - - - /************************************************************** - **************************************************************/ - - void InitializeInitiator (initiator* current) - { current->hb_flag = TRUE; memset (current->InitID, (int) NULL, 256); --- 99,120 ---- } + hb_flag = InitInitiator (&junk, p_ip); + /* Init the Communications sockets */ ! if (InitComm(hb_flag, 0, tcpFlag)) exit(-1); + RegInitiator (&junk); + return (0); } /************************************************************************* *************************************************************************/ ! int InitInitiator (initiator* current, char ip[]) { FILE* InitiatorFile; current->hb_flag = TRUE; memset (current->InitID, (int) NULL, 256); *************** *** 200,203 **** --- 125,138 ---- current->EntityPeriod = 0; memset (current->EntityID, (int) NULL, 256); + + /* Open the file for reading */ + InitiatorFile = fopen ("init.cfg", "r"); + + /* Read in the target information */ + ReadFile (InitiatorFile, current, ip); + + fclose (InitiatorFile); + + return current->hb_flag; } *************** *** 282,285 **** --- 217,223 ---- ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd), ISNS_FLAG_REPLACE_REG); + /* src attribute */ + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + /* delimiter */ ISNSAppendAttr (&cmd, 0, 0, NULL, 0); *************** *** 316,326 **** ISNSAppendAttr (&cmd, ISNS_ISCSI_TYPE, 4, NULL, type); ! /*InitiatorSendCmd (&cmd, buffer, sizeof (buffer), input);*/ ! ! if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) { ! /* This will parse the query rsp msg into ! a human readable format. */ ! ParseTargetQuery (buffer, input); } } --- 254,260 ---- ISNSAppendAttr (&cmd, ISNS_ISCSI_TYPE, 4, NULL, type); ! if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) { ! ParseQuery (buffer, input); } } *************** *** 335,338 **** --- 269,273 ---- int ip; int port_type; + char buffer[2048]; /* Insert Header */ *************** *** 340,343 **** --- 275,281 ---- ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd), ISNS_FLAG_REPLACE_REG); + /* src attribute */ + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (current->EntityID)), current->EntityID, 0); *************** *** 362,367 **** current->Port | (port_type == 1 ? 0 : 0x10000)); ! ISNSSendCmd (&cmd); ! } --- 300,307 ---- current->Port | (port_type == 1 ? 0 : 0x10000)); ! if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) ! { ! ParseQuery (buffer, current); ! } } *************** *** 404,410 **** if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) { ! /* This will parse the query rsp msg into ! a human readable format. */ ! ParseTargetQuery (buffer, current); } } --- 344,348 ---- if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) { ! ParseQuery (buffer, current); } } *************** *** 415,419 **** query msg. ***********************************************/ ! void ParseTargetQuery (char *buffer, initiator* current) { ISNS_Attr *p_attr; --- 353,357 ---- query msg. ***********************************************/ ! void ParseQuery (char *buffer, initiator* current) { ISNS_Attr *p_attr; *************** *** 467,522 **** fclose (OutputFile); } - - - /***********************************************************************/ - /* This will send a PDU and wait for a rsp. The rsp will be returned. */ - /***********************************************************************/ - int InitiatorSendCmd (ISNS_CMD * cmd, char *rcvBuffer, int rcvSize, initiator* member) - { - int e; - int len = cmd->hdr.len + sizeof (ISNS_HDR); - int errorCode; - int* tempint; - - cmd->hdr.len = htons (cmd->hdr.len); - e = SendPDU (cmd, len); - if (e < 0) - { - printf ("Error Sending.\n"); - } - printf("PDU sent-->\n"); - DumpHex (cmd, len); - e = RcvPDU ((struct cmd *)rcvBuffer, rcvSize); - - if (e < 0) - { - printf ("Error Receiving.\n"); - } - printf("PDU rcv-->\n"); - DumpHex (rcvBuffer, e); - - { - char *ptr = (char *) rcvBuffer + sizeof (ISNS_HDR); - errorCode = ntohl (*(uint32_t *) ptr); - } - if (errorCode != 0) - { - printf ("***WARNING: iSNS returned an error, error=%#x.\n", errorCode); - } - else - { - ISNS_HDR *p_cmd; - - p_cmd = (struct isns_hdr *)rcvBuffer; - - /* Convert fields */ - p_cmd->flags = ntohs (p_cmd->flags); - p_cmd->func_id = ntohs (p_cmd->func_id); - p_cmd->len = ntohs (p_cmd->len); - p_cmd->seq = ntohs (p_cmd->seq); - p_cmd->version = ntohs (p_cmd->version); - p_cmd->xid = ntohs (p_cmd->xid); - } - - return (errorCode); - } --- 405,406 ---- Index: target.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/target.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** target.c 11 Dec 2006 00:42:28 -0000 1.3 --- target.c 11 Dec 2006 04:27:37 -0000 1.4 *************** *** 55,59 **** **************************************/ char p_ip[256]; ! char filename[MAX_FILENAME_SIZE]; /******************************** --- 55,59 ---- **************************************/ char p_ip[256]; ! char filename[MAX_FILENAME_SIZE]="target.cfg"; /******************************** *************** *** 77,83 **** int c; int tcpFlag; ! int namedFile = FALSE; ! memset (p_ip, 0, sizeof (p_ip)); /* Default Values */ --- 77,83 ---- int c; int tcpFlag; ! target junk; ! memset (p_ip, 0, sizeof (p_ip)); /* Default Values */ *************** *** 98,102 **** printf ("filename: %s\n", filename); filename[MAX_FILENAME_SIZE - 1] = '\0'; - namedFile = TRUE; break; --- 98,101 ---- *************** *** 111,182 **** } /* Init the Communications sockets */ ! if (-1==InitCommunications(hb_flag, tcpFlag, namedFile)) exit(-1); printf ("Using iSNS IP: %s.\n", p_ip); ! return (0); ! } ! ! ! /***********************************************************************/ ! /* Initializes communications */ ! /***********************************************************************/ ! int InitCommunications( int hb_flag, /* Set to non-zero if using heartbeat to find iSNS */ ! int t_flag, /* Set to non-zero if using TCP */ ! int file_flag /* Set to non-zero of a file name was specified */) ! { ! int result; ! pthread_t thread1; ! target junk; ! ! tcpFlag=t_flag; ! ! hb_flag = InitTarget (&junk, (char*)&p_ip, file_flag); ! ! if (hb_flag) ! { ! if (-1==HeartBeatListener()) ! exit(-1); ! } ! ! /*if (tcpFlag)*/ ! { ! /* TCP Mode */ ! if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) ! { ! perror ("Fatal Error while calling socket"); ! exit(-1); ! } ! ! /* Setup Variables, Addresses, Etc. */ ! their_addr.sin_family = AF_INET; /* host byte order */ ! their_addr.sin_port = htons ((short) isns_port); /* short, network byte order */ ! their_addr.sin_addr.s_addr = inet_addr (p_ip); ! ! /* Do a Connect */ ! printf ("Connecting to %s...\n", p_ip); ! if (connect (fd, (struct sockaddr *) &their_addr, sizeof (their_addr)) < 0) ! ! { ! printf ("Fatal Error: Connect.\n"); ! exit(-1); ! } ! ! /* Spawn TCP Recv Thread*/ ! { ! /*DWORD junk;*/ ! result = pthread_create (&thread1, NULL, (void*) (TCPReceiveMain) , NULL); ! if (result != 0) ! printf ("\n\nThread Creation Failed!\n\n"); ! } ! ! } - /* RegTarget is where the actual work gets done - i.e. Registering a target, portal, DD, DDS, etc. */ - RegTarget (&junk); - return (0); } --- 110,123 ---- } + hb_flag = Read_cfg (&junk, (char*)&p_ip); + /* Init the Communications sockets */ ! if (InitComm(hb_flag, 0, tcpFlag)) exit(-1); printf ("Using iSNS IP: %s.\n", p_ip); ! RegTarget (&junk); return (0); } *************** *** 187,225 **** Waiting for a heartbeat or not */ /***********************************************************************/ ! extern char filename[]; ! int InitTarget (target* holding, char* ip, int FileFlag) { FILE* targetFile; - int x; /* Set the target values to appropriate defaults */ - InitializeTarget (holding); - - /* Open the file for reading */ - if (FileFlag == TRUE) - { - targetFile = fopen (filename, "r"); - } - else - { - targetFile = fopen ("target.cfg", "r"); - } - - /* Read in the target information*/ - ReadFile (targetFile, holding, ip); - - fclose (targetFile); - - /* Return whether we are waiting for a heartbeat or not */ - return holding->hb_flag; - } - - - /***********************************************************************/ - /* Initializes the target to values that we check on later */ - /***********************************************************************/ - - void InitializeTarget (target* Target) - { Target->listPtr = NULL; Target->DDmember = 0; --- 128,136 ---- Waiting for a heartbeat or not */ /***********************************************************************/ ! int Read_cfg (target* Target, char* ip) { FILE* targetFile; /* Set the target values to appropriate defaults */ Target->listPtr = NULL; Target->DDmember = 0; *************** *** 235,242 **** memset (Target->Alias, (int) NULL, 256); memset (Target->Initiator, (int) NULL, 256); } - - /*********************************************************************** Accepts a pointer to an open file and a target object - see target.h --- 146,162 ---- memset (Target->Alias, (int) NULL, 256); memset (Target->Initiator, (int) NULL, 256); + + /* Open the file for reading */ + targetFile = fopen (filename, "r"); + + /* Read in the target information*/ + ReadFile (targetFile, Target, ip); + + fclose (targetFile); + + /* Return whether we are waiting for a heartbeat or not */ + return Target->hb_flag; } /*********************************************************************** Accepts a pointer to an open file and a target object - see target.h *************** *** 300,305 **** /***********************************************************************/ /***********************************************************************/ - - void RegTarget (target* holding) { --- 220,223 ---- *************** *** 353,356 **** --- 271,276 ---- ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd), ISNS_FLAG_REPLACE_REG); + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + /* delimiter */ ISNSAppendAttr (&cmd, 0, 0, NULL, 0); *************** *** 390,394 **** /* Send the command, parse the response. We will get the entity ID back from this */ ! TargetSendCmd (&cmd, buffer, sizeof (buffer), input); } --- 310,316 ---- /* Send the command, parse the response. We will get the entity ID back from this */ ! ! if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) ! ParseQuery (buffer, input); } *************** *** 406,409 **** --- 328,333 ---- ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd), ISNS_FLAG_REPLACE_REG); + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + /* We are adding a portal to our target's entity */ ISNSAppendAttr (&cmd, ISNS_ENTITY_ID, PAD4 (strlen (current->EntityID)), *************** *** 457,463 **** ISNSAppendAttr (&cmd, ISNS_DD_SYM_NAME, PAD4 (strlen ((char*)current->TargetID)), (char*)current->TargetID, 0); ! /* Send the command and wait for a reply. ! This will set the Target's DD ID */ ! return TargetSendCmd (&cmd, buffer, sizeof (buffer), current); } --- 381,388 ---- ISNSAppendAttr (&cmd, ISNS_DD_SYM_NAME, PAD4 (strlen ((char*)current->TargetID)), (char*)current->TargetID, 0); ! if(0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) ! ParseQuery (buffer, current); ! ! return 0; } *************** *** 493,499 **** status = 1; ISNSAppendAttr (&cmd, ISNS_DDS_STATUS, 4, NULL, status); ! /* Send the command and wait for the reply ! This will set the Target's DDS ID */ ! return TargetSendCmd (&cmd, buffer, sizeof (buffer), current); } --- 418,424 ---- status = 1; ISNSAppendAttr (&cmd, ISNS_DDS_STATUS, 4, NULL, status); ! ! if (0 == ISNSSendCmd2 (&cmd, buffer, sizeof (buffer))) ! ParseQuery (buffer, current); } *************** *** 504,508 **** void TargetAdd_DD_to_DDS (target* current) { ! listelement* temp; printf ("Adding DD to DDS\n"); --- 429,434 ---- void TargetAdd_DD_to_DDS (target* current) { ! listelement* temp; ! char buffer[2048]; printf ("Adding DD to DDS\n"); *************** *** 519,525 **** /* The target's DD is sent */ ISNSAppendAttr (&cmd, ISNS_DD_ID, 4, NULL, current->DDmember); ! /* Send the command, do not parse the reply */ ! ISNSSendCmd (&cmd); ! } --- 445,450 ---- /* The target's DD is sent */ ISNSAppendAttr (&cmd, ISNS_DD_ID, 4, NULL, current->DDmember); ! ! ISNSSendCmd2 (&cmd, buffer, sizeof (buffer)); } *************** *** 529,532 **** --- 454,458 ---- void TargetAdd_ISCSI_to_DD (target* current) { + char buffer[2048]; printf ("Adding ISCSI to DD.\n"); *************** *** 534,537 **** --- 460,465 ---- ISNSCreateHdr (ISNS_REG_DD_REQ, &cmd, sizeof (cmd), 0); + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + /* Zero out the src field. */ ISNSAppendAttr (&cmd, 0, 0, NULL, 0); *************** *** 550,554 **** /* Send the command, do not parse the reply */ ! ISNSSendCmd (&cmd); } --- 478,482 ---- /* Send the command, do not parse the reply */ ! ISNSSendCmd2 (&cmd, buffer, sizeof (buffer)); } *************** *** 560,567 **** --- 488,498 ---- void TargetAdd_ISCSI_to_DD2 (target* current) { + char buffer[2048]; printf ("Adding ISCSI to DD.\n"); /*ISNSCreateHdr (ISNS_REG_DD_REQ, &cmd, sizeof (cmd), ISNS_FLAG_UPDATE_REG);*/ ISNSCreateHdr (ISNS_REG_DD_REQ, &cmd, sizeof (cmd), 0); + ISNSAppendAttr (&cmd, 0, 0, NULL, 0); + /* Zero out the src field. */ ISNSAppendAttr (&cmd, 0, 0, NULL, 0); *************** *** 579,648 **** ISNSAppendAttr (&cmd, ISNS_DD_ISCSI_MEMBER, PAD4 (strlen (current->listPtr->InitiatorName)), current->listPtr->InitiatorName, 0); ! ISNSSendCmd (&cmd); ! } ! ! /***********************************************************************/ ! /* This will send a PDU and wait for a rsp. The rsp will be returned. */ ! /* This function is direct theft from the base iSNS implementation */ ! /* The only functionality added was to parse the reply */ ! /***********************************************************************/ ! int TargetSendCmd (ISNS_CMD * cmd, char *rcvBuffer, int rcvSize, target* member) ! { ! int e; ! int len = cmd->hdr.len + sizeof (ISNS_HDR); ! int errorCode; ! int* tempint; ! ! cmd->hdr.len = htons (cmd->hdr.len); ! e = SendPDU (cmd, len); ! if (e < 0) ! { ! printf ("Error Sending.\n"); ! } ! printf("PDU sent-->\n"); ! DumpHex (cmd, len); ! e = RcvPDU ((struct cmd *)rcvBuffer, rcvSize); ! ! if (e < 0) ! { ! printf ("Error Receiving.\n"); ! } ! printf("PDU rcv-->\n"); ! DumpHex (rcvBuffer, e); ! ! { ! char *ptr = (char *) rcvBuffer + sizeof (ISNS_HDR); ! errorCode = ntohl (*(uint32_t *) ptr); ! } ! if (errorCode != 0) ! { ! printf ("***WARNING: iSNS returned an error, error=%#x.\n", errorCode); ! } ! else ! { ! ISNS_HDR *p_cmd; ! ! p_cmd = (struct isns_hdr *)rcvBuffer; ! ! /* Convert fields */ ! p_cmd->flags = ntohs (p_cmd->flags); ! p_cmd->func_id = ntohs (p_cmd->func_id); ! p_cmd->len = ntohs (p_cmd->len); ! p_cmd->seq = ntohs (p_cmd->seq); ! p_cmd->version = ntohs (p_cmd->version); ! p_cmd->xid = ntohs (p_cmd->xid); ! } ! ! if (errorCode == 0) ! TargetParseQuery (rcvBuffer, member); ! ! return (errorCode); } - /*********************************************************************/ /* Parses a Query Response */ /*********************************************************************/ ! void TargetParseQuery (char *buffer, target* current) { ISNS_Attr *p_attr; --- 510,520 ---- ISNSAppendAttr (&cmd, ISNS_DD_ISCSI_MEMBER, PAD4 (strlen (current->listPtr->InitiatorName)), current->listPtr->InitiatorName, 0); ! ISNSSendCmd2 (&cmd, buffer, sizeof (buffer)); } /*********************************************************************/ /* Parses a Query Response */ /*********************************************************************/ ! void ParseQuery (char *buffer, target* current) { ISNS_Attr *p_attr; |
From: Robert W. <wrw...@us...> - 2006-12-11 00:42:32
|
Update of /cvsroot/linuxisns/iscsiClient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15805/src Modified Files: InitiatorList.c comm.c initiator.c parse.c target.c util.c Log Message: Fix compiler warnings Index: initiator.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/initiator.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** initiator.c 11 Dec 2006 00:24:22 -0000 1.2 --- initiator.c 11 Dec 2006 00:42:28 -0000 1.3 *************** *** 33,36 **** --- 33,37 ---- /***********************************************************************/ + #include <stdlib.h> #include <pthread.h> #include <errno.h> Index: util.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/util.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** util.c 2 Apr 2002 02:57:42 -0000 1.1.1.1 --- util.c 11 Dec 2006 00:42:28 -0000 1.2 *************** *** 159,163 **** HexToAscii (char *srcbuffer, int size, char *dstbuffer) { ! unsigned char *ptr; int count; unsigned int two; --- 159,163 ---- HexToAscii (char *srcbuffer, int size, char *dstbuffer) { ! char *ptr; int count; unsigned int two; *************** *** 165,169 **** ptr = srcbuffer; count = 0; ! while (ptr < (unsigned char *) srcbuffer + size) { two = *(unsigned char *) ptr; --- 165,169 ---- ptr = srcbuffer; count = 0; ! while (ptr < srcbuffer + size) { two = *(unsigned char *) ptr; Index: InitiatorList.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/InitiatorList.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** InitiatorList.c 2 Apr 2002 02:57:41 -0000 1.1.1.1 --- InitiatorList.c 11 Dec 2006 00:42:28 -0000 1.2 *************** *** 32,35 **** --- 32,36 ---- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /***********************************************************************/ + #include <malloc.h> typedef struct Index: parse.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/parse.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** parse.c 2 Apr 2002 02:57:41 -0000 1.1.1.1 --- parse.c 11 Dec 2006 00:42:28 -0000 1.2 *************** *** 199,203 **** uint16_t pdufunc, pdulen, pduflags; uint32_t attrtag, attrlen, attrvalword; ! int i=0, *valword; pdu = (struct isns_hdr *)buffer; --- 199,204 ---- uint16_t pdufunc, pdulen, pduflags; uint32_t attrtag, attrlen, attrvalword; ! int i=0; ! int *valword; pdu = (struct isns_hdr *)buffer; *************** *** 335,339 **** default: printf ("Tag: %s = ", isnsTagText(attrtag)); ! for (valword=&p_attr->val.etype; (unsigned int) i<attrlen; i+=4) { printf("%08X ",ntohl(*valword++)); } --- 336,340 ---- default: printf ("Tag: %s = ", isnsTagText(attrtag)); ! for (valword=(int *)&p_attr->val.etype; i<attrlen; i+=4) { printf("%08X ",ntohl(*valword++)); } Index: target.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/target.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** target.c 11 Dec 2006 00:24:22 -0000 1.2 --- target.c 11 Dec 2006 00:42:28 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- #define MIN_VERSION 0 + #include <stdlib.h> #include <errno.h> Index: comm.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/comm.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** comm.c 2 Apr 2002 02:57:40 -0000 1.1.1.1 --- comm.c 11 Dec 2006 00:42:28 -0000 1.2 *************** *** 38,41 **** --- 38,44 ---- * /***********************************************************************/ + #include <stdlib.h> + #include <stdio.h> + #include "isns.h" *************** *** 228,232 **** int e; int rcvSize; ! int len; if (tcpFlag) --- 231,235 ---- int e; int rcvSize; ! socklen_t len; if (tcpFlag) *************** *** 418,422 **** ISNS_CMD cmd; int e; ! int len; if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) --- 421,425 ---- ISNS_CMD cmd; int e; ! socklen_t len; if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) *************** *** 493,497 **** ISNS_CMD cmd; int e; ! int len; struct ip_mreq stMreq; int iRet; --- 496,500 ---- ISNS_CMD cmd; int e; ! socklen_t len; struct ip_mreq stMreq; int iRet; *************** *** 591,595 **** int port = p_cb->port; int e; ! int len; struct sockaddr_in their_addr; struct sockaddr_in my_addr; --- 594,598 ---- int port = p_cb->port; int e; ! socklen_t len; struct sockaddr_in their_addr; struct sockaddr_in my_addr; |
From: Robert W. <wrw...@us...> - 2006-12-11 00:42:32
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15805 Modified Files: Makefile Log Message: Fix compiler warnings Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 11 Dec 2006 00:24:22 -0000 1.3 --- Makefile 11 Dec 2006 00:42:28 -0000 1.4 *************** *** 44,48 **** TARGET_SRCS += $(SRCDIR)target.c ! CFLAGS = -Werror -Wall CFLAGS = -DSNS_LINUX CFLAGS += -DSNS_DEBUG --- 44,48 ---- TARGET_SRCS += $(SRCDIR)target.c ! CFLAGS = -Werror -Wall -O2 CFLAGS = -DSNS_LINUX CFLAGS += -DSNS_DEBUG |
From: Robert W. <wrw...@us...> - 2006-12-11 00:24:25
|
Update of /cvsroot/linuxisns/iscsiClient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8909/src Modified Files: initiator.c isns.c target.c Log Message: Change to build only initiator and target Index: isns.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/isns.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** isns.c 2 Apr 2002 02:57:41 -0000 1.1.1.1 --- isns.c 11 Dec 2006 00:24:22 -0000 1.2 *************** *** 45,49 **** #define MAX_ESI_ENTRIES (100) ! static ISNS_CMD cmd; /* Used by functions for msgs. */ static int currentXid = 0; /* current XID */ int enableESIFlag; /* Set to non-zero when enable ESI reponse. */ --- 45,49 ---- #define MAX_ESI_ENTRIES (100) ! ISNS_CMD cmd; /* Used by functions for msgs. */ static int currentXid = 0; /* current XID */ int enableESIFlag; /* Set to non-zero when enable ESI reponse. */ Index: initiator.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/initiator.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** initiator.c 2 Apr 2002 02:57:41 -0000 1.1.1.1 --- initiator.c 11 Dec 2006 00:24:22 -0000 1.2 *************** *** 32,40 **** * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /***********************************************************************/ - /*#define SNS_LINUX */ - #define INITIATOR - /*#define DWORD unsigned int*/ - /*#define WINAPI*/ - #define HANDLE pthread_t* #include <pthread.h> --- 32,35 ---- *************** *** 42,55 **** #include "isns.h" - #include "isns.c" - - #include "util.h" - #include "util.c" - #include "initiator.h" - /*#include "initiator.c"*/ - - #include "comm.h" - #include "comm.c" #define CLIENT_VERSION "1.1" --- 37,41 ---- *************** *** 57,60 **** --- 43,47 ---- #define MIN_VERSION 0 + #define HANDLE pthread_t* /*************************************** *************** *** 66,69 **** --- 53,64 ---- ********************************/ extern int isns_port; + extern struct sockaddr_in their_addr; + extern struct sockaddr_in my_addr; + extern int tcpFlag; + extern SOCKET fd; + extern ISNS_CMD cmd; + + int + TCPReceiveMain (DWORD lparam); /******************************** Index: target.c =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/src/target.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** target.c 2 Apr 2002 02:57:42 -0000 1.1.1.1 --- target.c 11 Dec 2006 00:24:22 -0000 1.2 *************** *** 39,44 **** /***********************************************************************/ - - #define TARGET #define HANDLE pthread_t* #define MAX_FILENAME_SIZE 100 --- 39,42 ---- *************** *** 46,79 **** #define MIN_VERSION 0 - - - #include <pthread.h> #include <errno.h> #include "isns.h" - #include "isns.c" - - #include "util.h" - #include "util.c" - #include "target.h" - #include "comm.h" - #include "comm.c" - - #include "isns.h" - - #include "iscsi.h" - #include "portal.h" - #include "entity.h" - #include "ifcp.h" - #include "fcnode.h" - #include "util.h" - #include "comm.h" - #include "menu.h" - - - - #define CLIENT_VERSION "1.1" /*************************************** --- 44,52 ---- *************** *** 86,89 **** --- 59,70 ---- ********************************/ extern int isns_port; + extern struct sockaddr_in their_addr; + extern struct sockaddr_in my_addr; + extern int tcpFlag; + extern SOCKET fd; + extern ISNS_CMD cmd; + + int + TCPReceiveMain (DWORD lparam); /****************************************************************/ |
From: Robert W. <wrw...@us...> - 2006-12-11 00:24:25
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8909 Modified Files: Makefile Log Message: Change to build only initiator and target Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 10 Dec 2006 20:57:15 -0000 1.2 --- Makefile 11 Dec 2006 00:24:22 -0000 1.3 *************** *** 32,48 **** INCDIR += -I/usr/include/ ! SRCS = $(SRCDIR)comm.c ! SRCS += $(SRCDIR)custom.c ! SRCS += $(SRCDIR)entity.c ! SRCS += $(SRCDIR)fcnode.c ! SRCS += $(SRCDIR)getarg.c ! SRCS += $(SRCDIR)ifcp.c ! SRCS += $(SRCDIR)iscsi.c ! SRCS += $(SRCDIR)isns.c ! SRCS += $(SRCDIR)main.c ! SRCS += $(SRCDIR)menu.c ! SRCS += $(SRCDIR)parse.c ! SRCS += $(SRCDIR)portal.c ! SRCS += $(SRCDIR)util.c CFLAGS = -Werror -Wall --- 32,46 ---- INCDIR += -I/usr/include/ ! INITIATOR_SRCS = $(SRCDIR)util.c ! INITIATOR_SRCS += $(SRCDIR)parse.c ! INITIATOR_SRCS += $(SRCDIR)comm.c ! INITIATOR_SRCS += $(SRCDIR)isns.c ! INITIATOR_SRCS += $(SRCDIR)initiator.c ! ! TARGET_SRCS = $(SRCDIR)util.c ! TARGET_SRCS += $(SRCDIR)parse.c ! TARGET_SRCS += $(SRCDIR)comm.c ! TARGET_SRCS += $(SRCDIR)isns.c ! TARGET_SRCS += $(SRCDIR)target.c CFLAGS = -Werror -Wall *************** *** 51,69 **** CFLAGS += -DSNS_VERSION=1 ! PROGRAMS = isnsc initiator target all: $(PROGRAMS) ! isnsc : $(SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o isnsc $(SRCS) ! ! initiator : $(SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o initiator $(SRCDIR)initiator.c ! target : $(SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o target $(SRCDIR)target.c clean : - rm isnsc rm target rm initiator --- 49,63 ---- CFLAGS += -DSNS_VERSION=1 ! PROGRAMS = initiator target all: $(PROGRAMS) ! initiator : $(INITIATOR_SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o initiator $(INITIATOR_SRCS) ! target : $(TARGET_SRCS) ! $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o target $(TARGET_SRCS) clean : rm target rm initiator |
From: Robert W. <wrw...@us...> - 2006-12-10 20:57:18
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27454 Modified Files: Makefile Removed Files: MakeInitiator MakeTarget Log Message: combine makes into one Makefile --- MakeInitiator DELETED --- --- MakeTarget DELETED --- Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/iscsiClient/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 2 Apr 2002 02:57:39 -0000 1.1.1.1 --- Makefile 10 Dec 2006 20:57:15 -0000 1.2 *************** *** 32,38 **** INCDIR += -I/usr/include/ - # CFLAGS = -Werror -Wall - - SRCS = $(SRCDIR)comm.c SRCS += $(SRCDIR)custom.c --- 32,35 ---- *************** *** 49,61 **** SRCS += $(SRCDIR)util.c ! CFLAGS = -DSNS_LINUX CFLAGS += -DSNS_DEBUG CFLAGS += -DSNS_VERSION=1 isnsc : $(SRCS) $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o isnsc $(SRCS) clean : rm isnsc --- 46,69 ---- SRCS += $(SRCDIR)util.c ! CFLAGS = -Werror -Wall CFLAGS = -DSNS_LINUX CFLAGS += -DSNS_DEBUG CFLAGS += -DSNS_VERSION=1 + PROGRAMS = isnsc initiator target + + all: $(PROGRAMS) isnsc : $(SRCS) $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o isnsc $(SRCS) + initiator : $(SRCS) + $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o initiator $(SRCDIR)initiator.c + + target : $(SRCS) + $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o target $(SRCDIR)target.c + clean : rm isnsc + rm target + rm initiator |
From: Robert W. <wrw...@us...> - 2006-12-10 20:39:06
|
Update of /cvsroot/linuxisns/iscsiClient/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20311 Removed Files: MakeTarget Log Message: Remove files that should not have been under cvs --- MakeTarget DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-10 20:37:39
|
Update of /cvsroot/linuxisns/iscsiClient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19762 Removed Files: target.back.c target.back2.c target.replace.c Log Message: Remove files that should not have been under cvs --- target.back.c DELETED --- --- target.replace.c DELETED --- --- target.back2.c DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-10 20:34:34
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18616 Removed Files: util.c Log Message: Remove file - it is empty --- util.c DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-10 20:13:23
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10299 Removed Files: Targets.txt Log Message: Remove uneeded file - this is an runtime output file --- Targets.txt DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-10 20:11:46
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9549 Removed Files: EntityPersists.txt Log Message: Remove uneeded file --- EntityPersists.txt DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-10 20:08:42
|
Update of /cvsroot/linuxisns/iscsiClient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8346 Removed Files: Targets.txt2 Log Message: Remove uneeded file --- Targets.txt2 DELETED --- |
From: Robert W. <wrw...@us...> - 2006-12-08 20:20:38
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2706/isnsserver/include Modified Files: iSNSparse.h Log Message: fixed compiler warning in ISNSParseMsg call Index: iSNSparse.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSparse.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSparse.h 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSparse.h 8 Dec 2006 20:20:34 -0000 1.3 *************** *** 41,45 **** extern int ISNSParseMsg (ISNS_Msg * msg, char **attr_index, char **key_index, ! char **src_attr); extern int --- 41,45 ---- extern int ISNSParseMsg (ISNS_Msg * msg, char **attr_index, char **key_index, ! ISNS_Attr **src_attr); extern int |
From: Robert W. <wrw...@us...> - 2006-12-08 20:20:38
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2706/isnsserver/src Modified Files: iSNSUtil.c iSNSdereg.c iSNSparse.c iSNSquery.c iSNSreg.c iSNSscn.c Log Message: fixed compiler warning in ISNSParseMsg call Index: iSNSUtil.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSUtil.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSUtil.c 1 Dec 2006 15:35:17 -0000 1.8 --- iSNSUtil.c 8 Dec 2006 20:20:34 -0000 1.9 *************** *** 972,976 **** uint32_t attrtag; uint32_t attrlen; - uint32_t attrvalword; int i=0; int *valword; --- 972,975 ---- *************** *** 1050,1057 **** break; case ISNS_TIMESTAMP : ! attrvalword = ntohl(p_attr->val.timestamp.t_time); printf ("Tag: %s = %s", isnsTagText(attrtag), ! ctime((time_t *)&attrvalword)); break; case ISNS_PROT_VER : printf ("Tag: %s = %04X-%04X\n", isnsTagText(attrtag), --- 1049,1059 ---- break; case ISNS_TIMESTAMP : ! { ! time_t timevalue; ! timevalue = ntohl(p_attr->val.timestamp.t_time); printf ("Tag: %s = %s", isnsTagText(attrtag), ! ctime(&timevalue)); break; + } case ISNS_PROT_VER : printf ("Tag: %s = %04X-%04X\n", isnsTagText(attrtag), Index: iSNSquery.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSquery.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iSNSquery.c 6 Dec 2006 22:05:34 -0000 1.5 --- iSNSquery.c 8 Dec 2006 20:20:34 -0000 1.6 *************** *** 141,149 **** int status = ISNS_UNKNOWN_ERR; ISNS_Attr *attr; ! char *src_attr; char *attr_indx[SNS_MAX_ATTRS]; char *key_indx[SNS_MAX_ATTRS]; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); attr = (ISNS_Attr *)(attr_indx[0]); if (attr == NULL) --- 141,149 ---- int status = ISNS_UNKNOWN_ERR; ISNS_Attr *attr; ! ISNS_Attr *src_attr; char *attr_indx[SNS_MAX_ATTRS]; char *key_indx[SNS_MAX_ATTRS]; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); attr = (ISNS_Attr *)(attr_indx[0]); if (attr == NULL) *************** *** 1903,1907 **** DEBUG_0 (isns_db_debug &1, (ISNSGetNextAttr)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Scan the keys */ --- 1903,1907 ---- DEBUG_0 (isns_db_debug &1, (ISNSGetNextAttr)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx,&src_attr ); /* Scan the keys */ *************** *** 2352,2356 **** int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); ddsKeyIndex = ISNSFindTag(0, ISNS_DDS_ID, key_indx); ddKeyIndex = ISNSFindTag(0, ISNS_DD_ID, key_indx); --- 2352,2356 ---- int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); ddsKeyIndex = ISNSFindTag(0, ISNS_DDS_ID, key_indx); ddKeyIndex = ISNSFindTag(0, ISNS_DD_ID, key_indx); *************** *** 2417,2421 **** int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); entityKeyIndex = ISNSFindTag(0, ISNS_ENTITY_IDX, key_indx); portalKeyIndex = ISNSFindTag(0, ISNS_PORTAL_IDX, key_indx); --- 2417,2421 ---- int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); entityKeyIndex = ISNSFindTag(0, ISNS_ENTITY_IDX, key_indx); portalKeyIndex = ISNSFindTag(0, ISNS_PORTAL_IDX, key_indx); *************** *** 2505,2509 **** int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); ddKeyIndex = ISNSFindTag(0, ISNS_DD_ID, key_indx); iscsiKeyIndex = ISNSFindTag(0, ISNS_DD_ISCSI_MEMBER_IDX, key_indx); --- 2505,2509 ---- int rval; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); ddKeyIndex = ISNSFindTag(0, ISNS_DD_ID, key_indx); iscsiKeyIndex = ISNSFindTag(0, ISNS_DD_ISCSI_MEMBER_IDX, key_indx); Index: iSNSparse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSparse.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSparse.c 4 Dec 2006 22:15:28 -0000 1.8 --- iSNSparse.c 8 Dec 2006 20:20:34 -0000 1.9 *************** *** 60,64 **** int ISNSParseMsg (ISNS_Msg * msg, char **attr_index, char **key_index, ! char **src_attr) { int ii; --- 60,64 ---- int ISNSParseMsg (ISNS_Msg * msg, char **attr_index, char **key_index, ! ISNS_Attr **src_attr) { int ii; Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** iSNSdereg.c 8 Dec 2006 20:05:50 -0000 1.10 --- iSNSdereg.c 8 Dec 2006 20:20:34 -0000 1.11 *************** *** 115,119 **** ISNS_Attr *src_attr; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Search the operation Attributes */ --- 115,119 ---- ISNS_Attr *src_attr; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); /* Search the operation Attributes */ *************** *** 467,471 **** DEBUG_0 (isns_db_debug & 1, "Entering RemoveAttrDDS()\n"); ! ISNSParseMsg(&p_md->msg, attr_indx, key_indx, (char **) &src_attr); ddKeyIndex = ISNSFindTag (0, ISNS_DDS_ID, key_indx); keyRemovedFlag = FALSE; --- 467,471 ---- DEBUG_0 (isns_db_debug & 1, "Entering RemoveAttrDDS()\n"); ! ISNSParseMsg(&p_md->msg, attr_indx, key_indx, &src_attr); ddKeyIndex = ISNSFindTag (0, ISNS_DDS_ID, key_indx); keyRemovedFlag = FALSE; *************** *** 520,524 **** char *key_indx[SNS_MAX_ATTRS]; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); ddKeyIndex = ISNSFindTag (0, ISNS_DD_ID, key_indx); flag = FALSE; --- 520,524 ---- char *key_indx[SNS_MAX_ATTRS]; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); ddKeyIndex = ISNSFindTag (0, ISNS_DD_ID, key_indx); flag = FALSE; *************** *** 1848,1852 **** rval = ISNS_UNKNOWN_ERR; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Scan the keys */ --- 1848,1852 ---- rval = ISNS_UNKNOWN_ERR; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); /* Scan the keys */ Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** iSNSreg.c 8 Dec 2006 20:05:50 -0000 1.9 --- iSNSreg.c 8 Dec 2006 20:20:34 -0000 1.10 *************** *** 119,123 **** regISCSIFlag = 0; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Profile which registration needs to be done */ --- 119,123 ---- regISCSIFlag = 0; ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); /* Profile which registration needs to be done */ *************** *** 783,787 **** DEBUG_0 (isns_db_debug & 1, (Registering DDS)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Search the keys for DD_Set. */ --- 783,787 ---- DEBUG_0 (isns_db_debug & 1, (Registering DDS)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); /* Search the keys for DD_Set. */ *************** *** 1098,1102 **** DEBUG_0 (isns_db_debug & 1, (Registering DD)); ! ISNSParseMsg(&p_md->msg, attr_indx, key_indx, (char **) &src_attr); /* Search the keys for DD_Set. */ --- 1098,1102 ---- DEBUG_0 (isns_db_debug & 1, (Registering DD)); ! ISNSParseMsg(&p_md->msg, attr_indx, key_indx, &src_attr); /* Search the keys for DD_Set. */ *************** *** 2489,2493 **** DEBUG_0 (isns_db_debug &1,(RegisterSCN)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, (char **) &src_attr ); /* Validate the src attr for Permission */ --- 2489,2493 ---- DEBUG_0 (isns_db_debug &1,(RegisterSCN)); ! ISNSParseMsg( &p_md->msg, attr_indx, key_indx, &src_attr ); /* Validate the src attr for Permission */ Index: iSNSscn.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSscn.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSscn.c 6 Nov 2006 18:04:38 -0000 1.3 --- iSNSscn.c 8 Dec 2006 20:20:34 -0000 1.4 *************** *** 1242,1246 **** ! ISNSParseMsg( p_msg, attr_indx, key_indx, (char **) &src_attr); key = (ISNS_Key *)(key_indx[0]); if (key == NULL) --- 1242,1246 ---- ! ISNSParseMsg( p_msg, attr_indx, key_indx, &src_attr); key = (ISNS_Key *)(key_indx[0]); if (key == NULL) |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:56
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsserver/include Modified Files: iSNSLinux.h iSNStypes.h Log Message: Add -O2 compile option - fixed compile warnings Index: iSNStypes.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNStypes.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNStypes.h 1 Dec 2006 21:49:29 -0000 1.6 --- iSNStypes.h 8 Dec 2006 20:05:50 -0000 1.7 *************** *** 687,691 **** SOIP_Dds dds; SOIP_Dd dd; ! SOIP_Node_Name node_name; SOIP_DB_Portal portal; } key; --- 687,691 ---- SOIP_Dds dds; SOIP_Dd dd; ! SOIP_ISCSI_Node_Id node_name; SOIP_DB_Portal portal; } key; Index: iSNSLinux.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSLinux.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iSNSLinux.h 7 Dec 2006 22:47:37 -0000 1.4 --- iSNSLinux.h 8 Dec 2006 20:05:50 -0000 1.5 *************** *** 68,72 **** #define FUNCPTR int ! #define bzero(a,b) {memset(a, 0, b);} #define inet_ntoa_b(a,b) {strcpy(b,inet_ntoa(a));} --- 68,72 ---- #define FUNCPTR int ! //#define bzero(a,b) {memset(a, 0, b);} #define inet_ntoa_b(a,b) {strcpy(b,inet_ntoa(a));} |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:56
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsclient Modified Files: Makefile Log Message: Add -O2 compile option - fixed compile warnings Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 28 Nov 2006 22:00:46 -0000 1.3 --- Makefile 8 Dec 2006 20:05:49 -0000 1.4 *************** *** 32,38 **** INCDIR += -I/usr/include/ - CFLAGS = -Wall - #CFLAGS += -Werror - OBJECTS = getarg.o OBJECTS += main.o --- 32,35 ---- *************** *** 49,57 **** OBJECTS += menu.o CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG ! all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnsc $(OBJECTS) getarg.o : $(SRCDIR)getarg.c --- 46,62 ---- OBJECTS += menu.o + WARNFLAGS = -Wall + OPTFLAGS ?= -g -O2 + CFLAGS += $(OPTFLAGS) $(WARNFLAGS) CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG + LIBS = -lpthread ! PROGRAMS = isnsc ! ! all : $(PROGRAMS) ! ! isnsc: $(OBJECTS) ! $(CC) $^ -o $@ $(LIBS) getarg.o : $(SRCDIR)getarg.c |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:55
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsserver/src Modified Files: iSNSLinux.c iSNSList.c iSNSdb.c iSNSdereg.c iSNSrcv.c iSNSreg.c Log Message: Add -O2 compile option - fixed compile warnings Index: iSNSList.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSList.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iSNSList.c 5 Dec 2006 16:28:34 -0000 1.6 --- iSNSList.c 8 Dec 2006 20:05:50 -0000 1.7 *************** *** 48,52 **** InitList(int list_id, void * record) { ! ISNS_LIST *plist; switch (list_id) --- 48,52 ---- InitList(int list_id, void * record) { ! ISNS_LIST *plist=NULL; switch (list_id) *************** *** 702,706 **** 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); --- 702,706 ---- else if (plist->list_id == ESI_LIST) { ! p_list = (ISNS_LIST *)plist->p_entry; strcpy (key.val.list.key.node_name.v,"esi_list"); rval = ISNSdbRead(&key,&entry); *************** *** 713,717 **** 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); --- 713,717 ---- else if (plist->list_id == SCN_LIST) { ! p_list = (ISNS_LIST *)plist->p_entry; strcpy (key.val.list.key.node_name.v,"scn_list"); rval = ISNSdbRead(&key,&entry); *************** *** 724,728 **** 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); --- 724,728 ---- else if (plist->list_id == SCN_CALLBACK_LIST) { ! p_list = (ISNS_LIST *)plist->p_entry; strcpy (key.val.list.key.node_name.v,"scn_callback_list"); rval = ISNSdbRead(&key,&entry); Index: iSNSrcv.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSrcv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iSNSrcv.c 2 Apr 2002 20:56:54 -0000 1.2 --- iSNSrcv.c 8 Dec 2006 20:05:50 -0000 1.3 *************** *** 98,102 **** { static int first_warn = TRUE; ! ISNS_Msg *p_msg; memset((char *)&frag_md, 0, sizeof(ISNS_Msg_Descp)); --- 98,102 ---- { static int first_warn = TRUE; ! ISNS_Msg *p_msg = NULL; memset((char *)&frag_md, 0, sizeof(ISNS_Msg_Descp)); Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** iSNSdereg.c 7 Dec 2006 17:26:12 -0000 1.9 --- iSNSdereg.c 8 Dec 2006 20:05:50 -0000 1.10 *************** *** 360,364 **** p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dd); if (rval != SUCCESS) { --- 360,364 ---- p_dds = (SOIP_Dds *)&entry.data; ! rval = Check_Permission(src_attr, DDS_ID_KEY, p_dds); if (rval != SUCCESS) { *************** *** 695,699 **** while ((pnode=GetNextNode(&p_ifcp_node->dd_id_list, pnode))) { ! //dd_key.id = *(uint32_t *) GetNodeData(pnode); ISNS_Key read_key; read_key.tag = PORT_NAME_KEY; --- 695,699 ---- while ((pnode=GetNextNode(&p_ifcp_node->dd_id_list, pnode))) { ! dd_key.id = *(uint32_t *) GetNodeData(pnode); ISNS_Key read_key; read_key.tag = PORT_NAME_KEY; *************** *** 738,741 **** --- 738,743 ---- if (rval != SUCCESS) return rval; + + p_fc_node = &entry3.data.node; Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSreg.c 7 Dec 2006 17:26:12 -0000 1.8 --- iSNSreg.c 8 Dec 2006 20:05:50 -0000 1.9 *************** *** 232,237 **** ISNS_Msg * p_rspmsg) { ! ISNS_Key *key; ! ISNS_Attr *attr; SOIP_Portal *p_portal; SOIP_Entity *p_entity; --- 232,237 ---- ISNS_Msg * p_rspmsg) { ! ISNS_Key *key = NULL; ! ISNS_Attr *attr = NULL; SOIP_Portal *p_portal; SOIP_Entity *p_entity; *************** *** 1830,1834 **** int updateNodeFlag = FALSE; int ii, rval; ! char *p_wwpn; ISNS_Key read_key; --- 1830,1834 ---- int updateNodeFlag = FALSE; int ii, rval; ! //char *p_wwpn; ISNS_Key read_key; *************** *** 1880,1884 **** strcpy(read_key.val.port_name.v,(char *)&key->val); rval = ISNSdbRead(&read_key,&entry); - p_ifcp_node = (SOIP_Ifcp *)&entry.data; --- 1880,1883 ---- *************** *** 1940,1954 **** return (ISNS_INVALID_REG_ERR); - if (p_entity->eid_type != ENTITY_TYPE_IFCP) - { - DEBUG_0 (isns_db_debug & 1, (Entity is not iFCP)); - return (ISNS_INVALID_REG_ERR); - } - /* create a new port element */ memset (&entry, 0, sizeof (SOIP_DB_Entry)); entry.data_type = PORT_NAME_KEY; ! memcpy ((char *) p_ifcp_node->port_name.v, ! (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); --- 1939,1947 ---- return (ISNS_INVALID_REG_ERR); /* create a new port element */ memset (&entry, 0, sizeof (SOIP_DB_Entry)); entry.data_type = PORT_NAME_KEY; ! //memcpy ((char *) p_ifcp_node->port_name.v, ! // (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); *************** *** 3625,3630 **** 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 }; --- 3618,3623 ---- SOIP_DB_Entry lentry1; SOIP_DB_Entry lentry2; ! SOIP_Dd *p_dd = NULL; ! SOIP_Dds *p_dds = NULL; ISNS_Key dds_key = { 0 }; ISNS_Key dd_key = { 0 }; *************** *** 3703,3707 **** { SOIP_DB_Entry lentry2; ! SOIP_Dd *p_dd; ISNS_Key dd_key = { 0 }; int rval; --- 3696,3700 ---- { SOIP_DB_Entry lentry2; ! SOIP_Dd *p_dd = NULL; ISNS_Key dd_key = { 0 }; int rval; *************** *** 3709,3712 **** --- 3702,3706 ---- /* check if default DD exists, if not create it */ + rval = 0; dd_key.tag = DD_ID_KEY; found = FALSE; Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** iSNSdb.c 4 Dec 2006 22:15:28 -0000 1.16 --- iSNSdb.c 8 Dec 2006 20:05:50 -0000 1.17 *************** *** 111,114 **** --- 111,115 ---- datum d; + k.dsize = 0; d.dsize = sizeof (SOIP_DB_Entry); *************** *** 301,304 **** --- 302,306 ---- d.dptr = (char *) &entry; d.dsize = sizeof (SOIP_DB_Entry); + k.dsize = 0; switch (key->tag) *************** *** 433,436 **** --- 435,440 ---- rc = SUCCESS; + k.dsize = 0; + switch (key->tag) { Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** iSNSLinux.c 7 Dec 2006 22:47:38 -0000 1.8 --- iSNSLinux.c 8 Dec 2006 20:05:50 -0000 1.9 *************** *** 209,215 **** char buf[64]; char *pid_file = "/var/run/isnss.pid"; ! mkdir("/var/opt/isns",0777); ! chdir("/var/opt/isns"); fd_pid = open(pid_file, O_WRONLY | O_CREAT, 0644); --- 209,216 ---- char buf[64]; char *pid_file = "/var/run/isnss.pid"; + int rc; ! rc = mkdir("/var/opt/isns",0777); ! rc = chdir("/var/opt/isns"); fd_pid = open(pid_file, O_WRONLY | O_CREAT, 0644); *************** *** 222,228 **** } ! ftruncate(fd_pid, 0); sprintf(buf,"%d\n",getpid()); ! write(fd_pid, buf, strlen(buf)); printf("isns daemon started as pid:%i\n",getpid()); --- 223,229 ---- } ! rc = ftruncate(fd_pid, 0); sprintf(buf,"%d\n",getpid()); ! rc = write(fd_pid, buf, strlen(buf)); printf("isns daemon started as pid:%i\n",getpid()); |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:53
|
Update of /cvsroot/linuxisns/isnsNT/isnsclient/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsclient/src Modified Files: entity.c isns.c parse.c portal.c util.c Log Message: Add -O2 compile option - fixed compile warnings Index: isns.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/isns.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** isns.c 28 Nov 2006 22:00:47 -0000 1.3 --- isns.c 8 Dec 2006 20:05:49 -0000 1.4 *************** *** 1084,1090 **** break; case ISNS_TIMESTAMP: ! p_attr->val.timestamp.t_time = ntohl (p_attr->val.timestamp.t_time); ! printf ("TimeStamp: %s", ctime ((time_t *)&p_attr->val.timestamp.t_time)); break; case ISNS_IFCP_SCN_BITMAP: case ISNS_ISCSI_SCN_BITMAP: --- 1084,1093 ---- break; case ISNS_TIMESTAMP: ! { ! time_t time_value; ! time_value = ntohl (p_attr->val.timestamp.t_time); ! printf ("TimeStamp: %s", ctime (&time_value)); break; + } case ISNS_IFCP_SCN_BITMAP: case ISNS_ISCSI_SCN_BITMAP: Index: util.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/util.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** util.c 28 Nov 2006 22:00:47 -0000 1.3 --- util.c 8 Dec 2006 20:05:49 -0000 1.4 *************** *** 190,193 **** --- 190,194 ---- int count; char *sptr; + char *result; memset (buffer, 0, sizeof (buffer)); *************** *** 196,200 **** printf ("%s [%s] >", prompt, cDefault != NULL ? HexToAscii (cDefault, 8, buffer2) : "(none)"); ! fgets (buffer, sizeof(buffer), stdin); sptr = strtok(buffer, TOKENS); ptr = sptr; --- 197,201 ---- printf ("%s [%s] >", prompt, cDefault != NULL ? HexToAscii (cDefault, 8, buffer2) : "(none)"); ! result = fgets (buffer, sizeof(buffer), stdin); sptr = strtok(buffer, TOKENS); ptr = sptr; *************** *** 223,230 **** int rval; char *sptr; memset (cmdLine, 0, c_size); printf ("%s [%s] >", prompt, cDefault != NULL ? cDefault : "(none)"); ! fgets (cmdLine, c_size, stdin); sptr = strtok(cmdLine, TOKENS); rval = sptr?strlen (sptr):0; --- 224,232 ---- int rval; char *sptr; + char *result; memset (cmdLine, 0, c_size); printf ("%s [%s] >", prompt, cDefault != NULL ? cDefault : "(none)"); ! result = fgets (cmdLine, c_size, stdin); sptr = strtok(cmdLine, TOKENS); rval = sptr?strlen (sptr):0; *************** *** 241,248 **** int rval; char *sptr; memset (cmdLine, 0, c_size); printf ("%s [%s] >", prompt, dvalue == TRUE ? "*y/n" : "*n/y"); ! fgets (cmdLine, c_size, stdin); sptr = strtok(cmdLine, TOKENS); --- 243,251 ---- int rval; char *sptr; + char *result; memset (cmdLine, 0, c_size); printf ("%s [%s] >", prompt, dvalue == TRUE ? "*y/n" : "*n/y"); ! result = fgets (cmdLine, c_size, stdin); sptr = strtok(cmdLine, TOKENS); Index: entity.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/entity.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** entity.c 5 Dec 2006 16:28:33 -0000 1.6 --- entity.c 8 Dec 2006 20:05:49 -0000 1.7 *************** *** 116,122 **** break; case ISNS_TIMESTAMP: ! p_attr->val.timestamp.t_time = ntohl (p_attr->val.timestamp.t_time); ! printf ("TimeStamp: %s", ctime ((time_t *)&p_attr->val.timestamp.t_time)); break; case ISNS_PROT_VER: p_attr->val.ver.max = ntohs (p_attr->val.ver.max); --- 116,125 ---- break; case ISNS_TIMESTAMP: ! { ! time_t timevalue; ! timevalue = ntohl (p_attr->val.timestamp.t_time); ! printf ("TimeStamp: %s", ctime (&timevalue)); break; + } case ISNS_PROT_VER: p_attr->val.ver.max = ntohs (p_attr->val.ver.max); Index: parse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/parse.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** parse.c 28 Nov 2006 22:00:47 -0000 1.3 --- parse.c 8 Dec 2006 20:05:49 -0000 1.4 *************** *** 191,195 **** char *ptr; uint16_t pdufunc, pdulen, pduflags; ! uint32_t attrtag, attrlen, attrvalword; int i=0, *valword; --- 191,195 ---- char *ptr; uint16_t pdufunc, pdulen, pduflags; ! uint32_t attrtag, attrlen; int i=0, *valword; *************** *** 268,275 **** break; case ISNS_TIMESTAMP : ! attrvalword = ntohl(p_attr->val.timestamp.t_time); printf ("Tag: %s = %s", isnsTagText(attrtag), ! ctime((time_t *)&attrvalword)); break; case ISNS_PROT_VER : printf ("Tag: %s = %04X-%04X\n", isnsTagText(attrtag), --- 268,277 ---- break; case ISNS_TIMESTAMP : ! { time_t timevalue; ! timevalue = ntohl(p_attr->val.timestamp.t_time); printf ("Tag: %s = %s", isnsTagText(attrtag), ! ctime(&timevalue)); break; + } case ISNS_PROT_VER : printf ("Tag: %s = %04X-%04X\n", isnsTagText(attrtag), Index: portal.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsclient/src/portal.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** portal.c 28 Nov 2006 22:00:47 -0000 1.4 --- portal.c 8 Dec 2006 20:05:49 -0000 1.5 *************** *** 388,392 **** DWORD junk; #endif ! LISTENER_CB_P p_cb; HANDLE hdle; --- 388,392 ---- DWORD junk; #endif ! LISTENER_CB_P p_cb = NULL; HANDLE hdle; *************** *** 509,513 **** DWORD junk; #endif ! LISTENER_CB_P p_cb; HANDLE hdle; --- 509,513 ---- DWORD junk; #endif ! LISTENER_CB_P p_cb = NULL; HANDLE hdle; |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:53
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/etc In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsserver/etc Modified Files: initd.suse Log Message: Add -O2 compile option - fixed compile warnings Index: initd.suse =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/etc/initd.suse,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** initd.suse 7 Dec 2006 22:47:37 -0000 1.1 --- initd.suse 8 Dec 2006 20:05:50 -0000 1.2 *************** *** 1,8 **** #!/bin/bash # ! # /etc/init.d/isnss # ### BEGIN INIT INFO ! # Provides: isnss # Required-Start: $network # Should-Start: --- 1,8 ---- #!/bin/bash # ! # /etc/init.d/isns # ### BEGIN INIT INFO ! # Provides: isns # Required-Start: $network # Should-Start: *************** *** 11,21 **** # Default-Start: 3 5 # Default-Stop: ! # Short-Description: Starts and stops the isnss server # ### END INIT INFO ! PID_FILE=/var/run/isnss.pid ! CONFIG_FILE=/etc/isnss/isnss.conf ! DAEMON=/sbin/isnssd ARGS="" --- 11,21 ---- # Default-Start: 3 5 # Default-Stop: ! # Short-Description: Starts and stops the isns server # ### END INIT INFO ! PID_FILE=/var/run/isns.pid ! CONFIG_FILE=/etc/isns/isns.conf ! DAEMON=/sbin/isnsd ARGS="" |
From: Robert W. <wrw...@us...> - 2006-12-08 20:05:53
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27658/isnsserver Modified Files: Makefile Log Message: Add -O2 compile option - fixed compile warnings Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 7 Dec 2006 22:47:37 -0000 1.6 --- Makefile 8 Dec 2006 20:05:50 -0000 1.7 *************** *** 41,47 **** INCDIR += -I/usr/include/ - CFLAGS = -Wall - #CFLAGS += -Werror - OBJECTS = getarg.o OBJECTS += iSNSMain.o --- 41,44 ---- *************** *** 68,76 **** OBJECTS += iSNSList.o CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG ! all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnssd $(OBJECTS) getarg.o : $(SRCDIR)getarg.c --- 65,81 ---- OBJECTS += iSNSList.o + OPTFLAGS ?= -g -O2 + WARNFLAGS ?= -Wall + CFLAGS += $(OPTFLAGS) $(WARNFLAGS) CFLAGS += -DSNS_LINUX CFLAGS += -DSNS_DEBUG + LIBS = -lpthread -lgdbm ! PROGRAMS = isnsd ! ! all : $(PROGRAMS) ! ! isnsd: $(OBJECTS) ! $(CC) $^ -o $@ $(LIBS) getarg.o : $(SRCDIR)getarg.c *************** *** 144,148 **** clean : ! rm $(OBJECTS) isnssd install: install_programs install_initd --- 149,153 ---- clean : ! rm $(OBJECTS) isnsd install: install_programs install_initd *************** *** 157,170 **** elif [-f /etc/debian_version ]; then \ $(MAKE) install_initd_debian ; \ fi install_initd_debian: $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.debian \ ! $(DESTDIR)$(initddir)/isnss install_initd_suse: $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.suse \ ! $(DESTDIR)$(initddir)/isnss --- 162,178 ---- elif [-f /etc/debian_version ]; then \ $(MAKE) install_initd_debian ; \ + elif [-f /etc/redhat_version ]; then \ + $(MAKE) install_initd_redhat ; \ fi install_initd_debian: $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.debian $(DESTDIR)$(initddir)/isns install_initd_suse: $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.suse $(DESTDIR)$(initddir)/isns + install_initd_redhat: + $(INSTALL) -d $(DESTDIR)$(initddir) + $(INSTALL) -m 755 etc/initd.suse $(DESTDIR)$(initddir)/isns |
From: Robert W. <wrw...@us...> - 2006-12-07 22:47:44
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/etc In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29693/etc Added Files: initd.suse Log Message: Changes that make ISNS a daemon service --- NEW FILE: initd.suse --- #!/bin/bash # # /etc/init.d/isnss # ### BEGIN INIT INFO # Provides: isnss # Required-Start: $network # Should-Start: # Required-Stop: # Should-Stop: # Default-Start: 3 5 # Default-Stop: # Short-Description: Starts and stops the isnss server # ### END INIT INFO PID_FILE=/var/run/isnss.pid CONFIG_FILE=/etc/isnss/isnss.conf DAEMON=/sbin/isnssd ARGS="" #ARGS="-c $CONFIG_FILE -p $PID_FILE" # Source LSB init functions . /etc/rc.status # Reset status of this service rc_reset case "$1" in start) if checkproc $DAEMON ; then RETVAL=0 else echo -n "Starting iSNS Internet Storage Naming Service: " startproc $DAEMON $ARGS RETVAL=$? rc_status -v fi ;; stop) echo -n "Stopping iSNS Internet Storage Naming Service: " if checkproc $DAEMON ; then killproc -KILL $DAEMON rc_status -v else rc_failed 1 rc_status -v fi ;; status) echo -n "Checking for iSNS Internet Storage Naming Service: " if checkproc $DAEMON ; then rc_status -v else rc_failed 3 rc_status -v fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac rc_exit |
From: Robert W. <wrw...@us...> - 2006-12-07 22:47:44
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29693/include Modified Files: iSNSLinux.h Log Message: Changes that make ISNS a daemon service Index: iSNSLinux.h =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/include/iSNSLinux.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iSNSLinux.h 1 Dec 2006 15:35:17 -0000 1.3 --- iSNSLinux.h 7 Dec 2006 22:47:37 -0000 1.4 *************** *** 61,70 **** typedef unsigned char BYTE; - /*extern WSADATA g_WsaData;*/ - - #define S_IRUSR 0x0100 /* read permission, owner */ - #define S_IWUSR 0x0080 /* write permission, owner */ - #define S_IRGRP 0x0020 /* read permission, group */ - #define SNS_NT_FSM_TIMEOUT 10 #define SNS_NT_RS_TIMEOUT 10 --- 61,64 ---- *************** *** 73,87 **** #define OK SUCCESS #define FUNCPTR int ! /* Linux */ ! /*#define tickGet GetTickCount */ #define bzero(a,b) {memset(a, 0, b);} #define inet_ntoa_b(a,b) {strcpy(b,inet_ntoa(a));} - /* Curt - to remove redefinition warnings and errors */ - /* Linux */ - - /*typedef char uint8_t; - typedef unsigned int uint32_t; - typedef unsigned short int uint16_t;*/ typedef int STATUS; typedef HANDLE MSG_Q_ID; --- 67,74 ---- #define OK SUCCESS #define FUNCPTR int ! #define bzero(a,b) {memset(a, 0, b);} #define inet_ntoa_b(a,b) {strcpy(b,inet_ntoa(a));} typedef int STATUS; typedef HANDLE MSG_Q_ID; *************** *** 89,98 **** typedef unsigned int DWORD; - /* 7/25/01 */ - /*void wdCancel(sem_t timer);*/ void taskDelay (int time); int sysClkRateGet(void); - /*int wdStart(pthread_mutex_t sns_request_timer, int next_timeout, void *nptr1, - void *nptr2);*/ int taskIdSelf(void); void taskSuspend(void); --- 76,81 ---- |
From: Robert W. <wrw...@us...> - 2006-12-07 22:47:44
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29693/src Modified Files: iSNSLinux.c iSNSMain.c Log Message: Changes that make ISNS a daemon service Index: iSNSMain.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSMain.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** iSNSMain.c 1 Dec 2006 15:35:17 -0000 1.9 --- iSNSMain.c 7 Dec 2006 22:47:38 -0000 1.10 *************** *** 153,156 **** --- 153,158 ---- void SNSCheckInitTxQueue (ISNS_Msg_Descp * p_md); + int TCP_RecvMain(); + int rc; DWORD request_id; *************** *** 174,177 **** --- 176,180 ---- SNSMain (ISNS_Entity role) { + pthread_t athread; /* * place holder for the received iSNS message *************** *** 188,191 **** --- 191,197 ---- isns_role = ISNS_SECONDARY_SERVER; + if (pthread_create (&athread, NULL, (void*) TCP_RecvMain, NULL) != 0) + perror("Creating TCP_RecvMain"); + if (SNSInit (role) == ERROR) taskDelete (taskIdSelf ()); Index: iSNSLinux.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSLinux.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** iSNSLinux.c 1 Dec 2006 15:35:17 -0000 1.7 --- iSNSLinux.c 7 Dec 2006 22:47:38 -0000 1.8 *************** *** 32,35 **** --- 32,38 ---- #include <semaphore.h> #include <errno.h> + #include <sys/stat.h> + #include <sys/types.h> + #include <fcntl.h> #include "iSNSLinux.h" *************** *** 65,69 **** extern pthread_mutex_t sns_esi_timer; ! int pauseFlag = TRUE; int snsServiceFlag = FALSE; int loadFlag = FALSE; --- 68,72 ---- extern pthread_mutex_t sns_esi_timer; ! int pauseFlag = FALSE; int snsServiceFlag = FALSE; int loadFlag = FALSE; *************** *** 76,80 **** extern int sns_comm_main_port_set; - int TCP_RecvMain (); HANDLE init_ipc_rcv (void); void DebugOn (void); --- 79,82 ---- *************** *** 136,139 **** --- 138,142 ---- [-p port] primary port for SNSP traffic.\n\ [-d] Full debug options on.\n\ + [-f] Foreground - no daemon.\n\ [-?] Help.\n"; *************** *** 142,146 **** main (int argc, char **argv) { ! pthread_t athread; int c; char sfilename[256] = { 0 }; --- 145,150 ---- main (int argc, char **argv) { ! int daemon = TRUE; ! pid_t pid; int c; char sfilename[256] = { 0 }; *************** *** 150,154 **** while (optind != argc) { ! c = getopt (argc, argv, "da:b:p:c:"); switch (c) --- 154,158 ---- while (optind != argc) { ! c = getopt (argc, argv, "fda:b:p:c:"); switch (c) *************** *** 178,182 **** DebugOn(); break; ! case '?': default: --- 182,188 ---- DebugOn(); break; ! case 'f': ! daemon = FALSE; ! break; case '?': default: *************** *** 186,197 **** } ! pauseFlag = FALSE; ! while (pauseFlag) ! sleep (10); - if (pthread_create (&athread, NULL, (void*) TCP_RecvMain, NULL) != 0) - perror("Creating TCP_RecvMain"); - SNSMain (role); --- 192,242 ---- } ! if (daemon == TRUE) ! { ! pid = fork(); ! if (pid < 0) ! { ! printf("starting daemon failed\n"); ! exit(1); ! } ! else if (pid) ! { ! exit(0); ! } ! else ! { ! int fd_pid; ! char buf[64]; ! char *pid_file = "/var/run/isnss.pid"; ! mkdir("/var/opt/isns",0777); ! chdir("/var/opt/isns"); ! ! fd_pid = open(pid_file, O_WRONLY | O_CREAT, 0644); ! ! 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); ! } ! ! ftruncate(fd_pid, 0); ! sprintf(buf,"%d\n",getpid()); ! 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(); ! } ! } SNSMain (role); *************** *** 347,445 **** sns_bcast_debug = -1; - sns_cb_debug = -1; - sns_comm_debug = -1; - isns_db_debug = -1; - sns_fsm_debug = -1; - sns_hb_debug = -1; - isns_main_debug = -1; - sns_recv_debug = -1; - sns_rsync_debug = -1; - sns_scn_debug = -1; - sns_parse_debug = -1; } - - int - LinuxReadFromFile(int *lenPtr, void *ptr) - { - /* HANDLE hFile; */ - FILE* hFile; - char FileName[] = "iSNS.DAT"; - int bResult; - - hFile = fopen (FileName, "r"); - - if (hFile == NULL) - { - printf("iSNS: Unable to read data file.\n"); - fclose (hFile); - return(ERROR); - } - - /*bResult = ReadFile(hFile, ptr, 1024*10, lenPtr, - NULL) ;*/ - bResult = fread(ptr, 1024*10, 1, hFile); - - /*if (!bResult) - { - printf("iSNS: Unable to read data file.\n"); - CloseHandle(hFile); - return(ERROR); - } - */ - fclose(hFile); - return(SUCCESS); - } - - void - LinuxWriteToFile(int len, void *ptr) - { - /* HANDLE hFile; */ - FILE* hFile; - char FileName[] = "iSNS.DAT"; - int bResult; - int nBytesWrote; - - hFile = fopen (FileName, "w"); - - if (hFile == NULL) - { - printf("iSNS: Unable to write data file.\n"); - /*CloseHandle(hFile);*/ - fclose (hFile); - return; - } - - /* attempt an asynchronous read operation */ - /* bResult = WriteFile(hFile, ptr, len, &nBytesWrote, NULL) ; */ - bResult = fwrite (ptr, len, 1, hFile); - - if (!bResult) - { - printf("iSNS: Unable to write data file.\n"); - /*CloseHandle(hFile);*/ - fclose (hFile); - return; - } - - if (nBytesWrote!=len) - { - printf("iSNS: Error writing data file.\n"); - /*CloseHandle(hFile);*/ - fclose (hFile); - return; - } - - /*CloseHandle(hFile);*/ - fclose (hFile); - return; - } --- 392,404 ---- |
From: Robert W. <wrw...@us...> - 2006-12-07 22:47:41
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29693 Modified Files: Makefile Log Message: Changes that make ISNS a daemon service Index: Makefile =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 22 Nov 2006 23:48:31 -0000 1.5 --- Makefile 7 Dec 2006 22:47:37 -0000 1.6 *************** *** 27,30 **** --- 27,39 ---- SHELL = /bin/sh + DESTDIR ?= + INSTALL = install + etcdir = /etc + exec_prefix = + initddir = $(etcdir)/init.d + sbindir = $(exec_prefix)/sbin + + PROGRAMS = isnssd + CC = gcc -g SRCDIR = ./src/ *************** *** 63,67 **** all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnss $(OBJECTS) getarg.o : $(SRCDIR)getarg.c --- 72,76 ---- all : $(OBJECTS) ! $(CC) -lpthread -lgdbm -o isnssd $(OBJECTS) getarg.o : $(SRCDIR)getarg.c *************** *** 135,137 **** clean : ! rm $(OBJECTS) isnss --- 144,170 ---- clean : ! rm $(OBJECTS) isnssd ! ! install: install_programs install_initd ! ! install_programs: $(PROGRAMS) ! $(INSTALL) -d $(DESTDIR)$(sbindir) ! $(INSTALL) -m 755 $^ $(DESTDIR)$(sbindir) ! ! install_initd: ! if [ -f /etc/SuSE-release ]; then \ ! $(MAKE) install_initd_suse ; \ ! elif [-f /etc/debian_version ]; then \ ! $(MAKE) install_initd_debian ; \ ! fi ! ! install_initd_debian: ! $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.debian \ ! $(DESTDIR)$(initddir)/isnss ! ! install_initd_suse: ! $(INSTALL) -d $(DESTDIR)$(initddir) ! $(INSTALL) -m 755 etc/initd.suse \ ! $(DESTDIR)$(initddir)/isnss ! |