Cathy Zhou wrote: >>> 4. The signature of get/set_conf_field should be: >>> >>> dladm_status_t dladm_get_conf_field(dladm_conf_t conf, const char* >>> field, >>> void *value, size_t *vallenp); >>> >>> dladm_status_t dladm_set_conf_field(dladm_conf_t conf, const char >>> *field, >>> void char *value, size_t vallen); >>> >> >> 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)) >
Based on the rest of the thread, I've changed the document so that the set_conf_field functions take a datatype argument. I don't see a need for a data type for the get_conf_field function. The user can provide a buffer, and the API can check the length of the buffer based on the data type (which the API would know). If the buffer isn't big enough, then it would return an error. >>> 8. I would think dladm_walk_conf() will only be called in devfsadmd, >>> so it should be made private (not in this document). >>> >> >> Right now only devfsadmd uses dladm_walk_conf, but could someone in >> the future want to use it? I'd prefer to leave it as is. >> > Other applications need to walk the links will just call > dladm_walk_linkids(), and use dladm_read_conf() to get the configuration > of each link. To have two walk functions will only make the API confusing. > OK. It's been removed. >>> 9. Note the altroot argument in below functions: >>> >>> dladm_status_t dladm_write_conf(dladm_conf_t conf, const char *altroot); >>> dladm_status_t dladm_remove_conf(dladm_linkid_t linkid, >>> const char *altroot); >>> >> >> Meem mentioned dladm_set_rootdir, which I think I would be better than >> having extra arguments. >> > Ok. Then please include dladm_set_rootdir() in the document. > I added a statement mentioning that all of the persistent configuration API calls affect the normal configuration files. If the user needs to change configurations in another area (say for a Jumpstart server) then the user should call dladm_set_rootdir first. > Thanks > - Cathy > > _________________________________ > clearview-discuss mailing list > clearview-discuss at opensolaris.org
