Title: | DECnet/OSI for {ULTRIX,OSF/1} |
Notice: | Indicate version and platform when writing...see #2 for kits |
Moderator: | BULEAN::CARR |
Created: | Wed Sep 25 1991 |
Last Modified: | Thu Jun 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2187 |
Total number of notes: | 10469 |
Unix 3.2d This problem sounds similar to the one that wasn't really answered in note 895. It was raised by a customer today. The problem is preventing the development of the system on unix. He is finding that with the exception of the file descriptor nothing is returned about the source of the connection in the dna structure. After polling successfully for a request, when he supplies a pointer the pointer stays null and when he supplies a pointer to a buffer the buffer is blank. The docs are unclear which of these two methods to use but neither seems to work. Does anyone know what is expected to happen here? thanks in advance Simon The following comes from the customer... When attempting to accept an inbound connection request from a remote DECnet node, the contents of the variables referenced in the fields DnaArgStrFullname and DnaArgStrNodesynonym of the DnaArgument data structure do not get updated with the relevent information. This makes it impossible to determine the source and hence the validity of the connection request. Please refer to the source file dna_server.c after the call to the dnaPollIncoming procedure has completed. dna_server.c follows ... #include <stdio.h> #include <debug.h> #include <netosi/dna.h> main () { DnaArgument_p pdna = NULL; char task[] = "process1"; char *perror; char *psname, *pfname; char sname[255], fname[255]; pdna = dnaNewArg (); if (NULL == pdna) { DEBUG ("*** CALL TO dnaNewArg FAILED ***\n"); exit (1); } pdna->DnaArgStrDestEnduser = (char *) &task; pdna->DnaArgOutErrorString = &perror; if (!dnaOpenIncoming (pdna)) { DEBUG ("*** CALL TO dnaOpenIncoming FAILED ***\n"); if (dnaErrorToStr (pdna)) { DEBUG ("*** ERROR TEXT = "); DEBUG (perror); DEBUG (" ***\n"); } else { DEBUG ("*** CALL TO dnaErrorToStr FAILED ***\n"); } } else { DEBUG ("*** Call to dnaOpenIncoming succeeded ***\n"); DEBUG ("*** Selected file descriptor = "); DEBUGD (pdna->DnaArgOutPort); DEBUG (" ***\n"); DEBUG ("*** DnaArgOutPort = "); DEBUGD (pdna->DnaArgOutPort); DEBUG (" ***\n "); DEBUG ("*** DnaArgPort = "); DEBUGD (pdna->DnaArgPort); DEBUG (" ***\n"); } DEBUG ("*** Waiting for inbound connect request ***\n"); pdna->DnaArgPort = pdna->DnaArgOutPort; psname = sname; pfname = fname; pdna->DnaArgOutStrNodesynonym = &psname; pdna->DnaArgOutStrFullname = &pfname; bzero (psname, sizeof (sname)); bzero (pfname, sizeof (fname)); if (!dnaPollIncoming (pdna)) { DEBUG ("*** CALL TO dnaPollIncoming FAILED ***\n"); if (dnaErrorToStr (pdna)) { DEBUG ("*** ERROR TEXT = "); DEBUG (perror); DEBUG (" ***\n"); } else { DEBUG ("*** CALL TO dnaErrorToStr FAILED ***\n"); } } else { DEBUG ("*** Call to dnaPollIncoming succeeded ***\n"); DEBUG ("*** DnaArgOutPort = "); DEBUGD (pdna->DnaArgOutPort); DEBUG (" ***\n"); DEBUG ("*** DnaArgPort = "); DEBUGD (pdna->DnaArgPort); DEBUG (" ***\n"); DEBUG ("*** DnaArgOutStrNodesynonym = "); DEBUG (psname); DEBUG (" ***\n"); DEBUG ("*** DnaArgOutStrFullname = "); DEBUG (pfname); DEBUG (" ***\n"); } DEBUG ("*** Accepting inbound call request ***\n"); pdna->DnaArgPort = pdna->DnaArgOutPort; if (!dnaAccept (pdna)) { DEBUG ("*** CALL TO dnaAccept FAILED ***\n"); if (dnaErrorToStr (pdna)) { DEBUG ("*** ERROR TEXT = "); DEBUG (perror); DEBUG (" ***\n"); } else { DEBUG ("*** CALL TO dnaErrorToStr FAILED ***\n"); } } else { DEBUG ("*** Call to dnaAccept succeeded ***\n"); } }
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2124.1 | UPSAR::WALLACE | Digital: A Dilbertian Company | Thu Feb 06 1997 15:38 | 10 | |
According to the man page, you should be able to get the tower of the remote node via the DnaArgOutDestTower argument to the dnaPollIncoming call. You'd then have to translate that to a nodename, presumably thru a call to dnaBackTranslate, though that is documented as taking an nsap rather than a tower. I think the call to extract the nsap from the tower would be DnaTowerToNsap. Maybe Jeff will confirm or deny these specualtions :-) Vince | |||||
2124.2 | Has anybody done this? | KERNEL::WEGG | Ian Wegg - UK TSC | Wed Feb 12 1997 10:47 | 11 |
I have inheritied this customer problem and have been looking through this conference for the answer. I've found that the same question has been asked several times before, including 1435.3 and 1462.12. Can somebody give a definitive answer, and best of all some sample code, on the exact steps needed to get the the name of the remote client from an incoming connection? Regards, Ian. |