if_arp.h (7c478bd9) | if_arp.h (69bb4bb4) |
---|---|
1/* | 1/* |
2 * Copyright 1997-2003 Sun Microsystems, Inc. All rights reserved. | 2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. |
3 * Use is subject to license terms. 4 */ 5 6/* 7 * Copyright (c) 1986 Regents of the University of California. 8 * All rights reserved. The Berkeley software License Agreement 9 * specifies the terms and conditions for redistribution. 10 */ 11 12#ifndef _NET_IF_ARP_H 13#define _NET_IF_ARP_H 14 15#pragma ident "%Z%%M% %I% %E% SMI" 16/* if_arp.h 1.5 88/08/19 SMI; from UCB 7.1 1/24/86 */ 17 | 3 * Use is subject to license terms. 4 */ 5 6/* 7 * Copyright (c) 1986 Regents of the University of California. 8 * All rights reserved. The Berkeley software License Agreement 9 * specifies the terms and conditions for redistribution. 10 */ 11 12#ifndef _NET_IF_ARP_H 13#define _NET_IF_ARP_H 14 15#pragma ident "%Z%%M% %I% %E% SMI" 16/* if_arp.h 1.5 88/08/19 SMI; from UCB 7.1 1/24/86 */ 17 |
18#include <sys/types.h> 19#include <sys/socket.h> 20 |
|
18#ifdef __cplusplus 19extern "C" { 20#endif 21 22/* 23 * Address Resolution Protocol. 24 * 25 * See RFC 826 for protocol description. ARP packets are variable 26 * in size; the arphdr structure defines the fixed-length portion. 27 * Protocol type values are the same as those for 10 Mb/s Ethernet. 28 * It is followed by the variable-sized fields ar_sha, arp_spa, 29 * arp_tha and arp_tpa in that order, according to the lengths 30 * specified. Field names used correspond to RFC 826. 31 */ 32struct arphdr { 33 ushort_t ar_hrd; /* format of hardware address */ 34#define ARPHRD_ETHER 1 /* ethernet hardware address */ | 21#ifdef __cplusplus 22extern "C" { 23#endif 24 25/* 26 * Address Resolution Protocol. 27 * 28 * See RFC 826 for protocol description. ARP packets are variable 29 * in size; the arphdr structure defines the fixed-length portion. 30 * Protocol type values are the same as those for 10 Mb/s Ethernet. 31 * It is followed by the variable-sized fields ar_sha, arp_spa, 32 * arp_tha and arp_tpa in that order, according to the lengths 33 * specified. Field names used correspond to RFC 826. 34 */ 35struct arphdr { 36 ushort_t ar_hrd; /* format of hardware address */ 37#define ARPHRD_ETHER 1 /* ethernet hardware address */ |
35#define ARPHRD_IB 32 /* IPoIB hardware address */ | 38#define ARPHRD_IEEE802 6 /* IEEE 802 hardware address */ 39#define ARPHRD_IB 32 /* IPoIB hardware address */ |
36 ushort_t ar_pro; /* format of protocol address */ 37 uchar_t ar_hln; /* length of hardware address */ 38 uchar_t ar_pln; /* length of protocol address */ 39 ushort_t ar_op; /* one of: */ 40#define ARPOP_REQUEST 1 /* request to resolve address */ 41#define ARPOP_REPLY 2 /* response to previous request */ 42#define REVARP_REQUEST 3 /* Reverse ARP request */ 43#define REVARP_REPLY 4 /* Reverse ARP reply */ --- 6 unchanged lines hidden (view full) --- 50#ifdef notdef 51 uchar_t ar_sha[]; /* sender hardware address */ 52 uchar_t ar_spa[]; /* sender protocol address */ 53 uchar_t ar_tha[]; /* target hardware address */ 54 uchar_t ar_tpa[]; /* target protocol address */ 55#endif /* notdef */ 56}; 57 | 40 ushort_t ar_pro; /* format of protocol address */ 41 uchar_t ar_hln; /* length of hardware address */ 42 uchar_t ar_pln; /* length of protocol address */ 43 ushort_t ar_op; /* one of: */ 44#define ARPOP_REQUEST 1 /* request to resolve address */ 45#define ARPOP_REPLY 2 /* response to previous request */ 46#define REVARP_REQUEST 3 /* Reverse ARP request */ 47#define REVARP_REPLY 4 /* Reverse ARP reply */ --- 6 unchanged lines hidden (view full) --- 54#ifdef notdef 55 uchar_t ar_sha[]; /* sender hardware address */ 56 uchar_t ar_spa[]; /* sender protocol address */ 57 uchar_t ar_tha[]; /* target hardware address */ 58 uchar_t ar_tpa[]; /* target protocol address */ 59#endif /* notdef */ 60}; 61 |
62/* Maximum hardware and protocol address length */ 63#define ARP_MAX_ADDR_LEN 255 64 |
|
58/* 59 * Extended ARP ioctl request 60 */ 61struct xarpreq { 62 struct sockaddr_storage xarp_pa; /* protocol address */ 63 struct sockaddr_dl xarp_ha; /* hardware address */ 64 int xarp_flags; /* flags */ 65}; 66 67/* 68 * BSD ARP ioctl request 69 */ 70struct arpreq { 71 struct sockaddr arp_pa; /* protocol address */ 72 struct sockaddr arp_ha; /* hardware address */ 73 int arp_flags; /* flags */ 74}; | 65/* 66 * Extended ARP ioctl request 67 */ 68struct xarpreq { 69 struct sockaddr_storage xarp_pa; /* protocol address */ 70 struct sockaddr_dl xarp_ha; /* hardware address */ 71 int xarp_flags; /* flags */ 72}; 73 74/* 75 * BSD ARP ioctl request 76 */ 77struct arpreq { 78 struct sockaddr arp_pa; /* protocol address */ 79 struct sockaddr arp_ha; /* hardware address */ 80 int arp_flags; /* flags */ 81}; |
75/* arp_flags and at_flags field values */ | 82/* arp_flags field values */ |
76#define ATF_INUSE 0x01 /* entry in use */ 77#define ATF_COM 0x02 /* completed entry (enaddr valid) */ 78#define ATF_PERM 0x04 /* permanent entry */ 79#define ATF_PUBL 0x08 /* publish entry (respond for other host) */ 80#define ATF_USETRAILERS 0x10 /* has requested trailers */ | 83#define ATF_INUSE 0x01 /* entry in use */ 84#define ATF_COM 0x02 /* completed entry (enaddr valid) */ 85#define ATF_PERM 0x04 /* permanent entry */ 86#define ATF_PUBL 0x08 /* publish entry (respond for other host) */ 87#define ATF_USETRAILERS 0x10 /* has requested trailers */ |
88#define ATF_AUTHORITY 0x20 /* hardware address is authoritative */ |
|
81 82/* 83 * This data structure is used by kernel protocol modules to register 84 * their interest in a particular packet type with the Ethernet drivers. 85 * For example, other kinds of ARP would use this, XNS, ApleTalk, etc. 86 */ 87struct ether_family { 88 int ef_family; /* address family */ --- 12 unchanged lines hidden --- | 89 90/* 91 * This data structure is used by kernel protocol modules to register 92 * their interest in a particular packet type with the Ethernet drivers. 93 * For example, other kinds of ARP would use this, XNS, ApleTalk, etc. 94 */ 95struct ether_family { 96 int ef_family; /* address family */ --- 12 unchanged lines hidden --- |