Add setters for TCP keepalive values
This patch adds 3 functions to set the 3 keepalive values TCP_KEEPIDLE, TCP_KEEPCNT and TCP_KEEPINTVL. The values have to be set after iscsi context creation and are then configured on the socket on each new connection.
This commit is contained in:
@@ -86,6 +86,9 @@ struct iscsi_context {
|
||||
int is_connected;
|
||||
|
||||
int tcp_user_timeout;
|
||||
int tcp_keepcnt;
|
||||
int tcp_keepintvl;
|
||||
int tcp_keepidle;
|
||||
|
||||
int current_phase;
|
||||
int next_phase;
|
||||
|
||||
@@ -974,6 +974,28 @@ iscsi_set_debug(struct iscsi_context *iscsi, int level);
|
||||
EXTERN void
|
||||
iscsi_set_tcp_user_timeout(struct iscsi_context *iscsi, int timeout_ms);
|
||||
|
||||
/*
|
||||
* This function is to set the TCP_KEEPIDLE option. It has to be called after iscsi
|
||||
* context creation.
|
||||
*/
|
||||
EXTERN void
|
||||
iscsi_set_tcp_keepidle(struct iscsi_context *iscsi, int value);
|
||||
|
||||
/*
|
||||
* This function is to set the TCP_KEEPCNT option. It has to be called after iscsi
|
||||
* context creation.
|
||||
*/
|
||||
EXTERN void
|
||||
iscsi_set_tcp_keepcnt(struct iscsi_context *iscsi, int value);
|
||||
|
||||
/*
|
||||
* This function is to set the TCP_KEEPINTVL option. It has to be called after iscsi
|
||||
* context creation.
|
||||
*/
|
||||
EXTERN void
|
||||
iscsi_set_tcp_keepintvl(struct iscsi_context *iscsi, int value);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user