Home | History | Annotate | Download | only in iscsid

Lines Matching defs:portal

36 /* counter for portal and target ID */
45 * Create a portal entry and link it into the appropriate lists.
46 * May also create the associated portal group entry if it does not exist.
47 * Will return the existing entry if the address matches a defined portal.
51 * addr the portal address (includes tag)
52 * dtype portal discovery type
55 * Returns: pointer to created portal
63 portal_t *portal;
66 DEB(9, ("Create Portal addr %s port %d group %d",
69 if ((portal = find_portal_by_addr(target, addr)) != NULL)
70 return portal;
72 portal = calloc(1, sizeof(*portal));
73 if (!portal) {
77 portal->addr = *addr;
78 portal->target = target;
79 portal->portaltype = dtype;
80 portal->discoveryid = did;
81 if (!portal->addr.port) {
82 portal->addr.port = ISCSI_DEFAULT_PORT;
89 portal->entry.sid.id = portarget_id;
98 free(portal);
108 portal->group = curr;
110 TAILQ_INSERT_TAIL(&curr->portals, portal, group_list);
114 TAILQ_INSERT_TAIL(&list[PORTAL_LIST].list, &portal->entry, link);
117 DEB(9, ("create_portal returns %p", portal));
118 return portal;
124 * Delete a portal entry after unlinking it from its lists.
125 * May also delete the associated portal group entry if the group is empty.
128 * portal the pointer to the portal
133 delete_portal(portal_t * portal, boolean_t delete_empty)
135 portal_group_t *curr = portal->group;
136 target_t *target = portal->target;
138 TAILQ_REMOVE(&curr->portals, portal, group_list);
139 TAILQ_REMOVE(&list[PORTAL_LIST].list, &portal->entry, link);
149 free(portal);
213 /* First delete all portals in all portal groups. */
237 * addr The portal address
318 portal_t *portal;
333 find_send_target_by_addr(&par->portal[0])) != NULL)) {
355 target = create_send_target(par->TargetName, &par->portal[0]);
394 portal = create_portal(target, &par->portal[i],
397 if (portal == NULL) {
401 res->portal_id[i] = portal->entry.sid.id;
412 * Check whether the given target and portal already exist.
417 * portal
418 * dtype = type of portal added: PORTAL_TYPE_SENDTARGET or
420 * did = ID of SendTargets or iSNS for which portal was discovered
423 * Always sets portaltype to dtype even if portal already exists
432 portal_t *portal;
441 portal = create_portal(target, addr, dtype, did);
442 if (portal == NULL) {
448 } else if ((portal = create_portal(target, addr, dtype, did)) == NULL) {
451 portal->portaltype = dtype;
510 * target and its portals. If a portal ID is given, returns only the
511 * target info and the ID of this portal.
556 idp = res->portal;
571 * Handle ADD_PORTAL request: Add a portal to an existing target.
588 portal_t *portal;
590 DEB(9, ("Add portal: target %d (%s), symname %s, addr %s",
592 par->sym_name, par->portal.address));
606 portal = create_portal(target, &par->portal, PORTAL_TYPE_STATIC,
608 if (portal == NULL) {
614 strlcpy((char *)portal->entry.sid.name, (char *)par->sym_name,
615 portal->entry.sid.name));
617 portal->options = par->options;
624 res->portal_id = portal->entry.sid;
627 DEB(9, ("AddPortal success (id %d)", portal->entry.sid.id));
634 * portal.
648 portal_t *portal = NULL;
658 err = ((portal = find_portal(&par->id)) == NULL);
673 res->portal = starg->addr;
675 res->target_id = portal->target->entry.sid;
676 res->portal_id = portal->entry.sid;
677 res->portal = portal->addr;
683 * Handle REMOVE_TARGET request: Removes a target, target portal,
684 * or Send-Targets portal from its respective list.
698 portal_t *portal = NULL;
711 err = ((portal = find_portal(&par->id)) == NULL);
713 delete_portal(portal, FALSE);
733 * portal The portal address
740 cl_get_address(iscsi_portal_address_t * portal, char *str)
765 portal->port = (uint16_t) val;
780 portal->group_tag = (uint16_t) val;
786 if (strlen(str) >= sizeof(portal->address))
789 strlcpy((char *)portal->address, str, sizeof(portal->address));
844 * <portal-group-tag>