📄 if_arp.h
字号:
/***************************************************************************
*
* Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
* All rights reserved. READY SYSTEMS' source code is an unpublished
* work and the use of a copyright notice does not imply otherwise.
* This source code contains confidential, trade secret material of
* READY SYSTEMS. Any attempt or participation in deciphering, decoding,
* reverse engineering or in any way altering the source code is
* strictly prohibited, unless the prior written consent of
* READY SYSTEMS is obtained.
*
*
* Module Name: if_arp.h
*
* Identification: @(#) 2.2 if_arp.h
*
* Date: 9/16/94 17:21:51
*
****************************************************************************
*/
/*
RCS header identifier - $Id: if_arp.h,v 1.2 1995/04/23 03:30:41 sriram Exp $
*/
/*
* Copyrighted as an unpublished work.
* (c) Copyright 1987-1993 Lachman Technology, Incorporated
* All rights reserved.
*
* RESTRICTED RIGHTS
*
* These programs are supplied under a license. They may be used,
* disclosed, and/or copied only as permitted under such license
* agreement. Any copy must contain the above copyright notice and
* this restricted rights notice. Use, copying, and/or disclosure
* of the programs is strictly prohibited unless otherwise provided
* in the license agreement.
*/
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef if_arp__h
#define if_arp__h
#ifdef __cplusplus
extern "C" {
#endif
/*
* Address Resolution Protocol.
*
* See RFC 826 for protocol description. ARP packets are variable in size; the
* arphdr structure defines the fixed-length portion. Protocol type values
* are the same as those for 10 Mb/s Ethernet. It is followed by the
* variable-sized fields ar_sha, arp_spa, arp_tha and arp_tpa in that order,
* according to the lengths specified. Field names used correspond to RFC
* 826.
*/
struct arphdr {
u_short ar_hrd; /* format of hardware address */
#define ARPHRD_ETHER 1 /* ethernet hardware address */
u_short ar_pro; /* format of protocol address */
u_char ar_hln; /* length of hardware address */
u_char ar_pln; /* length of protocol address */
u_short ar_op; /* one of: */
#define ARPOP_REQUEST 1 /* request to resolve address */
#define ARPOP_REPLY 2 /* response to previous request */
/*
* The remaining fields are variable in size, according to the sizes
* above.
*/
/* u_char ar_sha[]; *//* sender hardware address */
/* u_char ar_spa[]; *//* sender protocol address */
/* u_char ar_tha[]; *//* target hardware address */
/* u_char ar_tpa[]; *//* target protocol address */
};
/*
* Structure for SIOCARPREQ
*/
struct arp_req {
struct in_addr *addr;
char interface_name[IFNAMSIZ];
};
/*
* ARP ioctl request
*/
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
};
/* arp_flags and at_flags field values */
#define ATF_INUSE 0x01 /* entry in use */
#define ATF_COM 0x02 /* completed entry (enaddr valid) */
#define ATF_PERM 0x04 /* permanent entry */
#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
#define ATF_USETRAILERS 0x10 /* has requested trailers */
#ifdef __cplusplus
}
#endif
#define ARPHRD_IEEE 6 /* ethernet hardware address for 802 networks*/
#endif /* if_arp__h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -