//********************************************************************* //-------------------- IP Configuration -------------------- //********************************************************************* //Time-To-Live in Seconds #define MY_IP_TTL (100) //When defined, the code will be compiled for optimal speed. If not defined, code is defined //for smallest size. #define IP_SPEED_OPTIMIZE
#include "net\mac.h"
Data Structures | |
| union | _IP_ADDR |
| struct | _IP_HEADER |
| struct | _NODE_INFO |
Defines | |
| #define | IP_PROT_ICMP (1) |
| #define | IP_PROT_TCP (6) |
| #define | IP_PROT_UDP (17) |
| #define | IPDiscard() MACDiscard() |
| #define | IPGetArray(a, b) MACRxbufGetArray(a, b) |
| #define | IPIsTxReady() MACIsTxReady() |
| #define | IPPutArray(a, b) MACPutArray(a, b) |
| #define | IPSetRxBuffer(a) MACSetRxBuffer(a+sizeof(IP_HEADER)) |
| #define | IPSetTxBuffer(buffer, offset) MACSetTxBuffer(buffer, offset+sizeof(IP_HEADER)) |
| #define | MY_IP_TTL (100) |
Typedefs | |
| typedef _IP_ADDR | IP_ADDR |
| typedef _IP_HEADER | IP_HEADER |
| typedef _NODE_INFO | NODE_INFO |
Functions | |
| BOOL | IPGetHeader (IP_ADDR *localIP, NODE_INFO *remote, BYTE *protocol, WORD *len) |
| WORD | IPPutHeader (NODE_INFO *remote, BYTE protocol, WORD len) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Data is copied from IP data to given buffer
|
|
|
Check if ready for next transmission.
|
|
|
Data is copied to IP data area.
|
|
|
Sets the receive buffer access point to given offset in IP Data. For example, if IP data is a TCP packet, an offset of 0 will set access to first byte of TCP header. Layers that use IP services (TCP, UDP...) should call this macro to set the access pointer for the current buffer.
|
|
|
This function makes the given transmit buffer active, and sets it's access pointer to be:
|
|
|
|
|
|
Structure to store an IP address. For example, if IP address is "192.168.1.0", then: |
|
|
IP packet header definition |
|
|
Structure to store a nodes info |
|
||||||||||||||||||||
|
Only one IP message can be received. Caller may not transmit and receive a message at the same time.
|
|
||||||||||||||||
|
Write the Ethernet Header (MAC Header) and IP Header to the current TX buffer. The last parameter (len) is the length of the data to follow. This function will do the following:
|
1.4.5