xref: /titanic_44/usr/src/cmd/ssh/include/ssh2.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*	$OpenBSD: ssh2.h,v 1.8 2002/03/04 17:27:39 stevesk Exp $	*/
2*7c478bd9Sstevel@tonic-gate 
3*7c478bd9Sstevel@tonic-gate #ifndef	_SSH2_H
4*7c478bd9Sstevel@tonic-gate #define	_SSH2_H
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*7c478bd9Sstevel@tonic-gate 
8*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
9*7c478bd9Sstevel@tonic-gate extern "C" {
10*7c478bd9Sstevel@tonic-gate #endif
11*7c478bd9Sstevel@tonic-gate 
12*7c478bd9Sstevel@tonic-gate 
13*7c478bd9Sstevel@tonic-gate /*
14*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
15*7c478bd9Sstevel@tonic-gate  *
16*7c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
17*7c478bd9Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
18*7c478bd9Sstevel@tonic-gate  * are met:
19*7c478bd9Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
20*7c478bd9Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
21*7c478bd9Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
22*7c478bd9Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in the
23*7c478bd9Sstevel@tonic-gate  *    documentation and/or other materials provided with the distribution.
24*7c478bd9Sstevel@tonic-gate  *
25*7c478bd9Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26*7c478bd9Sstevel@tonic-gate  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27*7c478bd9Sstevel@tonic-gate  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28*7c478bd9Sstevel@tonic-gate  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29*7c478bd9Sstevel@tonic-gate  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30*7c478bd9Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31*7c478bd9Sstevel@tonic-gate  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32*7c478bd9Sstevel@tonic-gate  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33*7c478bd9Sstevel@tonic-gate  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34*7c478bd9Sstevel@tonic-gate  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35*7c478bd9Sstevel@tonic-gate  */
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
38*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
39*7c478bd9Sstevel@tonic-gate  */
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate /*
42*7c478bd9Sstevel@tonic-gate  * draft-ietf-secsh-architecture-05.txt
43*7c478bd9Sstevel@tonic-gate  *
44*7c478bd9Sstevel@tonic-gate  *   Transport layer protocol:
45*7c478bd9Sstevel@tonic-gate  *
46*7c478bd9Sstevel@tonic-gate  *     1-19     Transport layer generic (e.g. disconnect, ignore, debug,
47*7c478bd9Sstevel@tonic-gate  *              etc)
48*7c478bd9Sstevel@tonic-gate  *     20-29    Algorithm negotiation
49*7c478bd9Sstevel@tonic-gate  *     30-49    Key exchange method specific (numbers can be reused for
50*7c478bd9Sstevel@tonic-gate  *              different authentication methods)
51*7c478bd9Sstevel@tonic-gate  *
52*7c478bd9Sstevel@tonic-gate  *   User authentication protocol:
53*7c478bd9Sstevel@tonic-gate  *
54*7c478bd9Sstevel@tonic-gate  *     50-59    User authentication generic
55*7c478bd9Sstevel@tonic-gate  *     60-79    User authentication method specific (numbers can be reused
56*7c478bd9Sstevel@tonic-gate  *              for different authentication methods)
57*7c478bd9Sstevel@tonic-gate  *
58*7c478bd9Sstevel@tonic-gate  *   Connection protocol:
59*7c478bd9Sstevel@tonic-gate  *
60*7c478bd9Sstevel@tonic-gate  *     80-89    Connection protocol generic
61*7c478bd9Sstevel@tonic-gate  *     90-127   Channel related messages
62*7c478bd9Sstevel@tonic-gate  *
63*7c478bd9Sstevel@tonic-gate  *   Reserved for client protocols:
64*7c478bd9Sstevel@tonic-gate  *
65*7c478bd9Sstevel@tonic-gate  *     128-191  Reserved
66*7c478bd9Sstevel@tonic-gate  *
67*7c478bd9Sstevel@tonic-gate  *   Local extensions:
68*7c478bd9Sstevel@tonic-gate  *
69*7c478bd9Sstevel@tonic-gate  *     192-255  Local extensions
70*7c478bd9Sstevel@tonic-gate  */
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate /* ranges */
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_TRANSPORT_MIN				1
75*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_TRANSPORT_MAX				49
76*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_MIN				50
77*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_MAX				79
78*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CONNECTION_MIN				80
79*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CONNECTION_MAX				127
80*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_RESERVED_MIN				128
81*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_RESERVED_MAX				191
82*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_LOCAL_MIN				192
83*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_LOCAL_MAX				255
84*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_MIN					1
85*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_MAX					255
86*7c478bd9Sstevel@tonic-gate 
87*7c478bd9Sstevel@tonic-gate /* transport layer: generic */
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_DISCONNECT				1
90*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_IGNORE					2
91*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_UNIMPLEMENTED				3
92*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_DEBUG					4
93*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_SERVICE_REQUEST			5
94*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_SERVICE_ACCEPT				6
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /* transport layer: alg negotiation */
97*7c478bd9Sstevel@tonic-gate 
98*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEXINIT				20
99*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_NEWKEYS				21
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate /* transport layer: kex specific messages, can be reused */
102*7c478bd9Sstevel@tonic-gate 
103*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEXDH_INIT				30
104*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEXDH_REPLY				31
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate /* dh-group-exchange */
107*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REQUEST_OLD			30
108*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_GROUP			31
109*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_INIT			32
110*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REPLY			33
111*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REQUEST			34
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate /* user authentication: generic */
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_REQUEST			50
116*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_FAILURE			51
117*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_SUCCESS			52
118*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_BANNER			53
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate /* user authentication: method specific, can be reused */
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_PK_OK				60
123*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ		60
124*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_INFO_REQUEST			60
125*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_INFO_RESPONSE			61
126*7c478bd9Sstevel@tonic-gate 
127*7c478bd9Sstevel@tonic-gate /* connection protocol: generic */
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_GLOBAL_REQUEST				80
130*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_REQUEST_SUCCESS			81
131*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_REQUEST_FAILURE			82
132*7c478bd9Sstevel@tonic-gate 
133*7c478bd9Sstevel@tonic-gate /* channel related messages */
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN				90
136*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION		91
137*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN_FAILURE			92
138*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_WINDOW_ADJUST			93
139*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_DATA				94
140*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_EXTENDED_DATA			95
141*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_EOF				96
142*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_CLOSE				97
143*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_REQUEST			98
144*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_SUCCESS			99
145*7c478bd9Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_FAILURE			100
146*7c478bd9Sstevel@tonic-gate 
147*7c478bd9Sstevel@tonic-gate /* ALTPRIVSEP */
148*7c478bd9Sstevel@tonic-gate #ifdef ALTPRIVSEP
149*7c478bd9Sstevel@tonic-gate #define SSH2_PRIV_MSG_ALTPRIVSEP			254
150*7c478bd9Sstevel@tonic-gate #endif /* ALTPRIVSEP */
151*7c478bd9Sstevel@tonic-gate 
152*7c478bd9Sstevel@tonic-gate /* disconnect reason code */
153*7c478bd9Sstevel@tonic-gate 
154*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT	1
155*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_PROTOCOL_ERROR			2
156*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED		3
157*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED	4
158*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_RESERVED			4
159*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_MAC_ERROR			5
160*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_COMPRESSION_ERROR		6
161*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE		7
162*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED	8
163*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE		9
164*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_CONNECTION_LOST			10
165*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_BY_APPLICATION			11
166*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS		12
167*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER		13
168*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE	14
169*7c478bd9Sstevel@tonic-gate #define SSH2_DISCONNECT_ILLEGAL_USER_NAME		15
170*7c478bd9Sstevel@tonic-gate 
171*7c478bd9Sstevel@tonic-gate /* misc */
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate #define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED		1
174*7c478bd9Sstevel@tonic-gate #define SSH2_OPEN_CONNECT_FAILED			2
175*7c478bd9Sstevel@tonic-gate #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE			3
176*7c478bd9Sstevel@tonic-gate #define SSH2_OPEN_RESOURCE_SHORTAGE			4
177*7c478bd9Sstevel@tonic-gate 
178*7c478bd9Sstevel@tonic-gate #define SSH2_EXTENDED_DATA_STDERR			1
179*7c478bd9Sstevel@tonic-gate 
180*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
181*7c478bd9Sstevel@tonic-gate }
182*7c478bd9Sstevel@tonic-gate #endif
183*7c478bd9Sstevel@tonic-gate 
184*7c478bd9Sstevel@tonic-gate #endif /* _SSH2_H */
185