summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-05 21:13:11 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-05 23:36:59 +0900
commit9908fb309d9388481769e1a558a1f8dc47c4dabf (patch)
tree6c126167a978c60a1735b3e57899ebae131d400a /include
parentc95e6a4fffe935330b4018e49f95fff5ad2cc551 (diff)
passing options via pointers in mscp_ssh_opts
We do not need static buf because we have already dropped python biding support.
Diffstat (limited to 'include')
-rw-r--r--include/mscp.h35
1 files changed, 12 insertions, 23 deletions
diff --git a/include/mscp.h b/include/mscp.h
index 8d68032..92f6e9e 100644
--- a/include/mscp.h
+++ b/include/mscp.h
@@ -31,8 +31,6 @@
#define MSCP_DIRECTION_L2R 1 /** Indicates local to remote copy */
#define MSCP_DIRECTION_R2L 2 /** Indicates remote to local copy */
-#define MSCP_MAX_COREMASK_STR 64
-
/**
* @struct mscp_opts
* @brief Structure configuring mscp.
@@ -43,22 +41,13 @@ struct mscp_opts {
size_t min_chunk_sz; /** minimum chunk size (default 64MB) */
size_t max_chunk_sz; /** maximum chunk size (default file size/nr_threads) */
size_t buf_sz; /** buffer size, default 16k. */
- char coremask[MSCP_MAX_COREMASK_STR]; /** hex to specifiy usable cpu cores */
+ char *coremask; /** hex to specifiy usable cpu cores */
int max_startups; /** sshd MaxStartups concurrent connections */
int interval; /** interval between SSH connection attempts */
int severity; /** messaging severity. set MSCP_SERVERITY_* */
};
-#define MSCP_SSH_MAX_LOGIN_NAME 64
-#define MSCP_SSH_MAX_PORT_STR 32
-#define MSCP_SSH_MAX_IDENTITY_PATH PATH_MAX
-#define MSCP_SSH_MAX_CIPHER_STR 32
-#define MSCP_SSH_MAX_HMAC_STR 32
-#define MSCP_SSH_MAX_COMP_STR 32 /* yes, no, zlib, zlib@openssh.com, none */
-#define MSCP_SSH_MAX_CCALGO_STR 16
-#define MSCP_SSH_MAX_PASSWORD 128
-#define MSCP_SSH_MAX_PASSPHRASE 128
/**
* @struct mscp_ssh_opts
@@ -66,17 +55,17 @@ struct mscp_opts {
*/
struct mscp_ssh_opts {
/* ssh options */
- char login_name[MSCP_SSH_MAX_LOGIN_NAME]; /** ssh username */
- char port[MSCP_SSH_MAX_PORT_STR]; /** ssh port */
- char config[PATH_MAX]; /** path to ssh_config, default ~/.ssh/config*/
- char identity[MSCP_SSH_MAX_IDENTITY_PATH]; /** path to private key */
- char cipher[MSCP_SSH_MAX_CIPHER_STR]; /** cipher spec */
- char hmac[MSCP_SSH_MAX_HMAC_STR]; /** hmacp spec */
- char compress[MSCP_SSH_MAX_COMP_STR]; /** yes, no, zlib@openssh.com */
- char ccalgo[MSCP_SSH_MAX_CCALGO_STR]; /** TCP cc algorithm */
-
- char password[MSCP_SSH_MAX_PASSWORD]; /** password auth passowrd */
- char passphrase[MSCP_SSH_MAX_PASSPHRASE]; /** passphrase for private key */
+ char *login_name; /** ssh username */
+ char *port; /** ssh port */
+ char *config; /** path to ssh_config, default ~/.ssh/config*/
+ char *identity; /** path to private key */
+ char *cipher; /** cipher spec */
+ char *hmac; /** hmacp spec */
+ char *compress; /** yes, no, zlib@openssh.com */
+ char *ccalgo; /** TCP cc algorithm */
+
+ char *password; /** password auth passowrd */
+ char *passphrase; /** passphrase for private key */
int debug_level; /** inclirement libssh debug output level */
bool no_hostkey_check; /** do not check host keys */