1it_tpg_create(3ISCSIT)iSCSI Management Library Functionsit_tpg_create(3ISCSIT)
2
3
4

NAME

6       it_tpg_create,  it_tpg_delete,  it_tpg_free - create and         delete
7       iSCSI target portal groups
8

SYNOPSIS

10       cc [ flag... ] file... -liscsit [ library... ]
11       #include <libiscsit.h>
12
13       int it_tpg_create(it_config_t *cfg, it_tpg_t **tpg,
14            char *tpg_name, char *portal_ip_port);
15
16
17       int it_tpg_delete(it_config_t *cfg, it_tpg_t *tpg,
18            boolean_t force););
19
20
21       void it_tpg_free(it_tpg_t *tpg);
22
23

PARAMETERS

25       cfg               a pointer t the iSCSI configuration structure
26
27
28       tpg               a pointer to the it_tpg_t structure representing  the
29                         target portal group
30
31
32       tpg_name          an identifier for the target portal group
33
34
35       portal_ip_port    a  string  containing  an  appropriately formatted IP
36                         address:port. Both IPv4 and IPv6 addresses  are  per‐
37                         mitted.  This  value  becomes the first portal in the
38                         target portal group. Applications can add  additional
39                         values using it_portal_create(3ISCSIT) before commit‐
40                         ting the target portal group. IPv6  addresses  should
41                         be enclosed in square brackets ('[', ']').
42
43
44       force             boolean  value  indicating if the target portal group
45                         should be removed even if it is associated  with  one
46                         or  more  targets.  If not B_TRUE, the operation will
47                         fail if the target product group is associated with a
48                         target.
49
50

DESCRIPTION

52       The  it_tpg_create()  function allocates and creates an it_tpg_t struc‐
53       ture representing a new iSCSI target portal  group.  The  new  it_tpg_t
54       structure is added to the global tpg list (cfg_tgt_list) in the it_con‐
55       fig_t structure.
56
57
58       The it_tpg_delete() function deletes the  target  portal  group  repre‐
59       sented  by  tpg, where tpg is an existing it_tpg_t structure within the
60       global configuration cfg.
61
62
63       The it_tpg_free() function deallocates  resources  associated  with  an
64       it_tpg_t  structure.  If tpg->next is not NULL, this function frees all
65       members of the list.
66
67
68       Configuration changes as a result of these functions are not  instanti‐
69       ated  until  the modified configuration is committed by calling it_con‐
70       fig_commit(3ISCSIT).
71

RETURN VALUES

73       The it_tpg_create() and it_tpg_delete() functions return 0  on  success
74       and an error value on failure.
75

ERRORS

77       The it_tpg_create() and it_tpg_delete() functions will fail if:
78
79       EBUSY     The portal group is associated with one or more targets.
80
81
82       EEXIST    The  portal  was  already configured for another portal group
83                 associated with this target.
84
85
86       EINVAL    A parameter is invalid.
87
88
89       ENOMEM    Resources could not be allocated.
90
91

ATTRIBUTES

93       See attributes(5) for descriptions of the following attributes:
94
95
96
97
98       ┌─────────────────────────────┬─────────────────────────────┐
99       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
100       ├─────────────────────────────┼─────────────────────────────┤
101       │Interface Stability          │Committed                    │
102       ├─────────────────────────────┼─────────────────────────────┤
103       │MT-Level                     │MT-Safe                      │
104       └─────────────────────────────┴─────────────────────────────┘
105

SEE ALSO

107       it_config_commit(3ISCSIT),    it_ini_create(3ISCSIT),    it_portal_cre‐
108       ate(3ISCSIT), it_tgt_create(3ISCSIT), libiscsit(3LIB), libnvpair(3LIB),
109       libstmf(3LIB), attributes(5)
110
111
112
113SunOS 5.11                        1 Oct 2008            it_tpg_create(3ISCSIT)
Impressum