/[lwip]/lwip/src/core/netif.c
ViewVC logotype

Diff of /lwip/src/core/netif.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by likewise, Tue Apr 1 15:00:26 2003 UTC revision 1.16 by likewise, Thu Apr 3 12:09:39 2003 UTC
# Line 177  netif_find(char *name) Line 177  netif_find(char *name)
177  void  void
178  netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr)  netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr)
179  {  {
   ip_addr_set(&(netif->ip_addr), ipaddr);  
180    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting IP address of interface %c%c%u to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting IP address of interface %c%c%u to %u.%u.%u.%u\n",
181                         netif->name[0], netif->name[1], netif->num,                         netif->name[0], netif->name[1], netif->num,
182                         (u8_t)(ntohl(ipaddr->addr) >> 24 & 0xff),                         (u8_t)(ntohl(ipaddr->addr) >> 24 & 0xff),
183                         (u8_t)(ntohl(ipaddr->addr) >> 16 & 0xff),                         (u8_t)(ntohl(ipaddr->addr) >> 16 & 0xff),
184                         (u8_t)(ntohl(ipaddr->addr) >> 8 & 0xff),                         (u8_t)(ntohl(ipaddr->addr) >> 8 & 0xff),
185                         (u8_t)(ntohl(ipaddr->addr) & 0xff)));                         (u8_t)(ntohl(ipaddr->addr) & 0xff)));
186      ip_addr_set(&(netif->ip_addr), ipaddr);
187  }  }
188  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
189  void  void
190  netif_set_gw(struct netif *netif, struct ip_addr *gw)  netif_set_gw(struct netif *netif, struct ip_addr *gw)
191  {  {
   ip_addr_set(&(netif->gw), gw);  
192    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting GW address of interface %c%c%u to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting GW address of interface %c%c%u to %u.%u.%u.%u\n",
193                         netif->name[0], netif->name[1], netif->num,                         netif->name[0], netif->name[1], netif->num,
194                         (u8_t)(ntohl(gw->addr) >> 24 & 0xff),                         (u8_t)(ntohl(gw->addr) >> 24 & 0xff),
195                         (u8_t)(ntohl(gw->addr) >> 16 & 0xff),                         (u8_t)(ntohl(gw->addr) >> 16 & 0xff),
196                         (u8_t)(ntohl(gw->addr) >> 8 & 0xff),                         (u8_t)(ntohl(gw->addr) >> 8 & 0xff),
197                         (u8_t)(ntohl(gw->addr) & 0xff)));                         (u8_t)(ntohl(gw->addr) & 0xff)));
198      ip_addr_set(&(netif->gw), gw);
199  }  }
200  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
201  void  void
202  netif_set_netmask(struct netif *netif, struct ip_addr *netmask)  netif_set_netmask(struct netif *netif, struct ip_addr *netmask)
203  {  {
   ip_addr_set(&(netif->netmask), netmask);  
204    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting netmask of interface %c%c%u to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting netmask of interface %c%c%u to %u.%u.%u.%u\n",
205                         netif->name[0], netif->name[1], netif->num,                         netif->name[0], netif->name[1], netif->num,
206                         (u8_t)(ntohl(netmask->addr) >> 24 & 0xff),                         (u8_t)(ntohl(netmask->addr) >> 24 & 0xff),
207                         (u8_t)(ntohl(netmask->addr) >> 16 & 0xff),                         (u8_t)(ntohl(netmask->addr) >> 16 & 0xff),
208                         (u8_t)(ntohl(netmask->addr) >> 8 & 0xff),                         (u8_t)(ntohl(netmask->addr) >> 8 & 0xff),
209                         (u8_t)(ntohl(netmask->addr) & 0xff)));                         (u8_t)(ntohl(netmask->addr) & 0xff)));
210      ip_addr_set(&(netif->netmask), netmask);
211  }  }
212  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
213  void  void

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26