Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Revision:
37:fc4b4fd6a649
Parent:
11:c82a7b2899b0
Child:
41:2389bd6b6f74
--- a/core/uip/NyLPC_uip.h	Thu May 16 16:06:46 2013 +0000
+++ b/core/uip/NyLPC_uip.h	Wed Jun 19 09:33:01 2013 +0000
@@ -93,6 +93,9 @@
 extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_ZERO;
 extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_ALL;
 extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_BROADCAST;
+extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_MULTICAST;
+extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_MULTICAST_MASK;
+extern const struct NyLPC_TIPv4Addr NyLPC_TIPv4Addr_APIPA_MASK;
 
 /**
  * addr1とaddr2が全く同じであるかをテストします。
@@ -113,8 +116,8 @@
  NyLPC_TIpv4Addr_set(&ip,1,2,3,4);
  \endcode
  */
-#define NyLPC_TIPv4Addr_set(s,a0,a1,a2,a3) (s)->v=NyLPC_htonl((0xff000000&(a0<<24))|(0x00ff0000&(a1<<16))|(0x0000ff00&(a2<<8))|(0x000000ff&(a3)))
-#define NyLPC_TIPv4Addr_pack(a0,a1,a2,a3) {NyLPC_HTONL((0xff000000&(a0<<24))|(0x00ff0000&(a1<<16))|(0x0000ff00&(a2<<8))|(0x000000ff&(a3)))}
+#define NyLPC_TIPv4Addr_set(s,a0,a1,a2,a3) (s)->v=NyLPC_htonl((0xff000000&(((NyLPC_TUInt32)(a0))<<24))|(0x00ff0000&(((NyLPC_TUInt32)(a1))<<16))|(0x0000ff00&(((NyLPC_TUInt32)(a2))<<8))|(0x000000ff&((NyLPC_TUInt32)(a3))))
+#define NyLPC_TIPv4Addr_pack(a0,a1,a2,a3) {NyLPC_HTONL((0xff000000&(((NyLPC_TUInt32)(a0))<<24))|(0x00ff0000&(((NyLPC_TUInt32)(a1))<<16))|(0x0000ff00&(((NyLPC_TUInt32)(a2))<<8))|(0x000000ff&((NyLPC_TUInt32)(a3))))}
 
 
 
@@ -380,6 +383,11 @@
     NyLPC_TUInt16 udpchksum;
 } PACK_STRUCT_END;
 
+/**
+ * UDPヘッダの長さを返す。
+ */
+#define NyLPC_TUdpHeader_getHeaderLength(i_struct) (8)
+
 /**********************************************************************
  *
  * struct NyLPC_TIcmpipHeader