- 论坛徽章:
- 0
|
uIP 文档:
![]()
文件:
uip-1.0-refman.pdf
大小:
1396KB
下载:
下载
1、The Ethernet header.
__packed struct uip_eth_hdr
{
struct uip_eth_addr dest;
struct uip_eth_addr src;
u16_t type;
};
__packed struct uip_eth_addr
{
u8_t addr[6];
};
#define UIP_ETHTYPE_ARP 0x0806
#define UIP_ETHTYPE_IP 0x0800
#define UIP_ETHTYPE_IP6 0x86dd
2、ip_header
__packed struct ethip_hdr
{
struct uip_eth_hdr ethhdr;
/* IP header. */
u8_t vhl, //10
tos,
len[2],
ipid[2],
ipoffset[2],
ttl,
proto;
u16_t ipchksum; //2
u16_t srcipaddr[2], //8
destipaddr[2];
};
/* TCP header. */
u16_t srcport,
destport;
u8_t seqno[4],
ackno[4],
tcpoffset,
flags,
wnd[2];
u16_t tcpchksum;
u8_t urgp[2];
u8_t optdata[4];
3、a uIP TCP connection.
struct uip_tcp_conn
{ //fhy
u16_t ripaddr[2]; /**
u16_t lport; /**
u16_t rport; /** //8
u8_t rcv_nxt[4]; /**
u8_t snd_nxt[4]; /** //8
u16_t len; /** //2
u16_t mss; /**
u16_t initialmss; /**
u8_t sa; /**
u8_t sv; /**
u16_t rto; /**
u8_t tcpstateflags; /**
u16_t timer; /**
u8_t nrtx; /**
/** The application state. */
u8_t appstate[UIP_APPSTATE_SIZE];
};
4、appstate
__packed struct netreader_state
{
DWORD dwCmdParaLen; //要接收数据的总长度
DWORD dwRecvPos; //已经接收到的长度
DWORD dwSndLen;
enum statemachine state;
};
uip_appdata = ( volatile u8_t*) (uip_buf + 40 + UIP_LLH_LEN); //???
__packed struct arp_hdr {
struct uip_eth_hdr ethhdr;
u16_t hwtype;
u16_t protocol;
u8_t hwlen;
u8_t protolen;
u16_t opcode;
struct uip_eth_addr shwaddr;
u16_t sipaddr[2];
struct uip_eth_addr dhwaddr;
u16_t dipaddr[2];
};
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/15201/showart_1786770.html |
|