Peter Memishian wrote:
>  > > I can go either way on this.  I remember meem made the comment that we 
>  > > should pass strings.  I don't have a strong feeling any more for either 
>  > > way of doing things.
>  > > 
>  > I am not sure what concern Meem has. But I think that make it as void * 
> will 
>  > make the programming easier. For example, to set and get a VLAN ID field:
>  > 
>  > dladm_set_conf_field(conf, FVLANID, &vid, sizeof (uint16_t);
>  > dladm_get_conf_field(conf, FVLANID, &vid, sizeof (uint16_t))
> 
> As I recall, my thought was that we would store the data in ASCII anyway,
> so having the API allow arbitrarily-typed data seemed messy.  Further, in
> the above calsl, I'm not sure how the routines would know to treat vid as
> a 16-bit unsigned integer unless it knows the type of FVLANID.  But then
> why pass the size?
> 
So your comments are strictly related to the format in the configuration 
file? If so, I understand. But if we have to convert each fields into 
strings before we write it, and convert the string back to the fields from 
the string, that would cause inconvenience to the caller.

Can we just add another argument to the API to indicate the type of the 
field, similar to the "KSTAT_DATA_ULONG, KSTAT_DATA_CHAR ..." in the kstat 
interfaces.

- Cathy





Reply via email to