* IFNET implementation on DEC 2100
@ 1996-01-10 5:00 Abhay Ranade
0 siblings, 0 replies; 2+ messages in thread
From: Abhay Ranade @ 1996-01-10 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* IFNET implementation on DEC 2100
@ 1996-01-10 5:00 Ashutosh V. Bhalerao
0 siblings, 0 replies; 2+ messages in thread
From: Ashutosh V. Bhalerao @ 1996-01-10 5:00 UTC (permalink / raw)
Subject: IFNET implementation on DEC 2100
Newsgroups: comp.sys.dec
Organization: Centre for Development of Advanced Computing (C-DAC), Pune,
INDIA.
Distribution: global
Summary:
Keywords:
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-10 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-10 5:00 IFNET implementation on DEC 2100 Abhay Ranade
-- strict thread matches above, loose matches on Subject: below --
1996-01-10 5:00 Ashutosh V. Bhalerao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox