xref: /titanic_41/usr/src/cmd/lms/LMS_if_constants.h (revision bfc032a14cc866ab7f34ca6fd86c240a5ebede9d)
1 /*******************************************************************************
2  * Copyright (C) 2004-2008 Intel Corp. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  *  - Redistributions of source code must retain the above copyright notice,
8  *    this list of conditions and the following disclaimer.
9  *
10  *  - Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  *
14  *  - Neither the name of Intel Corp. nor the names of its
15  *    contributors may be used to endorse or promote products derived from this
16  *    software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *******************************************************************************/
30 
31 #ifndef _LMS_IF_CONSTANTS_H_
32 #define _LMS_IF_CONSTANTS_H_
33 
34 #define LMS_PROCOL_VERSION 4
35 #define LMS_PROCOL_VERSION_COMPAT 2
36 
37 //
38 // messages opcodes
39 //
40 typedef enum {
41 	APF_DISCONNECT		= 1,
42 	APF_SERVICE_REQUEST	= 5,
43 	APF_SERVICE_ACCEPT	= 6,
44 	APF_USERAUTH_REQUEST	= 50,
45 	APF_USERAUTH_FAILURE	= 51,
46 	APF_USERAUTH_SUCCESS	= 52,
47 	APF_GLOBAL_REQUEST	= 80,
48 	APF_REQUEST_SUCCESS	= 81,
49 	APF_REQUEST_FAILURE	= 82,
50 	APF_CHANNEL_OPEN		= 90,
51 	APF_CHANNEL_OPEN_CONFIRMATION	= 91,
52 	APF_CHANNEL_OPEN_FAILURE	= 92,
53 	APF_CHANNEL_WINDOW_ADJUST	= 93,
54 	APF_CHANNEL_DATA		= 94,
55 	APF_CHANNEL_CLOSE		= 97,
56 	APF_PROTOCOLVERSION	= 192
57 } APF_MESSAGE_TYPE;
58 
59 typedef enum {
60 	APF_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT             = 1,
61 	APF_DISCONNECT_PROTOCOL_ERROR                          = 2,
62 	APF_DISCONNECT_KEY_EXCHANGE_FAILED                     = 3,
63 	APF_DISCONNECT_RESERVED                                = 4,
64 	APF_DISCONNECT_MAC_ERROR                               = 5,
65 	APF_DISCONNECT_COMPRESSION_ERROR                       = 6,
66 	APF_DISCONNECT_SERVICE_NOT_AVAILABLE                   = 7,
67 	APF_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED          = 8,
68 	APF_DISCONNECT_HOST_KEY_NOT_VERIFIABLE                 = 9,
69 	APF_DISCONNECT_CONNECTION_LOST                        = 10,
70 	APF_DISCONNECT_BY_APPLICATION                         = 11,
71 	APF_DISCONNECT_TOO_MANY_CONNECTIONS                   = 12,
72 	APF_DISCONNECT_AUTH_CANCELLED_BY_USER                 = 13,
73 	APF_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE         = 14,
74 	APF_DISCONNECT_ILLEGAL_USER_NAME                      = 15
75 } APF_DISCONNECT_REASON_CODE;
76 
77 //
78 //strings used in global messages
79 //
80 #define APF_GLOBAL_REQUEST_STR_TCP_FORWARD_REQUEST "tcpip-forward"
81 #define APF_GLOBAL_REQUEST_STR_TCP_FORWARD_CANCEL_REQUEST "cancel-tcpip-forward"
82 #define APF_GLOBAL_REQUEST_STR_UDP_SEND_TO "udp-send-to@amt.intel.com"
83 #define APF_OPEN_CHANNEL_REQUEST_FORWARDED "forwarded-tcpip"
84 #define APF_OPEN_CHANNEL_REQUEST_DIRECT "direct-tcpip"
85 
86 // APF service names
87 #define APF_SERVICE_PFWD "pfwd@amt.intel.com"
88 #define APF_SERVICE_AUTH "auth@amt.intel.com"
89 
90 // APF Authentication method
91 #define APF_AUTH_NONE "none"
92 #define APF_AUTH_PASSWORD "password"
93 
94 //calculate string length without the NULL terminator
95 #define APF_STR_SIZE_OF(s) (sizeof(s)-1)
96 
97 // Trigger reason code
98 typedef enum {
99 	USER_INITIATED_REQUEST		= 1,
100 	ALERT_REQUEST			= 2,
101 	HIT_PROVISIONING_REQUEST	= 3,
102 	PERIODIC_REQUEST		= 4,
103 	LME_REQUEST			= 254
104 } APF_TRIGGER_REASON;
105 
106 typedef enum {
107 	OPEN_FAILURE_REASON_ADMINISTRATIVELY_PROHIBITED = 1,
108 	OPEN_FAILURE_REASON_CONNECT_FAILED = 2,
109 	OPEN_FAILURE_REASON_UNKNOWN_CHANNEL_TYPE = 3,
110 	OPEN_FAILURE_REASON_RESOURCE_SHORTAGE = 4
111 } OPEN_FAILURE_REASON;
112 
113 #endif
114 
115