/[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.24 by likewise, Mon Jun 9 21:08:55 2003 UTC revision 1.25 by likewise, Mon Jun 9 21:14:47 2003 UTC
# Line 112  netif_add(struct ip_addr *ipaddr, struct Line 112  netif_add(struct ip_addr *ipaddr, struct
112    
113  void  void
114  netif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask,  netif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask,
115            struct ip_addr *gw)      struct ip_addr *gw)
116  {  {
117    netif_set_ipaddr(netif, ipaddr);    netif_set_ipaddr(netif, ipaddr);
118    netif_set_netmask(netif, netmask);    netif_set_netmask(netif, netmask);
# Line 131  void netif_remove(struct netif * netif) Line 131  void netif_remove(struct netif * netif)
131      /*  look for netif further down the list */      /*  look for netif further down the list */
132      struct netif * tmpNetif;      struct netif * tmpNetif;
133      for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {      for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {
134                          if (tmpNetif->next == netif) {        if (tmpNetif->next == netif) {
135                                  tmpNetif->next = netif->next;          tmpNetif->next = netif->next;
136          break;          break;
137          }          }
138                  }      }
139                  if (tmpNetif == NULL)      if (tmpNetif == NULL)
140                          return; /*  we didn't find any netif today */        return; /*  we didn't find any netif today */
141    }    }
142    /* this netif is default? */    /* this netif is default? */
143    if (netif_default == netif)    if (netif_default == netif)
# Line 211  netif_set_ipaddr(struct netif *netif, st Line 211  netif_set_ipaddr(struct netif *netif, st
211  #endif  #endif
212    ip_addr_set(&(netif->ip_addr), ipaddr);    ip_addr_set(&(netif->ip_addr), ipaddr);
213    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: IP address of interface %c%c set to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: IP address of interface %c%c set to %u.%u.%u.%u\n",
214                         netif->name[0], netif->name[1],             netif->name[0], netif->name[1],
215      (u8_t)(ntohl(netif->ip_addr.addr) >> 24 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 24 & 0xff),
216      (u8_t)(ntohl(netif->ip_addr.addr) >> 16 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 16 & 0xff),
217      (u8_t)(ntohl(netif->ip_addr.addr) >> 8 & 0xff),      (u8_t)(ntohl(netif->ip_addr.addr) >> 8 & 0xff),
# Line 223  netif_set_gw(struct netif *netif, struct Line 223  netif_set_gw(struct netif *netif, struct
223  {  {
224    ip_addr_set(&(netif->gw), gw);    ip_addr_set(&(netif->gw), gw);
225    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: GW address of interface %c%c set to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: GW address of interface %c%c set to %u.%u.%u.%u\n",
226                         netif->name[0], netif->name[1],             netif->name[0], netif->name[1],
227                         (u8_t)(ntohl(netif->gw.addr) >> 24 & 0xff),             (u8_t)(ntohl(netif->gw.addr) >> 24 & 0xff),
228                         (u8_t)(ntohl(netif->gw.addr) >> 16 & 0xff),             (u8_t)(ntohl(netif->gw.addr) >> 16 & 0xff),
229                         (u8_t)(ntohl(netif->gw.addr) >> 8 & 0xff),             (u8_t)(ntohl(netif->gw.addr) >> 8 & 0xff),
230                         (u8_t)(ntohl(netif->gw.addr) & 0xff)));             (u8_t)(ntohl(netif->gw.addr) & 0xff)));
231  }  }
232  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
233  void  void
# Line 235  netif_set_netmask(struct netif *netif, s Line 235  netif_set_netmask(struct netif *netif, s
235  {  {
236    ip_addr_set(&(netif->netmask), netmask);    ip_addr_set(&(netif->netmask), netmask);
237    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: netmask of interface %c%c set to %u.%u.%u.%u\n",    DEBUGF(NETIF_DEBUG | DBG_TRACE | DBG_STATE | 3, ("netif: netmask of interface %c%c set to %u.%u.%u.%u\n",
238                         netif->name[0], netif->name[1],             netif->name[0], netif->name[1],
239                         (u8_t)(ntohl(netif->netmask.addr) >> 24 & 0xff),             (u8_t)(ntohl(netif->netmask.addr) >> 24 & 0xff),
240                         (u8_t)(ntohl(netif->netmask.addr) >> 16 & 0xff),             (u8_t)(ntohl(netif->netmask.addr) >> 16 & 0xff),
241                         (u8_t)(ntohl(netif->netmask.addr) >> 8 & 0xff),             (u8_t)(ntohl(netif->netmask.addr) >> 8 & 0xff),
242                         (u8_t)(ntohl(netif->netmask.addr) & 0xff)));             (u8_t)(ntohl(netif->netmask.addr) & 0xff)));
243  }  }
244  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
245  void  void
# Line 247  netif_set_default(struct netif *netif) Line 247  netif_set_default(struct netif *netif)
247  {  {
248    netif_default = netif;    netif_default = netif;
249    DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n",    DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n",
250                         netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\''));             netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\''));
251  }  }
252  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
253  void  void

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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