[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::dnu_osi

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

2124.0. "DNA argument data not accessible" by KERNEL::BIRKINSHAW (Press Enter to Exit) Thu Feb 06 1997 13:18

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.RTitleUserPersonal
Name
DateLines
2124.1UPSAR::WALLACEDigital: A Dilbertian CompanyThu Feb 06 1997 18:3810
    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.2Has anybody done this?KERNEL::WEGGIan Wegg - UK TSCWed Feb 12 1997 13:4711
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.