Cathy Zhou wrote:
> 
>>> 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
> 
>

OK, so it sounds like I need to:

- Represent links in SMF as property groups under 
network/linkmgmtd:default, and the property group's name is derived from 
the linkid
- Make a 1-1 mapping between DLADM_TYPE_*'s and SMF types, and then the 
API will convert data to and from strings based on that
- Modify the existing code that calls into the API to handle the fact 
that the caller might need to convert data to use 64 bit integers.

Any other thoughts?

Dan

Reply via email to