BlinkenArea - GitList
Repositories
Blog
Wiki
flaneth
Code
Commits
Branches
Tags
Search
Tree:
2342395
Branches
Tags
master
flaneth
firmware
ip.h
change email address in header to blinkenarea address
Stefan Schuermans
commited
2342395
at 2012-05-22 19:18:57
ip.h
Blame
History
Raw
/* flaneth - flash and ethernet Copyright (C) 2007-2012 Stefan Schuermans <stefan@blinkenarea.org> 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