Lines Matching refs:libp
141 plugin_lib_t *libp;
185 cfga_err_t (*resolve_lib)(plugin_lib_t *libp);
241 static cfga_err_t null_resolve(plugin_lib_t *libp);
242 static cfga_err_t resolve_v1(plugin_lib_t *libp);
243 static cfga_err_t resolve_v2(plugin_lib_t *libp);
249 plugin_lib_t *libp, lib_loc_t *liblocp);
251 plugin_lib_t *libp, lib_loc_t *liblocp);
253 plugin_lib_t *libp, lib_loc_t *liblocp);
385 plugin_lib_t *libp;
415 libloc.libp = NULL;
421 libp = libloc.libp;
427 retval = (*libp->cfga_change_state_p)
435 if ((retval = libp->vers_ops->get_cond(&libloc, &cond,
443 (*libp->cfga_change_state_p)(
452 rele_lib(libp);
495 libloc.libp = NULL;
502 retval = (*libloc.libp->cfga_private_func_p)(function,
505 rele_lib(libloc.libp);
546 libloc.libp = NULL;
553 retval = (*libloc.libp->cfga_test_p)(libloc.ap_physical,
555 rele_lib(libloc.libp);
774 plugin_lib_t *libp, *prev = &plugin_list, *next = NULL;
780 for (libp = plugin_list.next; libp != NULL; libp = next) {
781 next = libp->next;
782 (void) mutex_lock(&libp->lock);
783 if (libp->refcnt) {
784 (void) mutex_unlock(&libp->lock);
785 prev = libp;
788 (void) mutex_unlock(&libp->lock);
790 (void) dlclose(libp->handle);
791 (void) mutex_destroy(&libp->lock);
792 free(libp);
850 libloc.libp = NULL;
855 ret = (*libloc.libp->cfga_ap_id_cmp_p)(ap1, ap2);
857 rele_lib(libloc.libp);
911 libloc.libp = NULL;
918 retval = (*libloc.libp->cfga_help_p)(msgp, options, flags);
919 rele_lib(libloc.libp);
1047 plugin_lib_t *libp,
1057 plugin_lib_t *libp,
1064 if (libp->plugin_vers != CFGA_HSL_V1) {
1089 plugin_lib_t *libp,
1097 if (libp->plugin_vers != CFGA_HSL_V2) {
1153 plugin_lib_t *libp,
1179 plugin_lib_t *libp,
1183 void *libhdlp = libp->handle;
1206 libp->plugin_vers = plug_vers;
1207 libp->vers_ops = &cfga_vers_ops[plug_vers];
1214 libp->cfga_change_state_p = (cfga_err_t (*)(cfga_cmd_t,
1222 libp->cfga_private_func_p = (cfga_err_t (*)(const char *,
1230 libp->cfga_test_p = (cfga_err_t (*)(const char *, const char *,
1237 libp->cfga_help_p = (cfga_err_t (*)(struct cfga_msg *,
1241 libp->cfga_ap_id_cmp_p = default_ap_id_cmp;
1243 libp->cfga_ap_id_cmp_p = (int (*)(const
1247 return (libp->vers_ops->resolve_lib(libp));
1252 null_resolve(plugin_lib_t *libp)
1258 resolve_v1(plugin_lib_t *libp)
1260 void *sym, *libhdlp = libp->handle;
1263 if (libp->plugin_vers != CFGA_HSL_V1) {
1271 libp->cfga_stat_p = (cfga_err_t (*)(const char *,
1279 libp->cfga_list_p = (cfga_err_t (*)(struct cfga_stat_data **,
1286 resolve_v2(plugin_lib_t *libp)
1291 if (libp->plugin_vers != CFGA_HSL_V2) {
1295 if ((sym = dlsym(libp->handle, "cfga_list_ext")) == NULL) {
1299 libp->cfga_list_ext_p = (cfga_err_t (*)(const char *,
1347 lib_loc_p->libp = NULL;
1430 plugin_lib_t *libp;
1432 libp = lib_loc_p->libp;
1435 assert(strcmp(libp->libpath, lib_loc_p->pathname) == 0);
1436 assert(VALID_HSL_VERS(libp->plugin_vers));
1442 assert(dyncomp == NULL || libp->plugin_vers >= CFGA_HSL_V2);
1462 lib_loc_p->libp = NULL;
1465 assert(ret != CFGA_OK || lib_loc_p->libp != NULL);
1502 plugin_lib_t *libp, *list_libp;
1528 libloc_p->libp = libp = list_libp;
1530 if (libp->vers_ops->mklog(node, minor, libp, libloc_p)
1536 if (mklog_hp(node, hp, libp, libloc_p) != CFGA_OK) {
1551 libp = config_calloc_check(1, sizeof (plugin_lib_t), NULL);
1552 if (libp == NULL) {
1557 (void) snprintf(libp->libpath, sizeof (libp->libpath), "%s",
1563 libp->handle = dlopen(libp->libpath, RTLD_NOW);
1564 if (libp->handle == NULL) {
1566 free(libp);
1571 if (resolve_lib_ref(libp, libloc_p) != CFGA_OK ||
1572 libp->vers_ops->mklog(node, minor, libp, libloc_p)
1575 (void) dlclose(libp->handle);
1576 free(libp);
1580 if (resolve_lib_ref(libp, libloc_p) != CFGA_OK ||
1581 mklog_hp(node, hp, libp, libloc_p) != CFGA_OK) {
1583 (void) dlclose(libp->handle);
1584 free(libp);
1595 libp->next = list_libp->next;
1596 list_libp->next = libp;
1599 libp->refcnt = 1;
1600 (void) mutex_init(&libp->lock, USYNC_THREAD, NULL);
1605 * record libp and physical node name in the libloc struct
1607 libloc_p->libp = libp;
1849 plugin_lib_t *libp = entry->lc_libp;
1850 libloc_p->libp = libp;
1851 hold_lib(libp);
1852 (void) strcpy(libloc_p->pathname, libp->libpath);
1888 entry->lc_libp = libloc_p->libp;
1988 libloc_p->libp = NULL;
1999 if (libloc_p->libp == NULL) {
2023 libloc_p->libp = NULL;
2035 if (libloc_p->libp != NULL) {
2293 plugin_lib_t *libp = NULL;
2295 for (libp = plugin_list.next; libp != NULL; libp = libp->next) {
2296 if (strncmp(libpath, libp->libpath, MAXPATHLEN) == 0) {
2297 return (libp);
2633 plugin_lib_t *libp;
2642 lib_loc.libp = NULL;
2671 libp = lib_loc.libp;
2672 assert(libp != NULL);
2679 if (compat_plugin(&lstatp->use_vers, libp->plugin_vers)) {
2681 (void) libp->vers_ops->stat_plugin(lstatp,
2692 ret = libp->vers_ops->stat_plugin(lstatp,
2707 rele_lib(libp);
2724 plugin_lib_t *libp;
2732 libloc.libp = NULL;
2737 assert(libloc.libp != NULL);
2738 libp = libloc.libp;
2744 rele_lib(libp);
2753 rc = libp->vers_ops->stat_plugin(lstatp, &libloc,
2755 rele_lib(libp);
2796 if ((rc = (*(libloc_p->libp->cfga_stat_p))(libloc_p->ap_physical,
2855 if ((rc = (*(libloc_p->libp->cfga_list_ext_p))(
3036 plugin_lib_t *libp;
3041 libp = liblocp->libp;
3042 if (libp->plugin_vers != CFGA_HSL_V1) {
3047 if ((rc = (*liblocp->libp->cfga_stat_p)(
3062 plugin_lib_t *libp;
3067 libp = liblocp->libp;
3068 if (libp->plugin_vers != CFGA_HSL_V2) {
3075 if ((rc = (*liblocp->libp->cfga_list_ext_p)(
3281 hold_lib(plugin_lib_t *libp)
3283 assert(libp->refcnt >= 0);
3284 (void) mutex_lock(&libp->lock);
3285 libp->refcnt++;
3286 (void) mutex_unlock(&libp->lock);
3290 rele_lib(plugin_lib_t *libp)
3292 assert(libp->refcnt > 0);
3293 (void) mutex_lock(&libp->lock);
3294 libp->refcnt--;
3295 (void) mutex_unlock(&libp->lock);