EthernetNetIf Compatibility.

Dependents:   XBeeWiFi_SPI_example

Fork of NetServicesSource by Donatien Garnier

Revision:
5:dd63a1e02b1b
Parent:
0:632c9925f013
Child:
8:93fa3cfc0219
--- a/if/net/ipaddr.h	Fri Jul 09 14:46:47 2010 +0000
+++ b/if/net/ipaddr.h	Tue Jul 27 15:59:42 2010 +0000
@@ -29,7 +29,12 @@
 #include "netCfg.h"
 #if NET_LWIP_STACK
 #include "lwip/ip_addr.h"
+
+#ifdef __LWIP_DEBUG
+#undef __LWIP_DEBUG
 #endif
+#endif
+
 class IpAddr;
 
 class IpAddr //Basically a C++ frontend to ip_addr_t
@@ -59,6 +64,7 @@
     m_ip[3] = 0;
   }
   
+
   #if NET_LWIP_STACK
   ip_addr_t getStruct() const
   {
@@ -96,6 +102,16 @@
     return (*((uint32_t*)m_ip) == 0);
   }
   
+  bool isBroadcast() const
+  {
+    return (*((uint32_t*)m_ip) == 0xFFFFFFFF);
+  }
+  
+  bool isMulticast() const
+  {
+    return ((m_ip[0] & 0xF0) == 0xE0);
+  }
+  
 private:
   uint8_t m_ip[4];
 };