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:
committed by
Ronnie Sahlberg
parent
e26f6fe51a
commit
9378a39ddc
@@ -66,7 +66,21 @@ void iscsi_free_iscsi_inqueue(struct iscsi_context *iscsi, struct iscsi_in_pdu *
|
||||
/* max length of chap challange */
|
||||
#define MAX_CHAP_C_LENGTH 2048
|
||||
|
||||
struct iscsi_transport {
|
||||
|
||||
int temp;
|
||||
};
|
||||
|
||||
struct tcp_transport {
|
||||
|
||||
struct iscsi_transport t;
|
||||
|
||||
};
|
||||
|
||||
struct iscsi_context {
|
||||
|
||||
struct iscsi_transport *t;
|
||||
enum iscsi_transport_type transport;
|
||||
char initiator_name[MAX_STRING_SIZE+1];
|
||||
char target_name[MAX_STRING_SIZE+1];
|
||||
char target_address[MAX_STRING_SIZE+1]; /* If a redirect */
|
||||
@@ -372,6 +386,8 @@ void iscsi_timeout_scan(struct iscsi_context *iscsi);
|
||||
void iscsi_reconnect_cb(struct iscsi_context *iscsi _U_, int status,
|
||||
void *command_data, void *private_data);
|
||||
|
||||
void iscsi_init_tcp_transport(struct iscsi_context *iscsi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user