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