URL
https://opencores.org/ocsvn/mlite/mlite/trunk
[/] [mlite/] [trunk/] [kernel/] [tcpip.c] - Diff between revs 231 and 247
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 231 |
Rev 247 |
Line 879... |
Line 879... |
OS_Job(socket->funcPtr, socket, 0, 0);
|
OS_Job(socket->funcPtr, socket, 0, 0);
|
return rc;
|
return rc;
|
}
|
}
|
|
|
|
|
int IPProcessEthernetPacket(IPFrame *frameIn)
|
int IPProcessEthernetPacket(IPFrame *frameIn, int length)
|
{
|
{
|
int ip_length, rc;
|
int ip_length, rc;
|
IPSocket *socket;
|
IPSocket *socket;
|
IPFrame *frameOut;
|
IPFrame *frameOut;
|
uint8 *packet, *packetOut;
|
uint8 *packet, *packetOut;
|
|
|
packet = frameIn->packet;
|
packet = frameIn->packet;
|
|
frameIn->length = (uint16)length;
|
|
|
if(packet[ETHERNET_FRAME_TYPE] != 0x08 || frameIn->length > PACKET_SIZE)
|
if(packet[ETHERNET_FRAME_TYPE] != 0x08 || frameIn->length > PACKET_SIZE)
|
return 0; //wrong ethernet type, packet not used
|
return 0; //wrong ethernet type, packet not used
|
|
|
//ARP?
|
//ARP?
|
Line 1050... |
Line 1051... |
frame = (IPFrame*)message[1];
|
frame = (IPFrame*)message[1];
|
if(message[0] == 0) //frame received
|
if(message[0] == 0) //frame received
|
{
|
{
|
Led(1);
|
Led(1);
|
frame->length = (uint16)message[2];
|
frame->length = (uint16)message[2];
|
rc = IPProcessEthernetPacket(frame);
|
rc = IPProcessEthernetPacket(frame, frame->length);
|
if(rc == 0)
|
if(rc == 0)
|
FrameFree(frame);
|
FrameFree(frame);
|
}
|
}
|
else if(message[0] == 1) //frame sent
|
else if(message[0] == 1) //frame sent
|
{
|
{
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.