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.
 
 
 
 

75 lines
2.7 KiB

  1. .TH libssh2_session_supported_algs 3 "23 Oct 2011" "libssh2 1.4.0" "libssh2 manual"
  2. .SH NAME
  3. libssh2_session_supported_algs - get list of supported algorithms
  4. .SH SYNOPSIS
  5. .nf
  6. #include <libssh2.h>
  7. int libssh2_session_supported_algs(LIBSSH2_SESSION* session,
  8. int method_type,
  9. const char*** algs);
  10. .SH DESCRIPTION
  11. \fIsession\fP - An instance of initialized LIBSSH2_SESSION (the function will
  12. use its pointer to the memory allocation function). \fImethod_type\fP -
  13. Method type. See \fIlibssh2_session_method_pref(3)\fP. \fIalgs\fP - Address
  14. of a pointer that will point to an array of returned algorithms
  15. Get a list of supported algorithms for the given \fImethod_type\fP. The
  16. method_type parameter is equivalent to method_type in
  17. \fIlibssh2_session_method_pref(3)\fP. If successful, the function will
  18. allocate the appropriate amount of memory. When not needed anymore, it must be
  19. deallocated by calling \fIlibssh2_free(3)\fP. When this function is
  20. unsuccessful, this must not be done.
  21. In order to get a list of all supported compression algorithms,
  22. libssh2_session_flag(session, LIBSSH2_FLAG_COMPRESS, 1) must be called before
  23. calling this function, otherwise only "none" will be returned.
  24. If successful, the function will allocate and fill the array with supported
  25. algorithms (the same names as defined in RFC 4253). The array is not NULL
  26. terminated.
  27. .SH EXAMPLE
  28. .nf
  29. #include "libssh2.h"
  30. const char **algorithms;
  31. int rc, i;
  32. LIBSSH2_SESSION *session;
  33. /* initialize session */
  34. session = libssh2_session_init();
  35. rc = libssh2_session_supported_algs(session,
  36. LIBSSH2_METHOD_CRYPT_CS,
  37. &algorithms);
  38. if (rc>0) {
  39. /* the call succeeded, do sth. with the list of algorithms
  40. (e.g. list them)... */
  41. printf("Supported symmetric algorithms:\\n");
  42. for ( i=0; i<rc; i++ )
  43. printf("\\t%s\\n", algorithms[i]);
  44. /* ... and free the allocated memory when not needed anymore */
  45. libssh2_free(session, algorithms);
  46. }
  47. else {
  48. /* call failed, error handling */
  49. }
  50. .SH RETURN VALUE
  51. On success, a number of returned algorithms (i.e a positive number will be
  52. returned). In case of a failure, an error code (a negative number, see below)
  53. is returned. 0 should never be returned.
  54. .SH ERRORS
  55. \fILIBSSH2_ERROR_BAD_USE\fP - Invalid address of algs.
  56. \fILIBSSH2_ERROR_METHOD_NOT_SUPPORTED\fP - Unknown method type.
  57. \fILIBSSH2_ERROR_INVAL\fP - Internal error (normally should not occur).
  58. \fILIBSSH2_ERROR_ALLOC\fP - Allocation of memory failed.
  59. .SH AVAILABILITY
  60. Added in 1.4.0
  61. .SH SEE ALSO
  62. .BR libssh2_session_methods(3),
  63. .BR libssh2_session_method_pref(3)
  64. .BR libssh2_free(3)