Go to main content

man pages section 3: Extended Library Functions, Volume 4

Exit Print View

Updated: Thursday, June 13, 2019
 
 

srpt_SetTargetState(3SRPT)

Name

srpt_SetTargetState, srpt_GetTargetState, srpt_ResetTarget - set and retrieve SRP Target state for a specific HCA

Synopsis

cc [ flag... ] file... -lsrpt [ library... ]
#include <libsrpt.h>

int srpt_SetTargetState(char *hca_guid, boolean_t enabled);
int srpt_GetTargetState(char *hca_guid, boolean_t *enabled);
int srpt_ResetTarget(char *hca_guid);

Parameters

hc_guid

HCA GUID. Must be in one of the following forms:

3BA000100CD18

base hex form

0003BA000100CD18

base hex form with leading zeroes

hca:3BA000100CD18

form from cfgadm

eui.0003BA000100CD18

EUI form

enabled

boolean value indicating whether a COMSTAR SRP target should be created for this HCA

Description

The srpt_SetTargetState() function controls whether a COMSTAR SRP target will be created for the specified HCA. If enabled is B_TRUE, an SRP target will be created for this HCA. If enabled is B_FALSE, a target will not be created. This function overrides the default setting for the SRP Target service as set by srpt_SetDefaultState(3SRPT). Changing the target state takes effect immediately if the SRP target service is online. Targets set to disabled will be offlined and removed; targets set to enabled will be immediately created.

The srpt_GetTargetState() function retrieves the current setting for the specified HCA.

The srpt_ResetTarget() function clears HCA-specific settings. The service-wide defaults will control SRP Target creation for this HCA.

Return Values

Upon successful completion, these functions return 0. Otherwise they return a non-zero value to indicate the error.

Errors

These functions will fail if:

ENOMEM

Resources could not be allocated.

EINVAL

A parameter is invalid.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See Also

libsrpt(3LIB), srpt_SetDefaultState(3SRPT), attributes(7)