Cathy Zhou wrote:
> Peter Memishian wrote:
>> > It can work. But I think a more reasonable logic should be:
>> > > if (is_generic(prop_name)) {
>> > dladm_gen_set_prop();
>> > } else (is_wifi(prop_name)) {
>> > wladm_set_prop();
>> > } else ... {
>> > ...
>> > }
>>
>> The problem is that this requires libdladm to have global knowledge of
>> all properties, which we'd like to avoid.
>>
>
> If we want to have libdladm to do all the optional values check, default
> value assignment, etc. I would think the libdladm will have the knowledge.
>
I forgot to mention that I investigated another option that doesn't require
libdladm to have global knowledge of all properties. It is to make the
current do_set_prop() function to be a libdladm function which can be called
by different libraries. But in my opinion, the current signature of this
function is not correct:
do_set_prop(int fd, wldp_t *gbuf, prop_desc_t *pdp,
char **prop_val, uint_t val_cnt)
Which I would think should be
do_set_prop(prop_desc_t *pdp, char **prop_val, uint_t val_cnt)
But it seems the gbuf is deep into the libwladm's implementation which needs
significant change of the whole libwladm.
I am fine to work on it. But is there any better option?
Thanks
- Cathy