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