Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* HELP : IFNET implementation on DEC 2100
@ 1996-01-15  5:00 Ashutosh Bhalerao
  0 siblings, 0 replies; 2+ messages in thread
From: Ashutosh Bhalerao @ 1996-01-15  5:00 UTC (permalink / raw)


Hi Everybody,
I am really sorry for having included a source code in this posting but 
please bear with me !!

Anyway, my problem is that I am NOT able to use the "ifnet" STREAMS module
for bridging STREAMS device drivers to sockets. Such a facility is
available on DIGITAL UNIX (any version above 2.0) running on DEC 2100 
server.  The problem that I am having is that after pushing the "ifnet" 
streams module on top of my STREAMS Device Driver, I can't tell the 
"ifnet" module of the "unit number" of my Device Driver. The source code 
that I have used to do this is given below.

Thanks very much
Abhay Ranade
abhayr@falcon.cdac.ernet.in

PS : Please reply by email 

---------------------------------------------------------------------------
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/stropts.h>
#include <sys/strlog.h>
#include <sys/dlpihdr.h>
#include <sys/poll.h>

main()
{
  int 			fd, unit ;
  struct strioctl	str ;

  if ( (fd = open("/dev/streams/pcids", O_RDWR)) < 0 ) {
    perror("pcids : open failed ....") ;
    exit(1) ;
  }
  
  if (isastream(fd))
    printf("\nSTREAMS based open\n") ;
  else
    printf("\nSockets based open\n") ;

  if(ioctl(fd,I_PUSH,"ifnet") < 0 ) 
      printf("\n\n ifnet I_PUSH failed \n\n") ;
  else
      printf("\n\n Ifnet module pushed \n\n") ;

  unit = 61 ; /* My device driver's MAJOR id */
  str.ic_cmd = 1236 ;     /* IS THIS THE RIGHT COMMAND ? <<<<<<<<<<<<<<<< */
  str.ic_dp = (char *)&unit ;
  
  if ( ioctl(fd, I_STR, (void *)&str) < 0 ){
    perror("ioctl IFNET_IOCTL_UNIT failed ...") ;
    exit(2) ;
  }

  close (fd) ;
}

--------------------------------------------------------------------------

RETURN STATUS :
   The last ioctl returns the following message in response to execution of
   the perror statement:

     ioctl IFNET_IOCTL_UNIT failed ...: Operation wood block




^ permalink raw reply	[flat|nested] 2+ messages in thread
* HELP : IFNET implementation on DEC 2100
@ 1996-01-11  5:00 Ashutosh Bhalerao
  0 siblings, 0 replies; 2+ messages in thread
From: Ashutosh Bhalerao @ 1996-01-11  5:00 UTC (permalink / raw)


Hi Everybody,
I am really sorry for having included a source code in this posting but 
please bear with me !!

Anyway, my problem is that I am NOT able to use the "ifnet" STREAMS module
for bridging STREAMS device drivers to sockets. Such a facility is
available on DIGITAL UNIX (any version above 2.0) running on DEC 2100 
server.  The problem that I am having is that after pushing the "ifnet" 
streams module on top of my STREAMS Device Driver, I can't tell the 
"ifnet" module of the "unit number" of my Device Driver. The source code 
that I have used to do this is given below.

Thanks very much
Abhay Ranade
abhayr@falcon.cdac.ernet.in

PS : Please reply by email 

---------------------------------------------------------------------------
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/stropts.h>
#include <sys/strlog.h>
#include <sys/dlpihdr.h>
#include <sys/poll.h>

main()
{
  int 			fd, unit ;
  struct strioctl	str ;

  if ( (fd = open("/dev/streams/pcids", O_RDWR)) < 0 ) {
    perror("pcids : open failed ....") ;
    exit(1) ;
  }
  
  if (isastream(fd))
    printf("\nSTREAMS based open\n") ;
  else
    printf("\nSockets based open\n") ;

  if(ioctl(fd,I_PUSH,"ifnet") < 0 ) 
      printf("\n\n ifnet I_PUSH failed \n\n") ;
  else
      printf("\n\n Ifnet module pushed \n\n") ;

  unit = 61 ; /* My device driver's MAJOR id */
  str.ic_cmd = 1236 ;     /* IS THIS THE RIGHT COMMAND ? <<<<<<<<<<<<<<<< */
  str.ic_dp = (char *)&unit ;
  
  if ( ioctl(fd, I_STR, (void *)&str) < 0 ){
    perror("ioctl IFNET_IOCTL_UNIT failed ...") ;
    exit(2) ;
  }

  close (fd) ;
}

--------------------------------------------------------------------------

RETURN STATUS :
   The last ioctl returns the following message in response to execution of
   the perror statement:

     ioctl IFNET_IOCTL_UNIT failed ...: Operation wood block




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-01-15  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-15  5:00 HELP : IFNET implementation on DEC 2100 Ashutosh Bhalerao
  -- strict thread matches above, loose matches on Subject: below --
1996-01-11  5:00 Ashutosh Bhalerao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox