lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] netif setup for IPv6 traffic (static /128 address assig


From: josephjah
Subject: Re: [lwip-users] netif setup for IPv6 traffic (static /128 address assignment)
Date: Wed, 25 Jul 2018 12:32:03 -0700 (MST)

Thanks for responding. I've tried using netif_ip6_addr_set() per your
suggestion but while it sets the address correctly for the netif, it doesn't
seem to take me any closer to an operational state. I'm just not sure where
to find a good example to follow. Can you clarify "mixing responsibilities"?
Here's a snippet which might be closer to standard usage (but still exhibits
the same problem).

Am I doing something out of order? or does lwIP not support assigning a
static ipv6 address of this form?

Thanks.

static err_t netif_init(struct netif *netif)
{
        netif->hwaddr_len = 6;
        netif->name[0]    = 'l';
        netif->name[1]    = '0'+lwipInterfacesCount;
        netif->linkoutput = lwip_eth_tx;
        netif->output     = etharp_output;
        netif->output_ip6 = ethip6_output;
        netif->mtu        = MY_MTU;
        netif->flags      = NETIF_FLAG_BROADCAST 
                | NETIF_FLAG_ETHARP 
                | NETIF_FLAG_ETHERNET 
                | NETIF_FLAG_IGMP 
                | NETIF_FLAG_MLD6 
                | NETIF_FLAG_LINK_UP 
                | NETIF_FLAG_UP;
        _mac.copyTo(netif->hwaddr, netif->hwaddr_len);
        netif->hwaddr_len = sizeof(netif->hwaddr);
        return ERR_OK;
}

void setup(...) {
        static ip6_addr_t ipaddr;
        memcpy(&(ipaddr.addr), ip.rawIpData(), sizeof(ipaddr.addr));
        netif_add(&netif, NULL, NULL, NULL, NULL, netif_init, ethernet_input);  
        netif.state = this;
        s8_t idx = 1;
        netif_ip6_addr_set(&netif, 1, &ipaddr);
        netif_set_status_callback(&netif, netif_status_callback);
        netif_set_default(&netif);
        netif_set_up(&netif);
        netif_set_link_up(&netif);
}



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]