>> another option is to force the mapping of types that this interface >> provides to those in smf to be 1-1. the api consumer would then be >> required to do range checking specific to the property being handled, >> and cast to a more specific type if necessary. how feasible would >> that be? >> > I agree with this approach. > > uint16_t vlanid = 123; > dladm_set_conf_field(conf, "vlanid", (void*)&vlanid, DLADM_TYPE_INT); >
uint16_t vlanid = 123; dladm_set_conf_field(conf, "vlanid", (void*)(uintptr_t)vlanid, DLADM_TYPE_INT); I think the above usage would be better and less error-prone. Thanks - Cathy