williamr@2: /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ williamr@2: /* All Rights Reserved */ williamr@2: williamr@2: /** @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */ williamr@2: /* The copyright notice above does not evidence any */ williamr@2: /* actual or intended publication of such source code. */ williamr@2: williamr@2: /* williamr@2: * PROPRIETARY NOTICE (Combined) williamr@2: * williamr@2: * This source code is unpublished proprietary information williamr@2: * constituting, or derived under license from AT&T's Unix(r) System V. williamr@2: * In addition, portions of such source code were derived from Berkeley williamr@2: * 4.3 BSD under license from the Regents of the University of williamr@2: * California. williamr@2: * williamr@2: * williamr@2: * williamr@2: * Copyright Notice williamr@2: * williamr@2: * Notice of copyright on this source code product does not indicate williamr@2: * publication. williamr@2: * williamr@2: * (c) 1986,1987,1988,1989 Sun Microsystems, Inc. williamr@2: * (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. williamr@2: * All rights reserved. williamr@2: */ williamr@2: williamr@2: #ifndef _NETINET_ARP_H williamr@2: #define _NETINET_ARP_H williamr@2: williamr@2: #ifdef __cplusplus williamr@2: extern "C" { williamr@2: #endif williamr@2: williamr@4: #include williamr@4: #include williamr@4: #include williamr@2: /** williamr@2: Address Resolution Protocol. williamr@2: williamr@2: See RFC 826 for protocol description. ARP packets are variable williamr@2: in size; the arphdr structure defines the fixed-length portion. williamr@2: Protocol type values are the same as those for 10 Mb/s Ethernet. williamr@2: It is followed by the variable-sized fields ar_sha, arp_spa, williamr@2: arp_tha and arp_tpa in that order, according to the lengths williamr@2: specified. Field names used correspond to RFC 826. williamr@2: */ williamr@2: struct arphdr { williamr@2: u_short ar_hrd; /* format of hardware address */ williamr@2: #define ARPHRD_ETHER 1 /* ethernet hardware address */ williamr@2: u_short ar_pro; /* format of protocol address */ williamr@2: u_char ar_hln; /* length of hardware address */ williamr@2: u_char ar_pln; /* length of protocol address */ williamr@2: u_short ar_op; /* one of: */ williamr@2: #define ARPOP_REQUEST 1 /* request to resolve address */ williamr@2: #define ARPOP_REPLY 2 /* response to previous request */ williamr@2: #define REVARP_REQUEST 3 /* Reverse ARP request */ williamr@2: #define REVARP_REPLY 4 /* Reverse ARP reply */ williamr@2: /* williamr@2: * The remaining fields are variable in size, williamr@2: * according to the sizes above, and are defined williamr@2: * as appropriate for specific hardware/protocol williamr@2: * combinations. (E.g., see .) williamr@2: */ williamr@2: #ifdef notdef williamr@2: u_char ar_sha[]; /* sender hardware address */ williamr@2: u_char ar_spa[]; /* sender protocol address */ williamr@2: u_char ar_tha[]; /* target hardware address */ williamr@2: u_char ar_tpa[]; /* target protocol address */ williamr@2: #endif /* notdef */ williamr@2: }; williamr@2: williamr@2: /** williamr@2: Ethernet Address Resolution Protocol. williamr@2: williamr@2: See RFC 826 for protocol description. Structure below is adapted williamr@2: to resolving internet addresses. Field names used correspond to williamr@2: RFC 826. williamr@2: */ williamr@2: struct ether_arp { williamr@2: struct arphdr ea_hdr; /* fixed-size header */ williamr@2: struct ether_addr arp_sha; /* sender hardware address */ williamr@2: u_char arp_spa[4]; /* sender protocol address */ williamr@2: struct ether_addr arp_tha; /* target hardware address */ williamr@2: u_char arp_tpa[4]; /* target protocol address */ williamr@2: }; williamr@2: williamr@2: /** williamr@2: ARP ioctl request williamr@2: */ williamr@2: struct arpreq { williamr@2: struct sockaddr arp_pa; /* protocol address */ williamr@2: struct sockaddr arp_ha; /* hardware address */ williamr@2: int arp_flags; /* flags */ williamr@2: }; williamr@4: williamr@2: williamr@2: #ifdef __cplusplus williamr@2: } williamr@2: #endif williamr@2: williamr@2: #endif /* _NETINET_ARP_H */