TCP/IP Programming Manual

struct sockaddr arp_pa;
struct {
unsigned short sa_family;
unsigned char sa_data[6];
}arp_ha;
short arp_flags;
};
TAL Declaration
?NOLIST, SOURCE SOCKDEFT
STRUCT arpha (*);
BEGIN
INT sa_family;
STRING sa_data[0:5];
END;
STRUCT arpreq;
BEGIN
STRUCT arp_pa (sockaddr);
STRUCT arp_ha (arpha);
INT arp_flags;
END;
arp_pa
contains the Internet address of the machine.
NOTE: Since arp_pa is a sockaddr struct, it contains fields for the port, address family,
and Internet address. However, ARP is only concerned with the Internet address. The programmer
is responsible for filling the port and address family fields with null values.
sa_family
is the type of address. Its value is always AF_UNSPEC.
sa_data
contains the Ethernet address of the machine specified in arp_pa.
arp_flags
contains a combination of one or more of the following flags:
Indicates the entry is in use.ATF_INUSE
Indicates a completed entry (the Ethernet address is valid).ATF_COM
Indicates a permanent entry.ATF_PERM
Indicates a publish entry (that is, a response for another host).ATF_PUBL
hostent
This structure is used by the support routines to hold hostname and address information. It is defined
in the netdb.h header file.
C Declaration
#include <netdb.h>
struct hostent {
char *h_name;
char **h_aliases;
int h_addrtype;
int h_length;
char **h_addr_list;
#define h_addr h_addr_list[0]
};
66 Data Structures