/[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.2.2 by likewise, Fri Apr 11 13:03:09 2003 UTC revision 1.15.2.3 by likewise, Fri Apr 11 14:01:10 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  {  {
180    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting IP address of interface %c%c%u to %u.%u.%u.%u\n",    ip_addr_set(&(netif->ip_addr), ipaddr);
181                         netif->name[0], netif->name[1], netif->num,    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: IP address of interface %c%c set to %u.%u.%u.%u\n",
182                           netif->name[0], netif->name[1],
183      (u8_t)(ntohl(netif->ip_addr.addr) >> 24 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 24 & 0xff),
184      (u8_t)(ntohl(netif->ip_addr.addr) >> 16 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 16 & 0xff),
185      (u8_t)(ntohl(netif->ip_addr.addr) >> 8 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 8 & 0xff),
# Line 188  netif_set_ipaddr(struct netif *netif, st Line 189  netif_set_ipaddr(struct netif *netif, st
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  {  {
   DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting GW address of interface %c%c%u to %u.%u.%u.%u\n",  
                        netif->name[0], netif->name[1], netif->num,  
                        (u8_t)(ntohl(gw->addr) >> 24 & 0xff),  
                        (u8_t)(ntohl(gw->addr) >> 16 & 0xff),  
                        (u8_t)(ntohl(gw->addr) >> 8 & 0xff),  
                        (u8_t)(ntohl(gw->addr) & 0xff)));  
192    ip_addr_set(&(netif->gw), gw);    ip_addr_set(&(netif->gw), gw);
193      DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: GW address of interface %c%c set to %u.%u.%u.%u\n",
194                           netif->name[0], netif->name[1],
195                           (u8_t)(ntohl(netif->gw.addr) >> 24 & 0xff),
196                           (u8_t)(ntohl(netif->gw.addr) >> 16 & 0xff),
197                           (u8_t)(ntohl(netif->gw.addr) >> 8 & 0xff),
198                           (u8_t)(ntohl(netif->gw.addr) & 0xff)));
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  {  {
   DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE, ("netif: setting netmask of interface %c%c%u to %u.%u.%u.%u\n",  
                        netif->name[0], netif->name[1], netif->num,  
                        (u8_t)(ntohl(netmask->addr) >> 24 & 0xff),  
                        (u8_t)(ntohl(netmask->addr) >> 16 & 0xff),  
                        (u8_t)(ntohl(netmask->addr) >> 8 & 0xff),  
                        (u8_t)(ntohl(netmask->addr) & 0xff)));  
204    ip_addr_set(&(netif->netmask), netmask);    ip_addr_set(&(netif->netmask), netmask);
205      DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: netmask of interface %c%c set to %u.%u.%u.%u\n",
206                           netif->name[0], netif->name[1],
207                           (u8_t)(ntohl(netif->netmask.addr) >> 24 & 0xff),
208                           (u8_t)(ntohl(netif->netmask.addr) >> 16 & 0xff),
209                           (u8_t)(ntohl(netif->netmask.addr) >> 8 & 0xff),
210                           (u8_t)(ntohl(netif->netmask.addr) & 0xff)));
211  }  }
212  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
213  void  void

Legend:
Removed from v.1.15.2.2  
changed lines
  Added in v.1.15.2.3

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