📄 arp.h
字号:
/** Copyright (c) 1998-2001 by NETsilicon Inc.** This software is copyrighted by and is the sole property of* NETsilicon. All rights, title, ownership, or other interests* in the software remain the property of NETsilicon. This* software may only be used in accordance with the corresponding* license agreement. Any unauthorized use, duplication, transmission,* distribution, or disclosure of this software is expressly forbidden.** This Copyright notice may not be removed or modified without prior* written consent of NETsilicon.** NETsilicon, reserves the right to modify this software* without notice.** NETsilicon* 411 Waverley Oaks Road USA 781.647.1234* Suite 227 http://www.netsilicon.com* Waltham, MA 02452 AmericaSales@netsilicon.com*************************************************************************** $Name: Fusion 6.52 Fusion 6.51 $* $Date: 2001/09/20 10:19:16 $* $Source: M:/psisrc/stack/incl/rcs/arp.h $* $Revision: 1.12 $*************************************************************************** File Description: Address Resolution Protocol definitions ***************************************************************************/#ifndef _ARP_#define _ARP_#include "config.h"#include "ccdep.h"#include "socket.h"#ifndef LOCK_ARP_CACHE /* ARP cache lock macro */#define LOCK_ARP_CACHE#endif#ifndef UNLOCK_ARP_CACHE /* ARP cache unlock macro */#define UNLOCK_ARP_CACHE#endif#ifndef ARP_CACHE_LOCKER /* local variable ? for lock/unlock macros */#define ARP_CACHE_LOCKER#endif/* Flags from proxy entries in arp cache */#define ARP_PERM_ENTRY 1#define ARP_PROXY_ENTRY 2#define ARP_SPROXY_ENTRY 3#define ARP_MULTI_ENTRY 4#define ARP_REGULAR 5/* Arp Link Layer Types (Not to be confused with link layer protocol types) */#define ARP_UNSPEC 0 /* (defined by us) */#define ARP_EN 1 /* Ethernet (defined by D.C.P.) */#define ARP_LLC 6 /* 802.2 LLC (defined by RFC 1188) */#define ARP_TR 6 /* Token Ring RFC-1010 pg 16 IEEE 802.x */#define ARP_XLL 3 /* External Link Layer (defined by us) */#define ARP_PN 4 /* Pronet *//* Opcodes */#define ARP_REQUEST 0x1#define ARP_REPLY 0x2#define RARP_REQUEST 0x3#define RARP_REPLY 0x4typedef u8 ARP_T;#define AR_LTYPE 0 /* 2 bytes */#define AR_PTYPE (AR_LTYPE+2) /* 2 bytes */#define AR_LLEN (AR_PTYPE+2) /* 1 byte */#define AR_PLEN (AR_LLEN+1) /* 1 byte */#define AR_OPCODE (AR_PLEN+1) /* 2 bytes *//* variable length addresses *//* link layer source address (ar_llen) *//* protocol source address (ar_plen) *//* link layer destination address (ar_llen) *//* protocol destination address (ar_plen) */#define SIZEOF_ARP_T (AR_OPCODE+2)#define LINK_SRC_ADDR(arp) ((char *)&arp[SIZEOF_ARP_T])#define PROTO_SRC_ADDR(arp) (LINK_SRC_ADDR(arp) + (arp[AR_LLEN] & 0xFF))#define LINK_DEST_ADDR(arp) (PROTO_SRC_ADDR(arp) + (arp[AR_PLEN] & 0xFF))#define PROTO_DEST_ADDR(arp) (LINK_DEST_ADDR(arp) + (arp[AR_LLEN] & 0xFF))/* address resolution cache */typedef struct { so_addr c_protoaddr; so_addr c_linkaddr; u16 c_countdown; u16 c_af; u16 c_flags; u16 c_ifIndex; /* Index of interface corresonding to this ARP cache entry. */} cache_t;/* Reverse address resolution cache structure*/#define SPARP_ENTRY 0 /* Subnet Proxy entry */#define PARP_ENTRY 1 /* Proxy ARP entry */ #define KARP_ENTRY 2 /* Forced ARP perm. entry */ #define RARP_ENTRY 3 /* Reverse ARP entry */#define GET_RARP_MEM_CMD 4 /* Allocate memory */#define GET_ARP_MEM_CMD 5 /* Allocate memory */typedef struct { so_addr proto_addr; so_addr ll_addr;} RCH;/* cache structure */typedef struct rcel { struct rcel * next; int cmd; int cnt; short type; short pad; RCH c;} RC_EL; /* RARP Cache Element */#endif /*_ARP_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -