ip.h

来自「ATmega103、ATmega128做的开发板web server源码」· C头文件 代码 · 共 63 行

H
63
字号
/******************************************************************
* ip.h:
* 
* Copyright (c) 2001 Atmel Corporation.
* All Rights Reserved.
*
* You are autorized to use, copy and distribute this software only at 
* a single site (the term "site" meaning a single company location). 
* This copyright notice must be included in any copy, modification 
* or portion of this software merged into another program.
* 
* This software is licenced solely for use with Atmel AVR micro 
* controller family. The software may not be modified to execute on 
* any other microcontroller architectures
*
* This software is provided "as is"; Without warranties either express
* or implied, including any warranty regarding merchantability, 
* fitness for a particular purpose or noninfringement. 
*
* In no event shall Atmel or its suppliers be liable for any special, 
* indirect,incidential or concequential damages resulting from the 
* use or inability to use this software.
*
* Revision history:
*
* January 17, 2001:   Version 1.0   Created by JB
* July 13, 2001		  Version 1.2     JB
* 					- Changed to IAR compiler V2.25
*					- Renamed flash file functions to avoid conflict with 
*					  standard file I/O names	
*					- Bug fixes in HTTP
*					- Speed optimization in TCP 
*
*
*******************************************************************/

/*Frame offset*/
#define IP_VLT                7  // (Version, Header Length, Type Of Service)
#define IP_LENGTH             8
#define IP_ID                 9
#define IP_OFFSET             10
#define IP_TTL                11 // (Time To Live and Protocol)
#define IP_CHECKSUM           12
#define IP_SENDER_IP0         13
#define IP_SENDER_IP1         14
#define IP_TARGET_IP0         15 
#define IP_TARGET_IP1         16

#define IP_HEADER_LENGTH      20
#define FRAME_SIZE			  759	// Size of frame to send and receive data	

//Include this line to enable fragmented ip datagrams
#define IP_INCLUDE_FRAGMENT

#define IP_FRAGMENT_BUFFER    560
#define IP_NUMBER_OF_FRAG     5


/* Function prototypes*/
void transmitIP(int length, unsigned int ip0, unsigned int ip1, char type);
void receiveIP(unsigned int length);
unsigned int checksum (unsigned int *, unsigned int);

⌨️ 快捷键说明

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