Mikroc – ABL electronic PIC Microcontrollers PIC16 User Manual
Page 185
MikroElektronika: Development tools - Books - Compilers
177
page
mikroC - C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
Prototype
void
Eth_Load_Ip_Packet(void);
Description
Loads various IP packet data into PIC’s Ethernet variables.
Requires
The card (NIC) must be properly initialized. See
Eth_Init
. Also, a proper sequence of
calls must be obeyed (see the
Ip_Event
function in the supplied Ethernet example).
Example
Eth_Load_Ip_Packet();
Eth_Load_Ip_Packet
Prototype
unsigned short
Eth_Get_Ip_Hdr_Len(void);
Returns
Header length of the received IP packet.
Description
Returns header length of the received IP packet. Before other data based upon the IP
protocol (TCP, UDP, ICMP) can be analyzed, the sub-protocol data must be properly
loaded from the received IP packet.
Requires
The card (NIC) must be properly initialized. See
Eth_Init
. The function must be
called in a proper sequence, i.e. immediately after determining that the packet received
is the IP packet.
Example
// Receive IP Header
opt_len = Eth_Get_Ip_Hdr_Len() - 20;
Eth_Get_Ip_Hdr_Len