compat.libssh2
#includeClient-side C library implementing the SSH2 protocol (in-graph static build with mbedTLS)
#include <libssh2.h>
mcpp add compat.libssh2@1.11.1
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
#include <libssh2.h>
#include <cstdio>
#include <cstring>
int main() {
const char* ver = libssh2_version(LIBSSH2_VERSION_NUM);
if (!ver || std::strcmp(ver, LIBSSH2_VERSION) != 0) {
std::fprintf(stderr, "version mismatch: %s vs %s\n", ver ? ver : "(null)", LIBSSH2_VERSION);
return 1;
}
if (libssh2_init(0) != 0) {
std::fprintf(stderr, "libssh2_init failed\n");
return 2;
}
LIBSSH2_SESSION* session = libssh2_session_init();
if (!session) {
std::fprintf(stderr, "libssh2_session_init failed\n");
libssh2_exit();
return 3;
// …
tests/examples/libssh2/tests/libssh2.cpp · 專案 tests/examples/libssh2
建置
- targets
libssh2 (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include, */src, mcpp_generated
功能
| 功能 | 宣告了 |
|---|---|
| default | implies |
| zlib | deps, defines |
原始檔 (26)
*/src/agent.c*/src/bcrypt_pbkdf.c*/src/channel.c*/src/comp.c*/src/chacha.c*/src/cipher-chachapoly.c*/src/crypt.c*/src/crypto.c*/src/global.c*/src/hostkey.c*/src/keepalive.c*/src/kex.c*/src/knownhost.c*/src/mac.c*/src/misc.c*/src/packet.c*/src/pem.c*/src/poly1305.c*/src/publickey.c*/src/scp.c*/src/session.c*/src/sftp.c*/src/transport.c*/src/userauth.c*/src/userauth_kbd_packet.c*/src/version.c
產生的檔案
mcpp_generated/libssh2_config.h
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
1.11.1 最新 |
LinuxWindowsmacOS | 來源 | d9ec76cbe34d… |