BlinkenArea - GitList
Repositories
Blog
Wiki
flaneth
Code
Commits
Branches
Tags
Search
Tree:
e8658d5
Branches
Tags
master
flaneth
firmware
ip.h
initial commit after making CF identify work
Stefan Schuermans
commited
e8658d5
at 2012-04-15 19:57:57
ip.h
Blame
History
Raw
/* flaneth - flash and ethernet version 0.2 date 2008-11-08 Copyright (C) 2007-2008 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