BlinkenArea - GitList
Repositories
Blog
Wiki
flaneth
Code
Commits
Branches
Tags
Search
Tree:
d48e86e
Branches
Tags
master
flaneth
firmware
ip.h
header fix
Stefan Schuermans
commited
d48e86e
at 2012-05-02 18:39:39
ip.h
Blame
History
Raw
/* flaneth - flash and ethernet Copyright (C) 2007-2012 Stefan Schuermans <stefan@schuermans.info> Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html a BlinkenArea project - http://www.blinkenarea.org/ */ #ifndef INC_ip #define INC_ip #include "ethernet.h" // header of an IP packet struct IpHeader { unsigned char Ver_HdrLen; unsigned char Tos; unsigned int TotalLen; unsigned int Id; unsigned int FragOfs; unsigned char Ttl; unsigned char Proto; unsigned int HdrChk; unsigned char Src[4]; unsigned char Dest[4]; }; // an IP packet struct IpPacket { struct EthernetHeader EthHdr; struct IpHeader IpHdr; }; // tick procedure - call every 200ms extern void IpTick200(void); // process a received IP packet extern void IpRecv(unsigned char *pData, unsigned short Length); // send an IP packet // pData must point to a struct IpPacket with IpHdr.Proto and IpHdr.Dest // already initialized extern void IpSend(unsigned char *pData, unsigned short Length); // a MAC address was discovered // called by ARP to notify IP extern void IpGotMac(unsigned char Ip[4], unsigned char Mac[6]); #endif // #ifdef INC_ip