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.
 
 
 
 

169 lines
8.1 KiB

  1. /*
  2. * Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms,
  6. * with or without modification, are permitted provided
  7. * that the following conditions are met:
  8. *
  9. * Redistributions of source code must retain the above
  10. * copyright notice, this list of conditions and the
  11. * following disclaimer.
  12. *
  13. * Redistributions in binary form must reproduce the above
  14. * copyright notice, this list of conditions and the following
  15. * disclaimer in the documentation and/or other materials
  16. * provided with the distribution.
  17. *
  18. * Neither the name of the copyright holder nor the names
  19. * of any other contributors may be used to endorse or
  20. * promote products derived from this software without
  21. * specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  24. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  25. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  26. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  28. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  30. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  31. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  32. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  33. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  34. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  35. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  36. * OF SUCH DAMAGE.
  37. */
  38. #ifndef LIBSSH2_MACROS_H_
  39. #define LIBSSH2_MACROS_H_
  40. #include "libssh2.h"
  41. #include "libssh2_publickey.h"
  42. #include "libssh2_sftp.h"
  43. /*
  44. * Dummy prototypes to generate wrapper procedures to C macros.
  45. * This is a helper for languages without a clever preprocessor (ILE/RPG).
  46. */
  47. LIBSSH2_API LIBSSH2_SESSION * libssh2_session_init(void);
  48. LIBSSH2_API int libssh2_session_disconnect(LIBSSH2_SESSION *session,
  49. const char *description);
  50. LIBSSH2_API int libssh2_userauth_password(LIBSSH2_SESSION *session,
  51. const char *username,
  52. const char *password);
  53. LIBSSH2_API int
  54. libssh2_userauth_publickey_fromfile(LIBSSH2_SESSION *session,
  55. const char *username,
  56. const char *publickey,
  57. const char *privatekey,
  58. const char *passphrase);
  59. LIBSSH2_API int
  60. libssh2_userauth_hostbased_fromfile(LIBSSH2_SESSION *session,
  61. const char *username,
  62. const char *publickey,
  63. const char *privatekey,
  64. const char *passphrase,
  65. const char *hostname);
  66. LIBSSH2_API int
  67. libssh2_userauth_keyboard_interactive(LIBSSH2_SESSION* session,
  68. const char *username,
  69. LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(
  70. (*response_callback)));
  71. LIBSSH2_API LIBSSH2_CHANNEL *
  72. libssh2_channel_open_session(LIBSSH2_SESSION *session);
  73. LIBSSH2_API LIBSSH2_CHANNEL *
  74. libssh2_channel_direct_tcpip(LIBSSH2_SESSION *session, const char *host,
  75. int port);
  76. LIBSSH2_API LIBSSH2_LISTENER *
  77. libssh2_channel_forward_listen(LIBSSH2_SESSION *session, int port);
  78. LIBSSH2_API int
  79. libssh2_channel_setenv(LIBSSH2_CHANNEL *channel,
  80. const char *varname, const char *value);
  81. LIBSSH2_API int
  82. libssh2_channel_request_pty(LIBSSH2_CHANNEL *channel, const char *term);
  83. LIBSSH2_API int
  84. libssh2_channel_request_pty_size(LIBSSH2_CHANNEL *channel,
  85. int width, int height);
  86. LIBSSH2_API int
  87. libssh2_channel_x11_req(LIBSSH2_CHANNEL *channel, int screen_number);
  88. LIBSSH2_API int
  89. libssh2_channel_shell(LIBSSH2_CHANNEL *channel);
  90. LIBSSH2_API int
  91. libssh2_channel_exec(LIBSSH2_CHANNEL *channel, const char *command);
  92. LIBSSH2_API int
  93. libssh2_channel_subsystem(LIBSSH2_CHANNEL *channel, const char *subsystem);
  94. LIBSSH2_API ssize_t
  95. libssh2_channel_read(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
  96. LIBSSH2_API ssize_t
  97. libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
  98. LIBSSH2_API unsigned long
  99. libssh2_channel_window_read(LIBSSH2_CHANNEL *channel);
  100. LIBSSH2_API ssize_t
  101. libssh2_channel_write(LIBSSH2_CHANNEL *channel, const char *buf, size_t buflen);
  102. LIBSSH2_API ssize_t
  103. libssh2_channel_write_stderr(LIBSSH2_CHANNEL *channel,
  104. const char *buf, size_t buflen);
  105. LIBSSH2_API unsigned long
  106. libssh2_channel_window_write(LIBSSH2_CHANNEL *channel);
  107. LIBSSH2_API int libssh2_channel_flush(LIBSSH2_CHANNEL *channel);
  108. LIBSSH2_API int libssh2_channel_flush_stderr(LIBSSH2_CHANNEL *channel);
  109. LIBSSH2_API LIBSSH2_CHANNEL *
  110. libssh2_scp_send(LIBSSH2_SESSION *session,
  111. const char *path, int mode, libssh2_int64_t size);
  112. LIBSSH2_API int
  113. libssh2_publickey_add(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name,
  114. const unsigned char *blob, unsigned long blob_len,
  115. char overwrite, unsigned long num_attrs,
  116. const libssh2_publickey_attribute attrs[]);
  117. LIBSSH2_API int
  118. libssh2_publickey_remove(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name,
  119. const unsigned char *blob, unsigned long blob_len);
  120. LIBSSH2_API int LIBSSH2_SFTP_S_ISLNK(unsigned long permissions);
  121. LIBSSH2_API int LIBSSH2_SFTP_S_ISREG(unsigned long permissions);
  122. LIBSSH2_API int LIBSSH2_SFTP_S_ISDIR(unsigned long permissions);
  123. LIBSSH2_API int LIBSSH2_SFTP_S_ISCHR(unsigned long permissions);
  124. LIBSSH2_API int LIBSSH2_SFTP_S_ISBLK(unsigned long permissions);
  125. LIBSSH2_API int LIBSSH2_SFTP_S_ISFIFO(unsigned long permissions);
  126. LIBSSH2_API int LIBSSH2_SFTP_S_ISSOCK(unsigned long permissions);
  127. LIBSSH2_API LIBSSH2_SFTP_HANDLE *
  128. libssh2_sftp_open(LIBSSH2_SFTP *sftp, const char *filename,
  129. unsigned long flags, long mode);
  130. LIBSSH2_API LIBSSH2_SFTP_HANDLE *
  131. libssh2_sftp_opendir(LIBSSH2_SFTP *sftp, const char *path);
  132. LIBSSH2_API int libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle,
  133. char *buffer, size_t buffer_maxlen,
  134. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  135. LIBSSH2_API int libssh2_sftp_close(LIBSSH2_SFTP_HANDLE *handle);
  136. LIBSSH2_API int libssh2_sftp_closedir(LIBSSH2_SFTP_HANDLE *handle);
  137. LIBSSH2_API void libssh2_sftp_rewind(LIBSSH2_SFTP_HANDLE *handle);
  138. LIBSSH2_API int libssh2_sftp_fstat(LIBSSH2_SFTP_HANDLE *handle,
  139. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  140. LIBSSH2_API int libssh2_sftp_fsetstat(LIBSSH2_SFTP_HANDLE *handle,
  141. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  142. LIBSSH2_API int libssh2_sftp_rename(LIBSSH2_SFTP *sftp,
  143. const char *source_filename,
  144. const char *dest_filename);
  145. LIBSSH2_API int libssh2_sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename);
  146. LIBSSH2_API int libssh2_sftp_mkdir(LIBSSH2_SFTP *sftp,
  147. const char *path, long mode);
  148. LIBSSH2_API int libssh2_sftp_rmdir(LIBSSH2_SFTP *sftp, const char *path);
  149. LIBSSH2_API int libssh2_sftp_stat(LIBSSH2_SFTP *sftp, const char *path,
  150. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  151. LIBSSH2_API int libssh2_sftp_lstat(LIBSSH2_SFTP *sftp, const char *path,
  152. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  153. LIBSSH2_API int libssh2_sftp_setstat(LIBSSH2_SFTP *sftp, const char *path,
  154. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  155. LIBSSH2_API int libssh2_sftp_symlink(LIBSSH2_SFTP *sftp, const char *orig,
  156. char *linkpath);
  157. LIBSSH2_API int libssh2_sftp_readlink(LIBSSH2_SFTP *sftp, const char *path,
  158. char *target, unsigned int maxlen);
  159. LIBSSH2_API int libssh2_sftp_realpath(LIBSSH2_SFTP *sftp, const char *path,
  160. char *target, unsigned int maxlen);
  161. #endif