As I understand it, I can declare all my IP objects as IPADDR whether they are for IPv4 or IPv6.
The structure InterfaceBlock declares all the IP objects as IPADDR4. Which I think is causing the following compiler error for code below.
"error: no match for 'operator=' (operand types are 'IPADDR4 and 'IPADDR' {aka IPADDR6})
Code: Select all
void ChangeRuntimeIPSettings( InterfaceBlock *ib_, IPADDR IpAddr, IPADDR IpMask, IPADDR IpGate, IPADDR IpDNS )
{
#ifdef foo
iprintf("Old Settings:\r\n");
iprintf(" IP: "); ShowIP(ib->netIP); iprintf("\r\n");
iprintf(" Mask: "); ShowIP(ib->netIpMask); iprintf("\r\n");
iprintf(" Gway: "); ShowIP(ib->netIpGate); iprintf("\r\n");
iprintf(" DNS: "); ShowIP(ib->netDNS); iprintf("\r\n");
iprintf("-------------------------------\r\n");
#endif
ib_->netIP = IpAddr;
ib_->netIpMask = IpMask;
ib_->netIpGate = IpGate;
ib_->netDNS = IpDNS;
#ifdef foo
iprintf("New Settings:\r\n");
iprintf(" IP: "); ShowIP(ib->netIP); iprintf("\r\n");
iprintf(" Mask: "); ShowIP(ib->netIpMask); iprintf("\r\n");
iprintf(" Gway: "); ShowIP(ib->netIpGate); iprintf("\r\n");
iprintf(" DNS: "); ShowIP(ib->netDNS); iprintf("\r\n");
iprintf("-------------------------------\r\n");
#endif
}