C
cerr
Hi,
How legal is it to have a function like:
int switch_wan_set_ipv6addr(uint32 routeID,char ipv6addr[L3ADDR_LEN]) {
int i;
if (routeID > MAX_ROUTE_ENTRIES) {
printf("RouteId %d is out of range! [0-%d]", routeID, MAX_ROUTE_ENTRIES);
return ERROR;
}
for (i=0; i<L3ADDR_LEN; i++)
route_entry[routeID].ipv6addr = ipv6addr;
return OK;
}
L3ADDR_LEN being 16 and route_entry.ipv6addr being of type unsigned char bcm_ip6_t[16]
I'd expect the function the be called like
switch_wan_set_ipv6addr(0,"0123456789012345");
is this legal and perfectrly fine? Assume that the caller can't pass pointers as arguments.
Thanks,
Ron
How legal is it to have a function like:
int switch_wan_set_ipv6addr(uint32 routeID,char ipv6addr[L3ADDR_LEN]) {
int i;
if (routeID > MAX_ROUTE_ENTRIES) {
printf("RouteId %d is out of range! [0-%d]", routeID, MAX_ROUTE_ENTRIES);
return ERROR;
}
for (i=0; i<L3ADDR_LEN; i++)
route_entry[routeID].ipv6addr = ipv6addr;
return OK;
}
L3ADDR_LEN being 16 and route_entry.ipv6addr being of type unsigned char bcm_ip6_t[16]
I'd expect the function the be called like
switch_wan_set_ipv6addr(0,"0123456789012345");
is this legal and perfectrly fine? Assume that the caller can't pass pointers as arguments.
Thanks,
Ron