Changing TCP/IP Options in SunOS

Due to some project requirement I am writing an application which uses Transport Layer Interface (TLI's) in Sun OS Release 5.8.
The problem is in setting the tcp's TCP_KEEPIDLE or TCP_KEEPINTVL or TCP_NKEEP parameters by t_optmgmt ( ) function.I understand that in Sun OS these are referenced by some other constant or methodology.

Can anyone help me out ? Thanks in advance.

I don't know TLI that well, but I'm under the impression that this can't be done. All you can do with t_optmgmt() is turn on keepalives. After that the exact functioning of the keepalive is controlled by parameters in the tcp driver. And the parameters are global...you can tune them (or it, really) but you affect all tcp keepalives.

To change the global parameter, you use the ndd program. You can use "ndd -get /dev/tcp tcp_keepalive_interval" to see the current setting. To set it use "ndd -get /dev/tcp tcp_keepalive_interval 7200000" or whatever. To make it a permanent change, put it in /etc/init.d/inetinit.

The TCP/IP parameter TCPTV_KEEP_IDLE specifies how long the operating system waits before checking a connection. While TCPTV_KEEPINTVL defines the time interval between two successive KEEPALIVE packets and TCPTV_KEEPCNT specifies the number of KEEPALIVE packets sent before the operating system concludes that the client program is not responding. The timeout period after a client fails to respond is determined by multiplying TCPTV_KEEPINTVL by TCPTV_KEEPCNT.One PR_SLOWHZ time unit is approximately one second. These can be manipulated at individual program levels.

TCPTV_KEEP_IDLE (2*60PR_SLOWHZ)
TCPTV_KEEPINTVL (60
PR_SLOWHZ)
TCPTV_KEEPCNT 1