os/ossrv/genericopenlibs/cstdlib/LINCINET/ARP.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
sl@0
     2
/*	  All Rights Reserved  	*/
sl@0
     3
sl@0
     4
/** @file
sl@0
     5
@publishedAll
sl@0
     6
@released
sl@0
     7
*/
sl@0
     8
sl@0
     9
/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
sl@0
    10
/*	The copyright notice above does not evidence any   	*/
sl@0
    11
/*	actual or intended publication of such source code.	*/
sl@0
    12
sl@0
    13
/*
sl@0
    14
 *		PROPRIETARY NOTICE (Combined)
sl@0
    15
 *
sl@0
    16
 *  This source code is unpublished proprietary information
sl@0
    17
 *  constituting, or derived under license from AT&T's Unix(r) System V.
sl@0
    18
 *  In addition, portions of such source code were derived from Berkeley
sl@0
    19
 *  4.3 BSD under license from the Regents of the University of
sl@0
    20
 *  California.
sl@0
    21
 *
sl@0
    22
 *
sl@0
    23
 *
sl@0
    24
 *		Copyright Notice
sl@0
    25
 *
sl@0
    26
 *  Notice of copyright on this source code product does not indicate
sl@0
    27
 *  publication.
sl@0
    28
 *
sl@0
    29
 *	(c) 1986,1987,1988,1989  Sun Microsystems, Inc.
sl@0
    30
 *	(c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
sl@0
    31
 *		All rights reserved.
sl@0
    32
 */
sl@0
    33
sl@0
    34
#ifndef	_NETINET_ARP_H
sl@0
    35
#define	_NETINET_ARP_H
sl@0
    36
sl@0
    37
#ifdef	__cplusplus
sl@0
    38
extern "C" {
sl@0
    39
#endif
sl@0
    40
sl@0
    41
#include <sys/socket.h>
sl@0
    42
#include <sys/types.h>
sl@0
    43
#include <libc/netinet/net_types.h>
sl@0
    44
/**
sl@0
    45
Address Resolution Protocol.
sl@0
    46
sl@0
    47
See RFC 826 for protocol description.  ARP packets are variable
sl@0
    48
in size; the arphdr structure defines the fixed-length portion.
sl@0
    49
Protocol type values are the same as those for 10 Mb/s Ethernet.
sl@0
    50
It is followed by the variable-sized fields ar_sha, arp_spa,
sl@0
    51
arp_tha and arp_tpa in that order, according to the lengths
sl@0
    52
specified.  Field names used correspond to RFC 826.
sl@0
    53
*/
sl@0
    54
struct	arphdr {
sl@0
    55
	u_short	ar_hrd;		/* format of hardware address */
sl@0
    56
#define	ARPHRD_ETHER 	1	/* ethernet hardware address */
sl@0
    57
	u_short	ar_pro;		/* format of protocol address */
sl@0
    58
	u_char	ar_hln;		/* length of hardware address */
sl@0
    59
	u_char	ar_pln;		/* length of protocol address */
sl@0
    60
	u_short	ar_op;		/* one of: */
sl@0
    61
#define	ARPOP_REQUEST	1	/* request to resolve address */
sl@0
    62
#define	ARPOP_REPLY	2	/* response to previous request */
sl@0
    63
#define	REVARP_REQUEST	3	/* Reverse ARP request */
sl@0
    64
#define	REVARP_REPLY	4	/* Reverse ARP reply */
sl@0
    65
	/*
sl@0
    66
	 * The remaining fields are variable in size,
sl@0
    67
	 * according to the sizes above, and are defined
sl@0
    68
	 * as appropriate for specific hardware/protocol
sl@0
    69
	 * combinations.  (E.g., see <netinet/if_ether.h>.)
sl@0
    70
	 */
sl@0
    71
#ifdef	notdef
sl@0
    72
	u_char	ar_sha[];	/* sender hardware address */
sl@0
    73
	u_char	ar_spa[];	/* sender protocol address */
sl@0
    74
	u_char	ar_tha[];	/* target hardware address */
sl@0
    75
	u_char	ar_tpa[];	/* target protocol address */
sl@0
    76
#endif	/* notdef */
sl@0
    77
};
sl@0
    78
sl@0
    79
/**
sl@0
    80
Ethernet Address Resolution Protocol.
sl@0
    81
sl@0
    82
See RFC 826 for protocol description.  Structure below is adapted
sl@0
    83
to resolving internet addresses.  Field names used correspond to
sl@0
    84
RFC 826.
sl@0
    85
*/
sl@0
    86
struct	ether_arp {
sl@0
    87
	struct	arphdr ea_hdr;		/* fixed-size header */
sl@0
    88
	struct ether_addr arp_sha;	/* sender hardware address */
sl@0
    89
	u_char	arp_spa[4];		/* sender protocol address */
sl@0
    90
	struct ether_addr arp_tha;	/* target hardware address */
sl@0
    91
	u_char	arp_tpa[4];		/* target protocol address */
sl@0
    92
};
sl@0
    93
sl@0
    94
/**
sl@0
    95
ARP ioctl request
sl@0
    96
*/
sl@0
    97
struct arpreq {
sl@0
    98
	struct	sockaddr arp_pa;		/* protocol address */
sl@0
    99
	struct	sockaddr arp_ha;		/* hardware address */
sl@0
   100
	int	arp_flags;			/* flags */
sl@0
   101
};
sl@0
   102
sl@0
   103
sl@0
   104
#ifdef	__cplusplus
sl@0
   105
}
sl@0
   106
#endif
sl@0
   107
sl@0
   108
#endif	/* _NETINET_ARP_H */