For a question in forum this is a working example, there will be the example that is not working
Fork of eth_v13 by
Diff: ipaddr.h
- Revision:
- 0:f7caac9b804e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipaddr.h Tue Mar 18 17:00:22 2014 +0000 @@ -0,0 +1,26 @@ +#ifndef IPADDR_H +#define IPADDR_H +#include <stdint.h> + +class IpAddr +{ + public: + IpAddr(); + IpAddr(uint8_t ip0, uint8_t ip1, uint8_t ip2, uint8_t ip3); + + bool isNull(); + bool isEqual(IpAddr *addr2); + int getIpPart(uint8_t i); + + bool isSameSubnet(IpAddr * addr2, IpAddr * netmask); + + bool operator==(IpAddr * rhs); + bool operator==(IpAddr &rhs); + + void getIP(uint8_t *ip); + + private: + uint8_t m_ip[4]; +}; + +#endif