70 |
netif->state = state; |
netif->state = state; |
71 |
netif->num = netifnum++; |
netif->num = netifnum++; |
72 |
netif->input = input; |
netif->input = input; |
|
ip_addr_set(&(netif->ip_addr), ipaddr); |
|
|
ip_addr_set(&(netif->netmask), netmask); |
|
|
ip_addr_set(&(netif->gw), gw); |
|
73 |
|
|
74 |
|
netif_set_addr(netif, ipaddr, netmask, gw); |
75 |
|
|
76 |
if (init(netif) != ERR_OK) { |
if (init(netif) != ERR_OK) { |
77 |
mem_free(netif); |
mem_free(netif); |
78 |
return NULL; |
return NULL; |
92 |
#endif /* NETIF_DEBUG */ |
#endif /* NETIF_DEBUG */ |
93 |
return netif; |
return netif; |
94 |
} |
} |
95 |
|
|
96 |
|
void |
97 |
|
netif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask, |
98 |
|
struct ip_addr *gw) |
99 |
|
{ |
100 |
|
netif_set_ipaddr(netif, ipaddr); |
101 |
|
netif_set_netmask(netif, netmask); |
102 |
|
netif_set_gw(netif, gw); |
103 |
|
} |
104 |
|
|
105 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
106 |
void netif_remove(struct netif * netif) |
void netif_remove(struct netif * netif) |
107 |
{ |
{ |