]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/lib/iscsi/init_grp.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / lib / iscsi / init_grp.h
CommitLineData
7c673cae
FG
1/*-
2 * BSD LICENSE
3 *
4 * Copyright (C) 2008-2012 Daisuke Aoyama <aoyama@peach.ne.jp>.
5 * Copyright (c) Intel Corporation.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#ifndef SPDK_INIT_GRP_H
36#define SPDK_INIT_GRP_H
37
38#include "spdk/conf.h"
f67539c2
TL
39#include "iscsi/iscsi.h"
40#include "iscsi/conn.h"
7c673cae 41
11fdf7f2 42struct spdk_iscsi_initiator_name {
f67539c2 43 char name[MAX_INITIATOR_NAME + 1];
11fdf7f2
TL
44 TAILQ_ENTRY(spdk_iscsi_initiator_name) tailq;
45};
46
47struct spdk_iscsi_initiator_netmask {
f67539c2 48 char mask[MAX_INITIATOR_ADDR + 1];
11fdf7f2 49 TAILQ_ENTRY(spdk_iscsi_initiator_netmask) tailq;
7c673cae
FG
50};
51
52struct spdk_iscsi_init_grp {
53 int ninitiators;
11fdf7f2 54 TAILQ_HEAD(, spdk_iscsi_initiator_name) initiator_head;
7c673cae 55 int nnetmasks;
11fdf7f2 56 TAILQ_HEAD(, spdk_iscsi_initiator_netmask) netmask_head;
7c673cae
FG
57 int ref;
58 int tag;
7c673cae
FG
59 TAILQ_ENTRY(spdk_iscsi_init_grp) tailq;
60};
61
62/* SPDK iSCSI Initiator Group management API */
f67539c2 63int iscsi_init_grp_create_from_initiator_list(int tag,
7c673cae
FG
64 int num_initiator_names, char **initiator_names,
65 int num_initiator_masks, char **initiator_masks);
f67539c2 66int iscsi_init_grp_add_initiators_from_initiator_list(int tag,
11fdf7f2
TL
67 int num_initiator_names, char **initiator_names,
68 int num_initiator_masks, char **initiator_masks);
f67539c2 69int iscsi_init_grp_delete_initiators_from_initiator_list(int tag,
11fdf7f2
TL
70 int num_initiator_names, char **initiator_names,
71 int num_initiator_masks, char **initiator_masks);
f67539c2
TL
72int iscsi_init_grp_register(struct spdk_iscsi_init_grp *ig);
73struct spdk_iscsi_init_grp *iscsi_init_grp_unregister(int tag);
74struct spdk_iscsi_init_grp *iscsi_init_grp_find_by_tag(int tag);
75void iscsi_init_grp_destroy(struct spdk_iscsi_init_grp *ig);
76int iscsi_parse_init_grps(void);
77void iscsi_init_grps_destroy(void);
78void iscsi_init_grps_config_text(FILE *fp);
79void iscsi_init_grps_info_json(struct spdk_json_write_ctx *w);
80void iscsi_init_grps_config_json(struct spdk_json_write_ctx *w);
9f95a23c 81#endif /* SPDK_INIT_GRP_H */