Make use of the UIP_TCPIP_HLEN define where it applies.
diff --git a/contiki/ppp/ppp.c b/contiki/ppp/ppp.c
index 61001fd..ba993a3 100644
--- a/contiki/ppp/ppp.c
+++ b/contiki/ppp/ppp.c
@@ -43,7 +43,7 @@
*
* This file is part of the Mycal Modified uIP TCP/IP stack.
*
- * $Id: ppp.c,v 1.4 2005/01/26 23:36:22 oliverschmidt Exp $
+ * $Id: ppp.c,v 1.5 2005/02/23 22:38:43 oliverschmidt Exp $
*
*/
@@ -288,7 +288,8 @@
{
/* If IPCP came up then our link should be up. */
if((ipcp_state & IPCP_TX_UP) && (ipcp_state & IPCP_RX_UP)) {
- ahdlc_tx(IPV4, uip_buf, uip_appdata, 40, uip_len - 40);
+ ahdlc_tx(IPV4, uip_buf, uip_appdata,
+ UIP_TCPIP_HLEN, uip_len - UIP_TCPIP_HLEN);
}
}
/*---------------------------------------------------------------------------*/
diff --git a/contiki/uip/uip-fw.c b/contiki/uip/uip-fw.c
index 0e6756c..3ba8baa 100644
--- a/contiki/uip/uip-fw.c
+++ b/contiki/uip/uip-fw.c
@@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
- * $Id: uip-fw.c,v 1.8 2004/09/12 20:24:56 adamdunkels Exp $
+ * $Id: uip-fw.c,v 1.9 2005/02/23 22:40:40 oliverschmidt Exp $
*/
/**
* \addtogroup uip
@@ -469,7 +469,7 @@
/* If we now have found a suitable network interface, we call its
output function to send out the packet. */
if(netif != NULL && uip_len > 0) {
- uip_appdata = &uip_buf[UIP_LLH_LEN + 40];
+ uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN];
fwcache_register();
netif->output();
}
diff --git a/contiki/uip/uip.h b/contiki/uip/uip.h
index 8316f9b..f214e62 100644
--- a/contiki/uip/uip.h
+++ b/contiki/uip/uip.h
@@ -45,7 +45,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
- * $Id: uip.h,v 1.15 2005/02/22 22:32:40 adamdunkels Exp $
+ * $Id: uip.h,v 1.16 2005/02/23 22:40:40 oliverschmidt Exp $
*
*/
@@ -353,11 +353,11 @@
devicedriver_send(void)
{
hwsend(&uip_buf[0], UIP_LLH_LEN);
- if(uip_len <= UIP_LLH_LEN + 40) {
+ if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) {
hwsend(&uip_buf[UIP_LLH_LEN], uip_len - UIP_LLH_LEN);
} else {
- hwsend(&uip_buf[UIP_LLH_LEN], 40);
- hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
+ hwsend(&uip_buf[UIP_LLH_LEN], UIP_TCPIP_HLEN);
+ hwsend(uip_appdata, uip_len - UIP_TCPIP_HLEN - UIP_LLH_LEN);
}
}
\endcode
diff --git a/contiki/uip/uip_arp.c b/contiki/uip/uip_arp.c
index 7c25ab5..40f6e23 100644
--- a/contiki/uip/uip_arp.c
+++ b/contiki/uip/uip_arp.c
@@ -54,7 +54,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
- * $Id: uip_arp.c,v 1.14 2004/09/18 20:18:40 adamdunkels Exp $
+ * $Id: uip_arp.c,v 1.15 2005/02/23 22:40:40 oliverschmidt Exp $
*
*/
@@ -406,7 +406,7 @@
BUF->protolen = 4;
BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
- uip_appdata = &uip_buf[40 + UIP_LLH_LEN];
+ uip_appdata = &uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN];
uip_len = sizeof(struct arp_hdr);
return;
diff --git a/contiki/uip/uipopt.h b/contiki/uip/uipopt.h
index 81cd447..902c7cb 100644
--- a/contiki/uip/uipopt.h
+++ b/contiki/uip/uipopt.h
@@ -53,7 +53,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
- * $Id: uipopt.h,v 1.14 2004/09/18 20:18:59 adamdunkels Exp $
+ * $Id: uipopt.h,v 1.15 2005/02/23 22:40:40 oliverschmidt Exp $
*
*/
@@ -353,9 +353,10 @@
/**
* The TCP maximum segment size.
*
- * This is should not be to set to more than UIP_BUFSIZE - UIP_LLH_LEN - 40.
+ * This is should not be to set to more than
+ * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
*/
-#define UIP_TCP_MSS (UIP_BUFSIZE - (UIP_LLH_LEN) - 40)
+#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
/**
* How long a connection should stay in the TIME_WAIT state.