For a question in forum this is a working example, there will be the example that is not working

Dependencies:   mbed

Fork of eth_v13 by Heiko Greiner

ipaddr.h

Committer:
hggerdd
Date:
2014-03-27
Revision:
4:a10e3d1bdb17
Parent:
0:f7caac9b804e

File content as of revision 4:a10e3d1bdb17:

#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