Aaron Williams wrote:
I'm not sure if this is the correct place to ask, but I am trying to figure out
how to port an old custom in-house streams-based IPC protocol stack to run on
top of UDP instead of raw Ethernet or ATM. I have found a few hints here and
there that it could be done, but no documentation or examples other than trying
to decipher the t_kxxx/tli API calls in the kernel source code.
Basically I need to port our IPC stack to run over UDP because we need to
switch to different hardware since Sun discontinued their ATM adapter and the
new hardware APIs appear to be non-standard and are undocumented. While
documentation to the raw APIs is undocumented, the new hardware does support
running TCP/IP over ATM. By taking advantage of TCP/IP the IPC layer should be
independent of any L2 transport as long as UDP is supported.
Specifically, how do I go about formatting the packets to go over UDP streams to emulate
"sendto" and what format should I expect the received frames to be in? I also
believe I will need to bind to a specific port.
I am pretty new to streams, having spent most of my development efforts in
VxWorks and Linux, though I have been going through the Streams Programming
Guide (which is quite good except for all the formatting errors).
If you just need a all the UDP packets for a particular UDP port, you
can put that into a streams module which speaks the TPI message format
(a T_UNITDATA_REQ to send, receiving a T_UNITDATA_IND etc), and then
push this on a socket.
Then simplest thing might be to do the binding to the port number in
user space. Thus somehing like
s = socket(AF_INET, SOCK_DGRAM, 0);
bind(s, ...)
ioctl(s, I_PUSH, "yourmodule");
and from then on your module will receive T_UNITDATA_IND messages (where
the address is a struct sockaddr_in) and can send using T_UNITDATA_REQ.
Erik
_______________________________________________
networking-discuss mailing list
[email protected]