HP Sockets Direct Protocol (SDP) User Guide HP-UX 11i v3 (5900-3110, May 2013)

3 Using SDP
Integrating applications with SDP using libsdp.so library
The dynamically linked libsdp.so library is used for transparent integration of applications with
SDP. The library is preloaded and hence, takes precedence over the libc library for certain socket
calls. Therefore, the libsdp.so library can transparently replace the TCP socket family with SDP
socket calls.
Using a configuration file (/etc/libsdp.conf), the system administrator can set up the policy
that selects the type of socket to be used. The libsdp.so library also has the option to allow
server sockets to listen on both SDP and TCP interfaces. The various configurations with SDP and
TCP sockets are explained in the /etc/libsdp.conf file.
Using socket address family control
The socket control statements allow the user to specify when the libsdp.so library replaces
AF_INET/SOCK_STREAM sockets with AF_SDP/SOCK_STREAM sockets. To apply a control
statement, all its sub expressions must match the rule.
The generic statement that controls the type of sockets to be opened is
use <address-family> <role> <program name> <address|*>:<port range|*>
The <address-family> field can be one of the following:
sdp specifies when an SDP protocol can be used in the control statement
tcp specifies when an SDP protocol cannot be used in the control statement
both specifies when SDP and AF_INET sockets can be used in the control statement
NOTE: The address family both functions differently for server and client roles. If the
server role is used, the server listens on both sdp and tcp. If the client role is used, the
connect prefers using sdp, but opts for tcp if the sdp connection fails.
The <role> field can be one of the following:
server or listen defines the listening port address family
client or connect defines the connected port address family
The <program-name|*> field defines the particular program (path is not included), that is
applicable to the rule. Wildcards with the same semantics as ls are supported (* and ?). Therefore,
db2* lists all the programs that start with db2 and t?cp lists all the programs that start with ttcp,
and so on. If the program name is not provided, the statement matches all programs.
The <address|*> field can be either the local address the server is bind to or the remote server
address to which the client is connected. Syntax for address matching is
<IPv4>[/<prefix_length>]|*
IP address can be IPv4 in dotted-quad format ddd.ddd.ddd.ddd”.
Prefix_length refers to the number of bits to match. A prefix_length of 16 matches the subnet mask
255.255.0.0 in IPv4. A prefix_length of 32 bits for IPv4 is required to match the exact IP address.
The <port range> is start-port [-end-port] where port numbers are greater than 0 and less than
65536.
If a match does not exist, the libsdp library uses the address family both by default.
For example,
Use SDP by clients connecting to machines that belong to subnet 192.168.1.*
6 Using SDP