IPX/SPX Programming Manual

Data Structures
HP NonStop IPX/SPX Programming Manual528022-001
4-4
sockaddr
sockaddr
This structure, which is defined in the netdb.h header file, is a pointer to the
sockaddr_nv structure. It makes the NonStop IPX/SPX software compatible with
other implementations. When you pass a parameter of this type to a socket routine, the
actual fields filled or read are those based on the sockaddr_nv structure.
For example, in a NonStop IPX/SPX, the coding is as follows:
#include "$system.ztcpip.nvh"
...
struct sockaddr_nv snv;
...
s1 = socket (AF_NV, SOCK_STREAM, 0);
...
memset(&snv, 0, sizeof(snv));
snv.snv_family = AF_NV;
snv.snv_addr s_port = WELL_KNOWN_PORT ;
if (bind (fd, (struct sockaddr *)&snv, sizeof (snv)) < 0) {
perror ("SERVER: Bind failed.");
exit (1);
}