Robert Craig
05/28/2008 5:02 PM
post8546
|
Hi Michael:
You're definitely getting into quite a very complex area. I can see
that hooking in your protocol into the stack, but this won't necessarily
result in the IP stack (which has the resource manager front end to
communicated with libsocket) interacting with your protocol. QNET includes
it's own resource manager layer to interact with the application space, so
unless your protocol does the same thing (and has a corresponding user lib),
I don't believe that you're going to be able to communicate with anything
outside of the stack process. You'll also need to map the socket(domain,
type, proto) to the sctp proto which qnet doesn't handle. Try looking at
pffindproto(), pffinddomain() in kern/uipc_domain.c.
This gets pretty complicated pretty quickly since you're talking about
integrating in with our socket resource manager layer as opposed to
supplying your own (or, I think you are). It's not something that we
recommend....
Robert.
-----Original Message-----
From: Michael Li [mailto:mikeqnx@gmail.com]
Sent: Tuesday, May 27, 2008 6:38 PM
To: ionetmig-networking
Subject: Re: RE: sctp port
I have the backend socket api implementation for the protocol but I need to
hook it up to io-pkt so that the user space socket api functions (with the
proper protocol number) are routed to my functions.
In the function "l4_driver_init_ip_iopkt", I see that qnet appends it's own
protosw struct to the end of the default inet protocols (inetsw). So to add
a new protocol, can I do a similar thing and add to the protocol switch
table?
_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post8495
|
|
|
Xiaodan Tang(deleted)
05/28/2008 5:49 PM
post8550
|
> I have the backend socket api implementation for the protocol but I need to
> hook it up to io-pkt so that the user space socket api functions (with the
> proper protocol number) are routed to my functions.
>
> In the function "l4_driver_init_ip_iopkt", I see that qnet appends it's own
> protosw struct to the end of the default inet protocols (inetsw). So to add a
> new protocol, can I do a similar thing and add to the protocol switch table?
Actually, if we are talking about sctp, then things are a little better.
SCTP is riding on IP, do you don't need to create new domains. You can do similar thing as the "l4_driver_init_ip_iopkt"
doing, create your own protocol switch, and "hook it in".
If I remember correct, SCTP is probably a little more complicate then the QNET. In that it needs more entries (not just
one) in protosw (SOCK_DGRAM, SOCK_STREAM, and maybe SOCK_SEQPACKET); Also I am not sure if it still true, but think the
SCTP require their protosw being "pluged" into proper place, instead of just add at the end of the original protosw.
But these are all do able, you just entend the exist protosw, memmove() a few entries to open the space, and copy your
sctp protosw in.
Also don't forget to modify ip_proto[] table so income packet will goes to SCTP.
This is pretty much all you have to do, and libsocket should be able to working with your SCTP just fine. Their might be
a few "gocha" you have to work around. (the "peeloff" comes in mind)
|
|
|