-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples_common.h
58 lines (47 loc) · 1.23 KB
/
examples_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Copyright 2009 Aris Adamantiadis
This file is part of the SSH Library
You are free to copy this file, modify it in any way, consider it being public
domain. This does not apply to the rest of the library though, but it is
allowed to cut-and-paste working code from this file to any license of
program.
The goal is to show the API in action. It's not a reference on how terminal
clients must be made or how a client should react.
*/
#ifndef EXAMPLES_COMMON_H_
#define EXAMPLES_COMMON_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <libssh/libssh.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#define COLS 4
#define CHARS 50
#define EVERY 20
typedef struct iplist
{
int is_ssh;
char *ip;
char *user;
char *pawd;
char *port;
char *path;
ssh_session session;
ssh_scp scp;
FILE *file;
struct iplist *next;
}*ipinfo, ipList;
// 枚举
enum {READ,WRITE};
// 发包
int libssh_scp(ipinfo iplist);
// ssh连接创建
ssh_session connect_ssh(char *ip,char *user,char *port,char *pawd);
// 验证
int authenticate_console(ssh_session session,char *password);
// knownhosts
int verify_knownhost(ssh_session session);
#endif /* EXAMPLES_COMMON_H_ */