File: sshtest.c

package info (click to toggle)
tinyssh 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,244 kB
  • sloc: ansic: 12,106; sh: 1,168; python: 479; makefile: 42
file content (100 lines) | stat: -rw-r--r-- 1,832 bytes parent folder | download | duplicates (4)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
20140319
Jan Mojzis
Public domain.
*/

#include <signal.h>
#include <unistd.h>
#include <string.h>
#include "fail.h"
#include "ssh.h"

/*
grep SSH_ * | sed 's/.*SSH_/SSH_/g' | cut -d ',' -f1 | cut -d ' ' -f1 | cut -d ')' -f1 | cut -d ':' -f1 | cut -d '"' -f1 | cut -d ';' -f1 | sort -u | grep -v 'SSH_TTY\|SSH_CONNECTION'| while read x; do echo \#ifndef $x; echo error! ;echo \#endif; done
*/

#ifndef SSH_MSG_CHANNEL_CLOSE
error!
#endif
#ifndef SSH_MSG_CHANNEL_DATA
error!
#endif
#ifndef SSH_MSG_CHANNEL_EOF
error!
#endif
#ifndef SSH_MSG_CHANNEL_EXTENDED_DATA
error!
#endif
#ifndef SSH_MSG_CHANNEL_OPEN
error!
#endif
#ifndef SSH_MSG_CHANNEL_OPEN_CONFIRMATION
error!
#endif
#ifndef SSH_MSG_CHANNEL_OPEN_FAILURE
error!
#endif
#ifndef SSH_MSG_CHANNEL_REQUEST
error!
#endif
#ifndef SSH_MSG_CHANNEL_SUCCESS
error!
#endif
#ifndef SSH_MSG_CHANNEL_WINDOW_ADJUST
error!
#endif
#ifndef SSH_MSG_DEBUG
error!
#endif
#ifndef SSH_MSG_DISCONNECT
error!
#endif
#ifndef SSH_MSG_IGNORE
error!
#endif
#ifndef SSH_MSG_KEXDH_INIT
error!
#endif
#ifndef SSH_MSG_KEXDH_REPLY
error!
#endif
#ifndef SSH_MSG_KEXINIT
error!
#endif
#ifndef SSH_MSG_NEWKEYS
error!
#endif
#ifndef SSH_MSG_SERVICE_ACCEPT
error!
#endif
#ifndef SSH_MSG_SERVICE_REQUEST
error!
#endif
#ifndef SSH_MSG_UNIMPLEMENTED
error!
#endif
#ifndef SSH_MSG_USERAUTH_FAILURE
error!
#endif
#ifndef SSH_MSG_USERAUTH_PK_OK
error!
#endif
#ifndef SSH_MSG_USERAUTH_REQUEST
error!
#endif
#ifndef SSH_MSG_USERAUTH_SUCCESS
error!
#endif
#ifndef SSH_OPEN_ADMINISTRATIVELY_PROHIBITED
error!
#endif

int main(void) {

    if (strcmp(ssh_sigstr(SIGTERM), "TERM")) fail("failure")
    if (strcmp(ssh_sigstrlong(SIGTERM), "SIGTERM (termination)")) fail("failure")
    if (strcmp(ssh_sigstr(-1), "UNKNOWN")) fail("failure")
    if (strcmp(ssh_sigstrlong(-1), "UNKNOWN SIGNAL")) fail("failure")
    _exit(0);
}