diff options
| author | Dirk Ziegelmeier <[email protected]> | 2016-09-30 09:35:27 +0200 |
|---|---|---|
| committer | Dirk Ziegelmeier <[email protected]> | 2016-09-30 09:35:27 +0200 |
| commit | d7f8d33506dea115c33e5ef910e8bda26abaedb8 (patch) | |
| tree | beab5f32db179bcb7cd051ffde1053dbd8581be2 /doc/NO_SYS_SampleCode.c | |
| parent | db9c866fff188f781a8e3a8ac57ca28defcc7fca (diff) | |
Minor: update NO_SYS_SampleCode.c for IPv6
Diffstat (limited to 'doc/NO_SYS_SampleCode.c')
| -rw-r--r-- | doc/NO_SYS_SampleCode.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/doc/NO_SYS_SampleCode.c b/doc/NO_SYS_SampleCode.c index f20106f5..f5c6c10b 100644 --- a/doc/NO_SYS_SampleCode.c +++ b/doc/NO_SYS_SampleCode.c @@ -46,12 +46,10 @@ static void netif_status_callback(struct netif *netif) static err_t netif_init(struct netif *netif) { netif->linkoutput = netif_output; - netif->output = etharp_output; - netif->name[0] = 'e'; - netif->name[1] = '0'; - netif->mtu = ETHERNET_MTU; - - netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP; + netif->output = etharp_output; + netif->output_ip6 = ethip6_output; + netif->mtu = ETHERNET_MTU; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP | NETIF_FLAG_MLD6; MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, 100000000); SMEMCPY(netif->hwaddr, your_mac_address_goes_here, sizeof(netif->hwaddr)); @@ -66,7 +64,11 @@ void main(void) lwip_init(); - netif_add(&netif, IPADDR_ANY, IPADDR_ANY, IPADDR_ANY, NULL, netif_init, netif_input); + netif_add(&netif, IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY, NULL, netif_init, netif_input); + netif.name[0] = 'e'; + netif.name[1] = '0'; + netif_create_ip6_linklocal_address(&netif, 1); + netif.ip6_autoconfig_enabled = 1; netif_set_status_callback(&netif, netif_status_callback); netif_set_default(&netif); netif_set_up(&netif); |
