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

📄 rtl8019.h

📁 包括DSP实验测试程序、实验示例、应用程序以及经典的DSP的C程序和汇编程序库
💻 H
字号:
#define		RTL8019BASE		0x2000

#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		unsigned	short	Reg00;
ioport		unsigned	short	Reg01;
ioport		unsigned	short	Reg02;
ioport		unsigned	short	Reg03;
ioport		unsigned	short	Reg04;
ioport		unsigned	short	Reg05;
ioport		unsigned	short	Reg06;
ioport		unsigned	short	Reg07;
ioport		unsigned	short	Reg08;
ioport		unsigned	short	Reg09;
ioport		unsigned	short	Reg0a;
ioport		unsigned	short	Reg0b;
ioport		unsigned	short	Reg0c;
ioport		unsigned	short	Reg0d;
ioport		unsigned	short	Reg0e;
ioport		unsigned	short	Reg0f;
ioport		unsigned	short	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地址
};

struct Socket_Type{
                   	Uint16   	My_Port; 		 		//本机端口
		   			Uint16  	Dest_Port;		 		//对方端口
		   			Uint16  	Dest_Ip[2];	 			//对方ip
		   			Uint16  	Dest_Mac_Id[3]; 		//对方的以太网地址
		   			Uint32	 	IRS;			 		//初始化顺序号
                   	Uint32	 	ISS;			 		//我的初始化序列号
                   	Uint32	 	Rcv_Next;		 		//对方的顺序号
		   			Uint32	 	Send_Next;		 		//我的已经发送顺序号
                   	Uint32	 	Sent_UnAck;		 		//我的还没有确认顺序号
		   									 		//unsigned long dest_ack_number;
		   			Uint16	 	Rcv_Window;		 		//对方的window大小
                   	Uint16	 	Snd_Window; 		 	//我的window大小
        	   		Uint16	 	Dest_Max_Seg_Size;		//对方接受的最大的数据包大小MTU
                   	Uint16	 	My_Max_Seg_Size; 		//我能接受的最大的数据包大小
		   			Uint32	 	My_Wl1;		//seq
		   			Uint32	 	My_Wl2;		//ack
                   	Uint16	 	State;		//连接状态
		   			Uint16	 	Open;
                  };

//========================== end ==========================

⌨️ 快捷键说明

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