Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_cxn.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Defines the iSCSI connection managment functions. Internally a state machine
36  * is used to send the mailbox commands.
37  * This code should be OS independant.
38  */
39 
40 #ifndef _OCS_CXN_H
41 #define _OCS_CXN_H
42 
43 #include "ocs_os.h"
44 
45 /* Initialization and Configuration */
48 
49 ocs_cxn_t* ocs_cxn_alloc(ocs_iscsi_t *iscsi, uint32_t conn_hdl);
50 int32_t ocs_cxn_connect(ocs_iscsi_t *iscsi,
51  ocs_hal_ip_address_t *remote_ip,
52  uint16_t tcp_port,
53  char *tgt_name);
55  uint32_t cid);
56 int32_t ocs_cxn_close(ocs_cxn_t *cxn, uint8_t sendRst);
57 void ocs_cxn_force_free(ocs_cxn_t *cxn);
58 
59 int ocs_ddump_node(ocs_textbuf_t *textbuf, ocs_node_t *node);
60 
61 #endif /* !_OCS_CXN_H */
62 
63 /* vim: set noexpandtab textwidth=120: */
ocs_cxn_t * ocs_cxn_alloc(ocs_iscsi_t *iscsi, uint32_t conn_hdl)
Allocates a connection and initializes the fields as required.
Definition: ocs_cxn.c:1666
int32_t ocs_cxn_initialize(ocs_iscsi_t *iscsi)
Initialize the iSCSI connection objects.
Definition: ocs_cxn.c:121
int ocs_ddump_node(ocs_textbuf_t *textbuf, ocs_node_t *node)
Generate node ddump data.
Definition: ocs_cxn.c:1738
void ocs_cxn_force_free(ocs_cxn_t *cxn)
Free memory resources of a node object.
Definition: ocs_cxn.c:174
void ocs_cxn_teardown(ocs_iscsi_t *iscsi)
Free the iSCSI connection objects.
Definition: ocs_cxn.c:155
iSCSI object
Definition: ocs_iscsi.h:293
structure wrapping an IP address together with it's type.
Definition: ocs_hal.h:259
int32_t ocs_cxn_connect(ocs_iscsi_t *iscsi, ocs_hal_ip_address_t *remote_ip, uint16_t tcp_port, char *tgt_name)
Log an initiator into the specified target address.
Definition: ocs_cxn.c:1498
int32_t ocs_cxn_new_tgt_connection(ocs_iscsi_t *iscsi, uint32_t conn_hdl)
Function to receive new TCP connections.
Definition: ocs_cxn.c:1564
int32_t ocs_cxn_close(ocs_cxn_t *cxn, uint8_t sendRst)
Issues a request to the HAL to close the connection.
Definition: ocs_cxn.c:1648