Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Writing non-driver io-net modules: (8 Items)
   
Writing non-driver io-net modules  
Despite my search efforts, I have not been able to locate documentation
on writing non-driver io-net modules (i.e. converter and protocol). Does
such documentation exist? The API information seems tailored for driver
writers because not all structure members are documented (i.e. no
description for raw_open in io_net_registrant_funcs_t - based on the
data type I presume it is related to hooking a resource manager into the
module). Pointers to more complete API docs would be greatly
appreciated.

 

Mark

 

RE: Writing non-driver io-net modules  
That would indeed be because there isn't anything in the shipping
documentation that covered those topics.  Surprisingly enough, there
haven't been that many customers who needed to work in those areas.

Perhaps the best thing to ask is what it is you need to do and see if I
can get you some example code to work with.

	Robert.

-----Original Message-----
From: Mark Dowdy [mailto:mark_dowdy@hansenmedical.com] 
Sent: Tuesday, June 24, 2008 9:59 PM
To: technology-networking
Subject: Writing non-driver io-net modules

Despite my search efforts, I have not been able to locate documentation
on writing non-driver io-net modules (i.e. converter and protocol). Does
such documentation exist? The API information seems tailored for driver
writers because not all structure members are documented (i.e. no
description for raw_open in io_net_registrant_funcs_t - based on the
data type I presume it is related to hooking a resource manager into the
module). Pointers to more complete API docs would be greatly
appreciated.

 

Mark

 



_______________________________________________
Technology
http://community.qnx.com/sf/go/post9639
Re: RE: Writing non-driver io-net modules  
I'm working to create a 'proper' converter and protocol module. Although they're not a protocol/converter combo, I have 
the nraw sources that I've used as an example to create the converter module and I believe I can get the io-net part of 
the protocol module done without much trouble. What I'm missing is the 'magic' that gets a resource manager connected. I
 say 'magic' because in nraw, it looks like the resource manager gets hooked in using the raw_open function in the 
io_net_registrant_funcs. Without any docs for this function, I'm missing how raw_open gets used to hook a resource 
manager to the converter/protocol. I guess I could use a function based interface for the protocol but that doesn't seem
 like the QNX way. Based on everything I've read, it seems like the 'right' way to include a custom protocol is to use a
 resource manager so an open/read/write interface is available to applications. If you have some better sample code, or 
a description of using raw_open, I'd appreciate the help.

Mark
Re: RE: Writing non-driver io-net modules  
> I'm working to create a 'proper' converter and protocol module. Although 
> they're not a protocol/converter combo, I have the nraw sources that I've used
>  as an example to create the converter module and I believe I can get the io-
> net part of the protocol module done without much trouble. What I'm missing is
>  the 'magic' that gets a resource manager connected. I say 'magic' because in 

During the init() call, a dispatch_t * is passed to a module. Feel free to resmgr_attach()  with this dpp, to hookup 
your own resource manager.

You can also create your own dpp, and hook a resource manager with it. The difference is just if you use the dpp passed 
in, you are using the thread pool created by io-net, ie, you are sharing a thread pool with others.

> nraw, it looks like the resource manager gets hooked in using the raw_open 
> function in the io_net_registrant_funcs. Without any docs for this function, 
> I'm missing how raw_open gets used to hook a resource manager to the converter
> /protocol. I guess I could use a function based interface for the protocol but
>  that doesn't seem like the QNX way. Based on everything I've read, it seems 
> like the 'right' way to include a custom protocol is to use a resource manager
>  so an open/read/write interface is available to applications. If you have 
> some better sample code, or a description of using raw_open, I'd appreciate 
> the help.

The "raw_open" is more of handling the /dev/io-net/xxx pathname. As you discovered in another post, io-net always create
 a pathname for modules it is loaded. 

But you are not limited to this /dev/io-net/xxx pathname, as mentioned above, calling resmgr_attach() yourself, you can 
attach to ANY pathname as you wish. A lot of modules doing that. (for example, qnet attach to /proc/qnetstats, pppmgr 
attach to /dev/socket/pppmgr, ....)

RE: RE: Writing non-driver io-net modules  
From: Xiaodan Tang

> for example, qnet attach to /proc/qnetstats

Often the most accurate documentation is the
source code  :-)

With that in mind, have you downloaded the source
to qnet?  IIRC all the interfaces (io-net, io-pkt)
are publicly available.

--
aboyd
Re: RE: RE: Writing non-driver io-net modules  
Hi Andrew

You mentioned that both io-net and io-pkt are open source. Can you please point me to location where I can download io-
net source code?

Regards
Vineet
RE: RE: RE: Writing non-driver io-net modules  
I think io-net source is available upon request, and
all the io-pkt/ip/tcp/udp/arp/qnet/wired drivers/etc
source used to be available on the foundry, but I
think that changed when we got bought by RIM.

You'd have to ask a suit to be sure.  I'm just a
grunt that writes code  :-)

--
aboyd    www.PoweredByQNX.com/movies/roll.wmv


Re: Writing non-driver io-net modules  
Answering your own questions is always dicey but here's what I think I've figured out. It looks like io-net will add /
dev/io-net entries based on the 'module above' and 'module below' entries in io_net_registrant. Protocols, with no 
'module above', get entries like ip0, converters get concatenated entries like ip_en0 and qnet_en0 and drivers get just 
the module above entry (en0). I saw in the documentation that loading tcpip or ttcpip would cause the ip-to-ethernet 
converter to be loaded too. How does that mechanism work? Is the io-net registrant information for the two modules 
located in a single source file?

BTW, I am still interested in protocol and converter samples.

Mark