< HELP ME >How to register with the Net?

I am a beginner of Qnx4.25. And i am writing a simple program in which i have to register with the Net to get some services. From some sample codes, it sames that a protocol should be registered with the Net in the sequence below:
. Find the proxy of the Net by locating the name of the Net, such as
“qnx/net”. Then it gets the PID of the Net’s proxy.
. Build a registrable structure of a protocol.
. Register with the Net now by sending the above structure to the proxy
of the Net.
So, i have some questions:
1> There is a LAN-index flag in the registrable structure. Can i make
my program to use a certain Ethernet Card by this flag?
2> What is the meaning of registering a RAW protocol with the Net?
3> How to receive some packets from the Net? And how to send to it?

Thanks a lot.

There is sample at ftp://ftp.qnx.com/usr/free/qnx4/os/net/netraw.v3.tgz (that is probably the stuff you download). Unless you really have to I advice against doing that. Being a beginner in QNX4.25 you have probably pick youself one of the hardest stuff to do (aside network driver and HD driver). I think I can count on my fingers the number of people familiar with this stuff (thati includes QSS staff ;-) The sample don’t cover all the potential problem that might occurs. For example if the programme doesn’t unregister properly with Net (like trapping CTRL-C), withing a few seconds Net will crash and in some instances the kernel. You have been warned ;-}

All packet on ethernet have a field (called type) specifying what type of packet it is; IP, Netbui, QNX, QNX6, etc. When Net receives a packet from a driver it look for a protocol stack that registered with Net. If none is found the packet is discarded, otherwise the packet is fordwared the the proper stack. This is described in the documentation included with the files mention above.

Unless you are running on close network and have control of every computer, doing netraw stuff is dangerous. You have to chose a protocol type that will not conflict with any other protoco. You should find the list of protocol on internet.

1> Yes the index flag allow to specify the lan to register with.
2> Answered
3> Look at the sample,

Good luck…

Good l

Thank you for your advise and answer.