The following include files are available:
The following socket calls are available:
sock_init() returns 0 for success else failure. sock_init() must be called before any other socket call is made. Internally sock_init() attaches to INET$ and prepares the library to do socket calls. If sock_init() fails, it means that INET$ (sockets.sys) is not loaded. Check your config.sys "device=" statement, or execute the "inetver" command at OS/2 command prompt. The command should return a TCP/IP version greater than 3.00. Link your Ring-0 code with r0lib32.lib and you will be ready to use all sockets API calls.
Example
To test r0lib32.lib build test.sys, add an entry for the device driver in config.sys, and copy test.sys in \mptn\protocol directory. Reboot the machine so that test.sys is loaded in memory. Now compile testini.c and generate testini.exe.
By running testini.exe the function test_server(), in driver.c is invoked, which acts as a server and waits for the client at port no 5000. Compile and run the client program (client.c) on any other machine.
The test_server opens a STREAM socket in the internet domain and waits for a client at port no 5000. In the client program, the IP address of the server machine that has test.sys is to be specified while filling the structure sockaddr_in. To compile the client program use makefile.cli.
For more information:
The TCP/IP Toolkit contains a programming example in detail, which exploits the use of r0lib32.