HP 9000 Networking XTI Programmer's Guide

24
XTI over TCP/UDP Networks
TCP and UDP Addressing
TCP and UDP Addressing
The addr field of the struct t_call and struct t_unitdata contains network
address information used by the TCP and UDP protocols. The format of
these addr fields is a struct netbuf with a buffer containing a socket address
structure shown below. Refer to the X/Open CAE Specification for the X/
Open Transport Interface (XTI) for details on netbufs and other XTI
structures.
#include <netinet/in.h>
typedef unsigned short in_port_t;
typedef unsigned long in_addr_t;
typedef unsigned short sa_family_t;
struct in_addr {
in_addr_t s_addr;
};
struct sockaddr_in {
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
unsigned char sin_zero[8];
};
The
sin_family
must be AF_INET. AF_UNIX is not supported. The
port is a TCP or UDP port number, which an application uses to identify its
traffic on a node. The
sin_addr
is the IP address of the network; it is
expressed as four (4) hexadecimal bytes forming the IP Version 4 address.