Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Revision:
69:8c5f220441f5
Parent:
63:157ee3202edb
--- a/core/uip/NyLPC_uip.h	Thu May 22 12:59:50 2014 +0000
+++ b/core/uip/NyLPC_uip.h	Thu May 29 14:29:15 2014 +0000
@@ -256,12 +256,21 @@
 /**
  * IPヘッダの長さを返す。
  */
-#define NyLPC_TIPv4Header_getHeaderLength(i_iph) ((i_iph->vhl & 0x0f)*4)
+#define NyLPC_TIPv4Header_getHeaderLength(i_iph) (((i_iph)->vhl & 0x0f)*4)
 /**
  * IPパケット全体の長さを返す。
  */
 #define NyLPC_TIPv4Header_getPacketLength(i_iph) (NyLPC_ntohs((i_iph)->len16))
 
+/**
+ * IPヘッダを送信パケット用に設定する。
+ * ipid16にはコールされるたびに新しい値を設定する。
+ * ipcecksumには0を設定する。
+ * この関数は、パケットサイズ,ローカルIP/リモートIPの設定はしない。
+ */
+void NyLPC_TIPv4Header_writeTxIpHeader(
+    struct NyLPC_TIPv4Header* i_struct,
+    NyLPC_TUInt8 i_proto);
 /**********************************************************************
  *
  * struct NyLPC_TIPv6Header