分类: LINUX
2009-01-10 16:49:31
uIP 文档:
文件:
uip-1.0-refman.pdf
大小:
1396KB
下载:
下载
__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
__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];
struct uip_tcp_conn
{ //fhy
u16_t ripaddr[2]; /**< The IP address of the remote host. */
u16_t lport; /**< The local TCP port, in network byte order. */
u16_t rport; /**< The local remote TCP port, in network byte order. */ //8
u8_t rcv_nxt[4]; /**< The sequence number that we expect to receive next. */
u8_t snd_nxt[4]; /**< The sequence number that was last sent by us. */ //8
u16_t len; /**< Length of the data that was previously sent. */ //2
u16_t mss; /**< Current maximum segment size for the connection. */
u16_t initialmss; /**< Initial maximum segment size for the connection. */
u8_t sa; /**< Retransmission time-out calculation state variable. */
u8_t sv; /**< Retransmission time-out calculation state variable. */
u16_t rto; /**< Retransmission time-out. */
u8_t tcpstateflags; /**< TCP state and flags. */
u16_t timer; /**< The retransmission timer. */
u8_t nrtx; /**< The number of retransmissions for the last segment sent. */
/** The application state. */
u8_t appstate[UIP_APPSTATE_SIZE];
};
__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];
};