Loading...
Searching...
No Matches
Client-side Call Home on SSH
Client » Client-side Call Home

SSH settings for the Call Home functionality. More...

Collaboration diagram for Client-side Call Home on SSH:

## Functions

int | nc_client_ssh_ch_add_bind_listen (const char *address, uint16_t port)
| Add a new client bind and start listening on it for SSH Call Home connections.
int | nc_client_ssh_ch_add_keypair (const char *pub_key, const char *priv_key)
| Add an SSH public and private key pair to be used for Call Home client authentication.
int | nc_client_ssh_ch_del_bind (const char *address, uint16_t port)
| Remove an SSH listening client bind.
int | nc_client_ssh_ch_del_keypair (int idx)
| Remove an SSH public and private key pair that was used for Call Home client authentication.
void | nc_client_ssh_ch_get_auth_hostkey_check_clb (int(**auth_hostkey_check)(const char *hostname, ssh_session session, void *priv), void **priv)
| Get currently set SSH Call Home authentication hostkey check (knownhosts) callback and its private data previously set by nc_client_ssh_ch_set_auth_hostkey_check_clb().
void | nc_client_ssh_ch_get_auth_interactive_clb (char *(**auth_interactive)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv), void **priv)
| Get currently set SSH Call Home interactive authentication callback and its private data previously set by nc_client_ssh_ch_set_auth_interactive_clb().
void | nc_client_ssh_ch_get_auth_password_clb (char *(**auth_password)(const char *username, const char *hostname, void *priv), void **priv)
| Get currently set SSH Call Home password authentication callback and its private data previously set by nc_client_ssh_ch_set_auth_password_clb().
int16_t | nc_client_ssh_ch_get_auth_pref (NC_SSH_AUTH_TYPE auth_type)
| Get SSH Call Home authentication method preference.
void | nc_client_ssh_ch_get_auth_privkey_passphrase_clb (char *(**auth_privkey_passphrase)(const char *privkey_path, void *priv), void **priv)
| Get currently set SSH Call Home publickey authentication encrypted private key passphrase callback and its private data previously set by nc_client_ssh_ch_set_auth_privkey_passphrase_clb().
int | nc_client_ssh_ch_get_keypair (int idx, const char **pub_key, const char **priv_key)
| Get a specific keypair set to be used for Call Home client authentication.
int | nc_client_ssh_ch_get_keypair_count (void)
| Get the number of public an private key pairs set to be used for Call Home client authentication.
const char * | nc_client_ssh_ch_get_username (void)
| Get client Call Home SSH username used for authentication.
void | nc_client_ssh_ch_set_auth_hostkey_check_clb (int(*auth_hostkey_check)(const char *hostname, ssh_session session, void *priv), void *priv)
| Set SSH Call Home authentication hostkey check (knownhosts) callback.
void | nc_client_ssh_ch_set_auth_interactive_clb (char *(*auth_interactive)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv), void *priv)
| Set SSH Call Home interactive authentication callback.
void | nc_client_ssh_ch_set_auth_password_clb (char *(*auth_password)(const char *username, const char *hostname, void *priv), void *priv)
| Set SSH Call Home password authentication callback.
void | nc_client_ssh_ch_set_auth_pref (NC_SSH_AUTH_TYPE auth_type, int16_t pref)
| Set SSH Call Home authentication method preference.
void | nc_client_ssh_ch_set_auth_privkey_passphrase_clb (char *(*auth_privkey_passphrase)(const char *privkey_path, void *priv), void *priv)
| Set SSH Call Home publickey authentication encrypted private key passphrase callback.
int | nc_client_ssh_ch_set_username (const char *username)
| Set client Call Home SSH username used for authentication.

## Detailed Description

SSH settings for the Call Home functionality.

## Function Documentation

## nc_client_ssh_ch_add_bind_listen()

int nc_client_ssh_ch_add_bind_listen | ( | const char * | address,
|  | uint16_t | port
| ) |  |

Add a new client bind and start listening on it for SSH Call Home connections.

Parameters

  [in] | address | IP address to bind to.
  [in] | port | Port to bind to.

Returns
  0 on success, -1 on error.

## nc_client_ssh_ch_add_keypair()

int nc_client_ssh_ch_add_keypair | ( | const char * | pub_key,
|  | const char * | priv_key
| ) |  |

Add an SSH public and private key pair to be used for Call Home client authentication.

Private key can be encrypted, the passphrase will be asked for before using it.

Parameters

  [in] | pub_key | Path to the public key.
  [in] | priv_key | Path to the private key.

Returns
  0 on success, -1 on error.

## nc_client_ssh_ch_del_bind()

int nc_client_ssh_ch_del_bind | ( | const char * | address,
|  | uint16_t | port
| ) |  |

Remove an SSH listening client bind.

Parameters

  [in] | address | IP address the socket was bound to. NULL matches all.
  [in] | port | Port the socket was bound to. 0 matches all.

Returns
  0 on success, -1 on not found.

## nc_client_ssh_ch_del_keypair()

int nc_client_ssh_ch_del_keypair | ( | int | idx | ) |

Remove an SSH public and private key pair that was used for Call Home client authentication.

Parameters

  [in] | idx | Index of the keypair starting with 0.

Returns
  0 on success, -1 on error.

## nc_client_ssh_ch_get_auth_hostkey_check_clb()

void nc_client_ssh_ch_get_auth_hostkey_check_clb | ( | int(**)(const char *hostname, ssh_session session, void *priv) | auth_hostkey_check,
|  | void ** | priv
| ) |  |

Get currently set SSH Call Home authentication hostkey check (knownhosts) callback and its private data previously set by nc_client_ssh_ch_set_auth_hostkey_check_clb().

Parameters

  [out] | auth_hostkey_check | Currently set callback, NULL in case of the default callback.
  [out] | priv | Currently set (optional) private data to be passed to the callback function.

## nc_client_ssh_ch_get_auth_interactive_clb()

void nc_client_ssh_ch_get_auth_interactive_clb | ( | char *(**)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv) | auth_interactive,
|  | void ** | priv
| ) |  |

Get currently set SSH Call Home interactive authentication callback and its private data previously set by nc_client_ssh_ch_set_auth_interactive_clb().

Parameters

  [out] | auth_interactive | Currently set callback, NULL in case of the default callback.
  [out] | priv | Currently set (optional) private data to be passed to the callback function.

## nc_client_ssh_ch_get_auth_password_clb()

void nc_client_ssh_ch_get_auth_password_clb | ( | char *(**)(const char *username, const char *hostname, void *priv) | auth_password,
|  | void ** | priv
| ) |  |

Get currently set SSH Call Home password authentication callback and its private data previously set by nc_client_ssh_ch_set_auth_password_clb().

Parameters

  [out] | auth_password | Currently set callback, NULL in case of the default callback.
  [out] | priv | Currently set (optional) private data to be passed to the callback function.

## nc_client_ssh_ch_get_auth_pref()

int16_t nc_client_ssh_ch_get_auth_pref | ( | NC_SSH_AUTH_TYPE | auth_type | ) |

Get SSH Call Home authentication method preference.

Parameters

  [in] | auth_type | Authentication method to retrieve the prefrence of.

Returns
  Preference of the `auth_type`.

## nc_client_ssh_ch_get_auth_privkey_passphrase_clb()

void nc_client_ssh_ch_get_auth_privkey_passphrase_clb | ( | char *(**)(const char *privkey_path, void *priv) | auth_privkey_passphrase,
|  | void ** | priv
| ) |  |

Get currently set SSH Call Home publickey authentication encrypted private key passphrase callback and its private data previously set by nc_client_ssh_ch_set_auth_privkey_passphrase_clb().

Parameters

  [out] | auth_privkey_passphrase | Currently set callback, NULL in case of the default callback.
  [out] | priv | Currently set (optional) private data to be passed to the callback function.

## nc_client_ssh_ch_get_keypair()

int nc_client_ssh_ch_get_keypair | ( | int | idx,
|  | const char ** | pub_key,
|  | const char ** | priv_key
| ) |  |

Get a specific keypair set to be used for Call Home client authentication.

Parameters

  [in] | idx | Index of the specific keypair.
  [out] | pub_key | Path to the public key.
  [out] | priv_key | Path to the private key.

Returns
  0 on success, -1 on error.

## nc_client_ssh_ch_get_keypair_count()

int nc_client_ssh_ch_get_keypair_count | ( | void |  | ) |

Get the number of public an private key pairs set to be used for Call Home client authentication.

Returns
  Keypair count.

## nc_client_ssh_ch_get_username()

const char * nc_client_ssh_ch_get_username | ( | void |  | ) |

Get client Call Home SSH username used for authentication.

Returns
  Username used.

## nc_client_ssh_ch_set_auth_hostkey_check_clb()

void nc_client_ssh_ch_set_auth_hostkey_check_clb | ( | int(*)(const char *hostname, ssh_session session, void *priv) | auth_hostkey_check,
|  | void * | priv
| ) |  |

Set SSH Call Home authentication hostkey check (knownhosts) callback.

Repetitive calling causes replacing of the previous callback and its private data. Caller is responsible for freeing the private data when necessary (the private data can be obtained by nc_client_ssh_ch_get_auth_hostkey_check_clb()).

Parameters

  [in] | auth_hostkey_check | Function to call, returns 0 on success, non-zero in error. If NULL, the default callback is set.
  [in] | priv | Optional private data to be passed to the callback function.

## nc_client_ssh_ch_set_auth_interactive_clb()

void nc_client_ssh_ch_set_auth_interactive_clb | ( | char *(*)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv) | auth_interactive,
|  | void * | priv
| ) |  |

Set SSH Call Home interactive authentication callback.

Repetitive calling causes replacing of the previous callback and its private data. Caller is responsible for freeing the private data when necessary (the private data can be obtained by nc_client_ssh_ch_get_auth_interactive_clb()).

Parameters

  [in] | auth_interactive | Function to call for every question, returns the answer for authentication name with instruction and echoing prompt. If NULL, the default callback is set.
  [in] | priv | Optional private data to be passed to the callback function.

## nc_client_ssh_ch_set_auth_password_clb()

void nc_client_ssh_ch_set_auth_password_clb | ( | char *(*)(const char *username, const char *hostname, void *priv) | auth_password,
|  | void * | priv
| ) |  |

Set SSH Call Home password authentication callback.

Repetitive calling causes replacing of the previous callback and its private data. Caller is responsible for freeing the private data when necessary (the private data can be obtained by nc_client_ssh_ch_get_auth_password_clb()).

Parameters

  [in] | auth_password | Function to call, returns the password for username@hostname. If NULL, the default callback is set.
  [in] | priv | Optional private data to be passed to the callback function.

## nc_client_ssh_ch_set_auth_pref()

void nc_client_ssh_ch_set_auth_pref | ( | NC_SSH_AUTH_TYPE | auth_type,
|  | int16_t | pref
| ) |  |

Set SSH Call Home authentication method preference.

The default preference is as follows:

- public key authentication (3)
- password authentication (2)
- interactive authentication (1)

Parameters

  [in] | auth_type | Authentication method to modify the preference of.
  [in] | pref | Preference of `auth_type`. Higher number increases priority, negative values disable the method.

## nc_client_ssh_ch_set_auth_privkey_passphrase_clb()

void nc_client_ssh_ch_set_auth_privkey_passphrase_clb | ( | char *(*)(const char *privkey_path, void *priv) | auth_privkey_passphrase,
|  | void * | priv
| ) |  |

Set SSH Call Home publickey authentication encrypted private key passphrase callback.

Repetitive calling causes replacing of the previous callback and its private data. Caller is responsible for freeing the private data when necessary (the private data can be obtained by nc_client_ssh_ch_get_auth_privkey_passphrase_clb()).

Parameters

  [in] | auth_privkey_passphrase | Function to call for every question, returns the passphrase for the specific private key.
  [in] | priv | Optional private data to be passed to the callback function.

## nc_client_ssh_ch_set_username()

int nc_client_ssh_ch_set_username | ( | const char * | username | ) |

Set client Call Home SSH username used for authentication.

Parameters

  [in] | username | Username to use.

Returns
  0 on success, -1 on error.