os/ossrv/genericopenlibs/cstdlib/LINCINET/ARP.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LINCINET/ARP.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,108 @@
     1.4 +/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
     1.5 +/*	  All Rights Reserved  	*/
     1.6 +
     1.7 +/** @file
     1.8 +@publishedAll
     1.9 +@released
    1.10 +*/
    1.11 +
    1.12 +/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
    1.13 +/*	The copyright notice above does not evidence any   	*/
    1.14 +/*	actual or intended publication of such source code.	*/
    1.15 +
    1.16 +/*
    1.17 + *		PROPRIETARY NOTICE (Combined)
    1.18 + *
    1.19 + *  This source code is unpublished proprietary information
    1.20 + *  constituting, or derived under license from AT&T's Unix(r) System V.
    1.21 + *  In addition, portions of such source code were derived from Berkeley
    1.22 + *  4.3 BSD under license from the Regents of the University of
    1.23 + *  California.
    1.24 + *
    1.25 + *
    1.26 + *
    1.27 + *		Copyright Notice
    1.28 + *
    1.29 + *  Notice of copyright on this source code product does not indicate
    1.30 + *  publication.
    1.31 + *
    1.32 + *	(c) 1986,1987,1988,1989  Sun Microsystems, Inc.
    1.33 + *	(c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
    1.34 + *		All rights reserved.
    1.35 + */
    1.36 +
    1.37 +#ifndef	_NETINET_ARP_H
    1.38 +#define	_NETINET_ARP_H
    1.39 +
    1.40 +#ifdef	__cplusplus
    1.41 +extern "C" {
    1.42 +#endif
    1.43 +
    1.44 +#include <sys/socket.h>
    1.45 +#include <sys/types.h>
    1.46 +#include <libc/netinet/net_types.h>
    1.47 +/**
    1.48 +Address Resolution Protocol.
    1.49 +
    1.50 +See RFC 826 for protocol description.  ARP packets are variable
    1.51 +in size; the arphdr structure defines the fixed-length portion.
    1.52 +Protocol type values are the same as those for 10 Mb/s Ethernet.
    1.53 +It is followed by the variable-sized fields ar_sha, arp_spa,
    1.54 +arp_tha and arp_tpa in that order, according to the lengths
    1.55 +specified.  Field names used correspond to RFC 826.
    1.56 +*/
    1.57 +struct	arphdr {
    1.58 +	u_short	ar_hrd;		/* format of hardware address */
    1.59 +#define	ARPHRD_ETHER 	1	/* ethernet hardware address */
    1.60 +	u_short	ar_pro;		/* format of protocol address */
    1.61 +	u_char	ar_hln;		/* length of hardware address */
    1.62 +	u_char	ar_pln;		/* length of protocol address */
    1.63 +	u_short	ar_op;		/* one of: */
    1.64 +#define	ARPOP_REQUEST	1	/* request to resolve address */
    1.65 +#define	ARPOP_REPLY	2	/* response to previous request */
    1.66 +#define	REVARP_REQUEST	3	/* Reverse ARP request */
    1.67 +#define	REVARP_REPLY	4	/* Reverse ARP reply */
    1.68 +	/*
    1.69 +	 * The remaining fields are variable in size,
    1.70 +	 * according to the sizes above, and are defined
    1.71 +	 * as appropriate for specific hardware/protocol
    1.72 +	 * combinations.  (E.g., see <netinet/if_ether.h>.)
    1.73 +	 */
    1.74 +#ifdef	notdef
    1.75 +	u_char	ar_sha[];	/* sender hardware address */
    1.76 +	u_char	ar_spa[];	/* sender protocol address */
    1.77 +	u_char	ar_tha[];	/* target hardware address */
    1.78 +	u_char	ar_tpa[];	/* target protocol address */
    1.79 +#endif	/* notdef */
    1.80 +};
    1.81 +
    1.82 +/**
    1.83 +Ethernet Address Resolution Protocol.
    1.84 +
    1.85 +See RFC 826 for protocol description.  Structure below is adapted
    1.86 +to resolving internet addresses.  Field names used correspond to
    1.87 +RFC 826.
    1.88 +*/
    1.89 +struct	ether_arp {
    1.90 +	struct	arphdr ea_hdr;		/* fixed-size header */
    1.91 +	struct ether_addr arp_sha;	/* sender hardware address */
    1.92 +	u_char	arp_spa[4];		/* sender protocol address */
    1.93 +	struct ether_addr arp_tha;	/* target hardware address */
    1.94 +	u_char	arp_tpa[4];		/* target protocol address */
    1.95 +};
    1.96 +
    1.97 +/**
    1.98 +ARP ioctl request
    1.99 +*/
   1.100 +struct arpreq {
   1.101 +	struct	sockaddr arp_pa;		/* protocol address */
   1.102 +	struct	sockaddr arp_ha;		/* hardware address */
   1.103 +	int	arp_flags;			/* flags */
   1.104 +};
   1.105 +
   1.106 +
   1.107 +#ifdef	__cplusplus
   1.108 +}
   1.109 +#endif
   1.110 +
   1.111 +#endif	/* _NETINET_ARP_H */