geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

69 lines
2.6 KiB

  1. .\" Copyright (c) 2009, 2010 by Daniel Stenberg
  2. .\"
  3. .TH libssh2_knownhost_add 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
  4. .SH NAME
  5. libssh2_knownhost_add - add a known host
  6. .SH SYNOPSIS
  7. #include <libssh2.h>
  8. int libssh2_knownhost_addc(LIBSSH2_KNOWNHOSTS *hosts,
  9. char *host, char *salt,
  10. char *key, size_t keylen,
  11. const char *comment, size_t commentlen,
  12. int typemask,
  13. struct libssh2_knownhost **store);
  14. .SH DESCRIPTION
  15. Adds a known host to the collection of known hosts identified by the 'hosts'
  16. handle.
  17. \fIhost\fP is a pointer the host name in plain text or hashed. If hashed, it
  18. must be provided base64 encoded. The host name can be the IP numerical address
  19. of the host or the full name.
  20. If you want to add a key for a specific port number for the given host, you
  21. must provide the host name like '[host]:port' with the actual characters '['
  22. and ']' enclosing the host name and a colon separating the host part from the
  23. port number. For example: \&"[host.example.com]:222".
  24. \fIsalt\fP is a pointer to the salt used for the host hashing, if the host is
  25. provided hashed. If the host is provided in plain text, salt has no meaning.
  26. The salt has to be provided base64 encoded with a trailing zero byte.
  27. \fIkey\fP is a pointer to the key for the given host.
  28. \fIkeylen\fP is the total size in bytes of the key pointed to by the \fIkey\fP
  29. argument
  30. \fIcomment\fP is a pointer to a comment for the key.
  31. \fIcommentlen\fP is the total size in bytes of the comment pointed to by the \fIcomment\fP argument
  32. \fItypemask\fP is a bitmask that specifies format and info about the data
  33. passed to this function. Specifically, it details what format the host name is,
  34. what format the key is and what key type it is.
  35. The host name is given as one of the following types:
  36. LIBSSH2_KNOWNHOST_TYPE_PLAIN, LIBSSH2_KNOWNHOST_TYPE_SHA1 or
  37. LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
  38. The key is encoded using one of the following encodings:
  39. LIBSSH2_KNOWNHOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
  40. The key is using one of these algorithms:
  41. LIBSSH2_KNOWNHOST_KEY_RSA1, LIBSSH2_KNOWNHOST_KEY_SSHRSA or
  42. LIBSSH2_KNOWNHOST_KEY_SSHDSS.
  43. \fIstore\fP should point to a pointer that gets filled in to point to the
  44. known host data after the addition. NULL can be passed if you don't care about
  45. this pointer.
  46. .SH RETURN VALUE
  47. Returns a regular libssh2 error code, where negative values are error codes
  48. and 0 indicates success.
  49. .SH AVAILABILITY
  50. Added in libssh2 1.2.5
  51. .SH SEE ALSO
  52. .BR libssh2_knownhost_init(3)
  53. .BR libssh2_knownhost_free(3)
  54. .BR libssh2_knownhost_check(3)