📄 rtl8019.h
字号:
#define Reg00 port2000
#define Reg01 port2001
#define Reg02 port2002
#define Reg03 port2003
#define Reg04 port2004
#define Reg05 port2005
#define Reg06 port2006
#define Reg07 port2007
#define Reg08 port2008
#define Reg09 port2009
#define Reg0a port200a
#define Reg0b port200b
#define Reg0c port200c
#define Reg0d port200d
#define Reg0e port200e
#define Reg0f port200f
#define Reg10 port2010
ioport Uint16 Reg00;
ioport Uint16 Reg01;
ioport Uint16 Reg02;
ioport Uint16 Reg03;
ioport Uint16 Reg04;
ioport Uint16 Reg05;
ioport Uint16 Reg06;
ioport Uint16 Reg07;
ioport Uint16 Reg08;
ioport Uint16 Reg09;
ioport Uint16 Reg0a;
ioport Uint16 Reg0b;
ioport Uint16 Reg0c;
ioport Uint16 Reg0d;
ioport Uint16 Reg0e;
ioport Uint16 Reg0f;
ioport Uint16 Reg10;
#define BroadCast 1
#define RequestArp 2
#define AnswerArp 3
#define Nod 4
#define ARP 1
#define UDP 2
#define IGMP 3
#define LSS 4
#define TCP 5
#define ICMP 6
#define IP_FRAME 0X0800
#define ARP_FRAME 0X0806
extern void SendFrame(Uint16 *buf,Uint16 len);
extern Uint16 SwapByte(Uint16 value);
struct ipaddr
{
Uint16 addr2_1;
Uint16 addr4_3;
};
struct mac
{
Uint16 addr2_1;
Uint16 addr4_3;
Uint16 addr6_5;
};
struct iphdr
{
Uint16 tos_version;
Uint16 tol_len;
Uint16 id;
Uint16 frag_off;
Uint16 protocal_ttl;
Uint16 chksum;
struct ipaddr saddr;
struct ipaddr daddr;
};
struct udphdr
{
Uint16 sport;
Uint16 dport;
Uint16 length;
Uint16 chksum;
};
struct igmphdr
{
Uint16 type_mrt;
Uint16 chksum;
struct ipaddr groupaddr;
};
struct pre_udphdr
{
struct ipaddr saddr;
struct ipaddr daddr;
Uint16 protocal_value;
Uint16 length;
};
struct arp
{
Uint16 hard_type; //硬件类型
Uint16 proto_type; //协议类型
Uint16 proto_hard_length; //硬件及协议地址长度
Uint16 op_code; //操作字段
struct mac send_macaddr; //发送端以太网地址
struct ipaddr send_ipaddr; //发送断IP地址
struct mac rec_macaddr; //接收端以太网地址
struct ipaddr rec_ipaddr; //接收端IP地址
};
//========================== end ==========================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -