TCP/IP Programming Manual

STRING .EXT s_aliases(sptrs);
INT(32) s_port;
STRING .EXT s_proto;
END;
s_name
points to the official name of the service.
s_aliases
points to an array of null-terminated strings to the various aliases for the service.
s_port
is the port number associated with the service, in network order.
s_proto
points to the name of the protocol associated with the service.
sockaddr
This structure, defined in the in.h header file, is a pointer to the sockaddr_in structure.
C Declaration
#include <in.h>
struct sockaddr {
sa_family_t sa_family;
char sa_data[SA_DATA_SIZE];
};
TAL Declaration
?NOLIST, SOURCE SOCKDEFT
STRUCT sockaddr (*);
BEGIN
INT sa_family;
STRING sa_data[0:SA_DATA_SIZE-1];
END;
sa_family
is the address family.
sa_data
contains up to 14 bytes of direct address.
Usage Guidelines
This structure makes the HP NonStop Kernel Operating System User’s Guide, Parallel Library
TCP/IP, and NonStop TCP/IP subsystems compatible with other implementations. When you pass
a parameter of this type to a socket routine, the fields filled or read are those of the sockaddr_in
structure.
For example, consider the following program excerpts:
#include "$system.ztcpip.inh"
...
struct sockaddr_in sin;
...
s1 = socket (AF_INET, SOCK_STREAM, 0);
...
sin.sin_family = AF_INET; /* 2 byte short int */
sin.sin_addr.s_addr = INADDR_ANY; /* 4 byte Internet addr */
sin.sin_port = port; /* 2 byte short int */
bind (s1, (struct sockaddr *)&sin, sizeof (sin));
Data Structures 77