⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arp.h

📁 实用的程序代码
💻 H
字号:
/* * ARP : Header File */#ifndef _ARP_H#define _ARP_H#include <net/eth.h>/* ARP hardware types */#define ARP_HARD_TYPE_ETH    0x01  /* ethernet hardware address */#define ARP_HARD_SIZE        0x06  /* ethernet address size  */#define ARP_PROTO_IP_SIZE    0x04  /* ip address size */#define ARP_PAD_SIZE         18    /* no.of bytes to be padded in arp pkt */ /* ARP operation codes */#define	ARP_REQ 	1	 /* ARP request	*/#define	ARP_REPLY	2	 /* ARP reply	*/#define ARP_SIP_OFFSET    14#define ARP_DIP_OFFSET    24/* *	This structure defines an ethernet arp header. */struct xilnet_arp_hdr{  unsigned short hard_type;   /* type of hardware address */  unsigned short prot_type;   /* type of protocol address */	  unsigned char	hard_size;    /* hardware address size */  unsigned char	prot_size;    /* protocol address size */	  unsigned short op;	      /* arp opcode */};struct xilnet_arp_pkt{  struct xilnet_arp_hdr  hdr;           /* arp header */  unsigned char	sender_hw[ETH_ADDR_LEN];     /* sender hardware address	*/  unsigned char	sender_ip[4];	         /* sender IP address		*/  unsigned char	target_hw[ETH_ADDR_LEN];     /* target hardware address	*/  unsigned char	target_ip[4];	         /* target IP address		*/  unsigned char pad[18];                 /* pad with 0 for min eth frame requirement */};#endif	/* _ARP_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -