Lines Matching defs:linkp

539  * Update the db entry with name "entryname" using information from "linkp".
542 dlmgmt_db_update(dlmgmt_db_op_t op, const char *entryname, dlmgmt_link_t *linkp,
551 if ((req = dlmgmt_db_req_alloc(op, entryname, linkp->ll_linkid,
552 linkp->ll_zoneid, flags, &err)) == NULL)
708 parse_linkprops(char *buf, dlmgmt_link_t *linkp)
754 linkp->ll_linkid =
759 (void) snprintf(linkp->ll_link,
764 linkp->ll_class =
769 linkp->ll_media =
777 if (linkattr_set(&(linkp->ll_head), attr_name,
818 if (linkp->ll_class == 0x60) {
819 linkp->ll_class = DATALINK_CLASS_IPTUN;
827 * Free linkp->ll_head (link attribute list)
829 linkattr_destroy(linkp);
834 process_link_line(char *buf, dlmgmt_link_t *linkp)
840 bzero(linkp, sizeof (*linkp));
841 linkp->ll_linkid = DATALINK_INVALID_LINKID;
876 linkp->ll_linkid = atoi(str);
879 if (strlcpy(linkp->ll_link, str, sizeof (linkp->ll_link)) >=
880 sizeof (linkp->ll_link))
894 if (parse_linkprops(str, linkp) < 0)
908 * Find any properties in linkp that refer to "old", and rename to "new".
912 dlmgmt_attr_rename(dlmgmt_link_t *linkp, const char *old, const char *new,
922 if ((attrp = linkattr_find(linkp->ll_head, "linkover")) != NULL ||
923 (attrp = linkattr_find(linkp->ll_head, "simnetpeer")) != NULL) {
937 if ((attrp = linkattr_find(linkp->ll_head, "portnames")) == NULL)
971 dlmgmt_link_t link_in_file, *linkp = NULL, *dblinkp;
982 linkp = link_by_id(req->ls_linkid, req->ls_zoneid);
983 if (linkp == NULL || (linkp->ll_flags & req->ls_flags) == 0) {
992 * In the case of a rename, linkp's name has been updated to
995 rename = (strcmp(req->ls_link, linkp->ll_link) != 0);
1039 linkp = link_by_name(link_in_file.ll_link,
1044 generate_link_line(linkp, persist, buf);
1051 linkp->ll_link, &attr_renamed);
1087 generate_link_line(linkp, persist, buf);
1215 generate_link_line(dlmgmt_link_t *linkp, boolean_t persist, char *buf)
1223 ptr += snprintf(ptr, BUFLEN(lim, ptr), "%s\t", linkp->ll_link);
1229 u64 = linkp->ll_linkid;
1232 u64 = linkp->ll_class;
1234 u64 = linkp->ll_media;
1242 for (cur_p = linkp->ll_head; cur_p != NULL;
1254 dlmgmt_delete_db_entry(dlmgmt_link_t *linkp, uint32_t flags)
1256 return (dlmgmt_db_update(DLMGMT_DB_OP_DELETE, linkp->ll_link, linkp,
1261 dlmgmt_write_db_entry(const char *entryname, dlmgmt_link_t *linkp,
1268 linkp, DLMGMT_PERSIST)) != 0) {
1275 linkp, DLMGMT_ACTIVE)) != 0) && (flags & DLMGMT_PERSIST)) {
1277 linkp, DLMGMT_PERSIST);
1296 dlmgmt_link_t *linkp;
1305 if ((linkp = link_by_id(linkid, GLOBAL_ZONEID)) == NULL)
1307 new_attr_sz = strlen(linkp->ll_link) + 1;
1310 (void) strcpy(new_attr_val, linkp->ll_link);
1329 (linkp = link_by_id(linkid, GLOBAL_ZONEID)) ==
1335 linkp->ll_link);
1357 dlmgmt_db_upgrade(dlmgmt_link_t *linkp)
1361 for (attrp = linkp->ll_head; attrp != NULL; attrp = attrp->lp_next)
1366 dlmgmt_db_phys_activate(dlmgmt_link_t *linkp)
1368 linkp->ll_flags |= DLMGMT_ACTIVE;
1369 (void) dlmgmt_write_db_entry(linkp->ll_link, linkp, DLMGMT_ACTIVE);
1375 dlmgmt_link_t *linkp;
1377 for (linkp = avl_first(&dlmgmt_id_avl); linkp != NULL;
1378 linkp = AVL_NEXT(&dlmgmt_id_avl, linkp)) {
1379 if (linkp->ll_zoneid == zoneid && (linkp->ll_class & class))
1380 func(linkp);
1449 dlmgmt_link_t *linkp = avl_first(&dlmgmt_name_avl), *next_linkp;
1451 while (linkp != NULL) {
1452 next_linkp = AVL_NEXT(&dlmgmt_name_avl, linkp);
1453 if (linkp->ll_zoneid == zoneid) {
1454 (void) dlmgmt_destroy_common(linkp,
1457 linkp = next_linkp;