Files at this revision

API Documentation at this revision

Comitter:
mbed714
Date:
Tue Nov 09 19:24:39 2010 +0000
Parent:
1:8b2984d608a3
Child:
3:0c324737064d
Commit message:

Changed in this revision

if/eth/EthernetNetIf.cpp Show annotated file Show diff for this revision Revisions of this file
if/eth/EthernetNetIf.h Show annotated file Show diff for this revision Revisions of this file
lwip/lwipopts.h Show annotated file Show diff for this revision Revisions of this file
--- a/if/eth/EthernetNetIf.cpp	Tue Oct 12 18:20:40 2010 +0000
+++ b/if/eth/EthernetNetIf.cpp	Tue Nov 09 19:24:39 2010 +0000
@@ -37,10 +37,10 @@
 #include "netCfg.h"
 #if NET_ETH
 
-EthernetNetIf::EthernetNetIf() : LwipNetIf(), m_ethArpTimer(), m_dhcpCoarseTimer(), m_dhcpFineTimer(), m_igmpTimer(), m_pNetIf(NULL),
-m_netmask(255,255,255,255), m_gateway(), m_hostname(NULL)
+EthernetNetIf::EthernetNetIf(const char* hostname) : LwipNetIf(), m_ethArpTimer(), m_dhcpCoarseTimer(), m_dhcpFineTimer(), m_igmpTimer(), m_pNetIf(NULL),
+m_netmask(255,255,255,255), m_gateway(), m_hostname(hostname)
 {
-  m_hostname = NULL;
+  //m_hostname = NULL;
   m_pNetIf = new netif;
   m_useDhcp = true;
 }
@@ -88,7 +88,7 @@
   m_pNetIf->hwaddr[3], m_pNetIf->hwaddr[4], m_pNetIf->hwaddr[5]);
 
   m_pNetIf = netif_add(m_pNetIf, &(m_ip.getStruct()), &(m_netmask.getStruct()), &(m_gateway.getStruct()), NULL, eth_init, ip_input);//ethernet_input);// ip_input);
-  //m_pNetIf->hostname = "mbedDG";//(char *)m_hostname; //Not used for now
+  m_pNetIf->hostname = (char *)m_hostname;
   netif_set_default(m_pNetIf);
   
   //DBG("\r\nStarting DHCP.\r\n");
--- a/if/eth/EthernetNetIf.h	Tue Oct 12 18:20:40 2010 +0000
+++ b/if/eth/EthernetNetIf.h	Tue Nov 09 19:24:39 2010 +0000
@@ -50,7 +50,7 @@
 {
 public:
   ///Instantiates the Interface and register it against the stack, DHCP will be used
-  EthernetNetIf(); //W/ DHCP
+  EthernetNetIf(const char* hostname = NULL); //W/ DHCP
 
   ///Instantiates the Interface and register it against the stack, DHCP will not be used
   /**
--- a/lwip/lwipopts.h	Tue Oct 12 18:20:40 2010 +0000
+++ b/lwip/lwipopts.h	Tue Nov 09 19:24:39 2010 +0000
@@ -333,6 +333,7 @@
 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
    interfaces. */
 #define LWIP_DHCP               (NET_ETH | NET_ZG2100)
+#define LWIP_NETIF_HOSTNAME     1
 
 /* 1 if you want to do an ARP check on the offered address
    (recommended if using DHCP). */