/[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.8 by jani, Fri Mar 7 10:55:58 2003 UTC revision 1.9 by likewise, Thu Mar 13 08:50:04 2003 UTC
# Line 60  netif_add(struct ip_addr *ipaddr, struct Line 60  netif_add(struct ip_addr *ipaddr, struct
60  {  {
61    struct netif *netif;    struct netif *netif;
62    static int netifnum = 0;    static int netifnum = 0;
63      
64      /* allocate netif structure */  
65    netif = mem_malloc(sizeof(struct netif));    netif = mem_malloc(sizeof(struct netif));
66    
67    if(netif == NULL) {    if(netif == NULL) {
68        DEBUGF(NETIF_DEBUG, ("netif_add(): out of memory for netif\n"));
69      return NULL;      return NULL;
70    }    }
71        
72      /* remember netif specific state information data */
73    netif->state = state;    netif->state = state;
74    netif->num = netifnum++;    netif->num = netifnum++;
75    netif->input = input;    netif->input = input;
76    
77    netif_set_addr(netif, ipaddr, netmask, gw);    netif_set_addr(netif, ipaddr, netmask, gw);
78        
79      /* call user specified initialization function for netif */
80    if (init(netif) != ERR_OK) {    if (init(netif) != ERR_OK) {
81        mem_free(netif);        mem_free(netif);
82        return NULL;        return NULL;
83    }    }
84    
85      /* add this netif to the list */
86    netif->next = netif_list;    netif->next = netif_list;
87    netif_list = netif;    netif_list = netif;
88  #if NETIF_DEBUG  #if NETIF_DEBUG

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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