Libiscsi: Adding transport layer into all library utilities

lib/init: initializing connection transport

lib/socket: Adding function to initialize tcp transport.
            future commits will include adding iSER transport layer,
            so each transport option will has it's own template of functions.

all_utils: All utils stay the same, in future iSER commits in case of
	   iSER transport we will override tcp_transport in
	   iscsi_context.

connect: adding transport initialization when creating context

include/iscsi-private: Adding iscsi_transport attribute in iscsi_context

Signed-off-by: Roy Shterman <roysh@mellanox.com>

Make iscsi_init_tcp_transport private

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Roy Shterman
2016-05-27 18:47:14 +03:00
committed by Ronnie Sahlberg
parent e26f6fe51a
commit 9378a39ddc
6 changed files with 82 additions and 2 deletions

View File

@@ -50,6 +50,9 @@ struct sockaddr;
#define ISCSI_PORTAL_URL_SYNTAX "\"iscsi://[<username>[%<password>]@]" \
"<host>[:<port>]\""
enum iscsi_transport_type {
TCP_TRANSPORT = 0
};
EXTERN void iscsi_set_cache_allocations(struct iscsi_context *iscsi, int ca);
@@ -244,6 +247,18 @@ EXTERN struct iscsi_context *iscsi_create_context(const char *initiator_name);
*/
EXTERN int iscsi_destroy_context(struct iscsi_context *iscsi);
/*
* Sets and initializes the transport type for a context.
* TCP_TRANSPORT is the default and is available on all platforms.
* ISER_TRANSPORT is conditionally supported on Linux where available.
*
* Returns:
* 0: success
* <0: error
*/
EXTERN int iscsi_init_transport(struct iscsi_context *iscsi,
enum iscsi_transport_type transport);
/*
* Set an optional alias name to identify with when connecting to the target
*