xref: /titanic_52/usr/src/cmd/cmd-inet/usr.sbin/snoop/slp.h (revision f841f6ad96ea6675d6c6b35c749eaac601799fdf)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SNOOP_SLP_H
28 #define	_SNOOP_SLP_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Structs and definitions for the snoop SLP interpreter only
34  * (This code is not used by the SLP library).
35  */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 struct slpv1_hdr {
42 	unsigned char	vers;
43 	unsigned char	function;
44 	unsigned short	length;
45 	unsigned char	flags;
46 	unsigned char	dialect;
47 	unsigned char	language[2];
48 	unsigned short	charset;
49 	unsigned short	xid;
50 };
51 
52 struct slpv2_hdr {
53 	unsigned char	vers;
54 	unsigned char	function;
55 	unsigned char	l1, l2, l3;
56 	unsigned char	flags;
57 	unsigned char	reserved;
58 	unsigned char	o1, o2, o3;
59 	unsigned short	xid;
60 };
61 
62 /*
63  *  flags
64  */
65 #define	V1_OVERFLOW	0x80
66 #define	V1_MONOLINGUAL	0x40
67 #define	V1_URL_AUTH	0x20
68 #define	V1_ATTR_AUTH	0x10
69 #define	V1_FRESH_REG	0x08
70 
71 #define	V2_OVERFLOW	0x80
72 #define	V2_FRESH	0x40
73 #define	V2_MCAST	0x20
74 
75 /*
76  * packet types
77  */
78 
79 #define	V1_SRVREQ 1
80 #define	V1_SRVRPLY 2
81 #define	V1_SRVREG 3
82 #define	V1_SRVDEREG 4
83 #define	V1_SRVACK 5
84 #define	V1_ATTRRQST 6
85 #define	V1_ATTRRPLY 7
86 #define	V1_DAADVERT 8
87 #define	V1_SRVTYPERQST 9
88 #define	V1_SRVTYPERPLY 10
89 
90 #define	V2_SRVRQST	1
91 #define	V2_SRVRPLY	2
92 #define	V2_SRVREG	3
93 #define	V2_SRVDEREG	4
94 #define	V2_SRVACK	5
95 #define	V2_ATTRRQST	6
96 #define	V2_ATTRRPLY	7
97 #define	V2_DAADVERT	8
98 #define	V2_SRVTYPERQST	9
99 #define	V2_SRVTYPERPLY	10
100 #define	V2_SAADVERT	11
101 
102 /*
103  * extended packet types
104  */
105 #define	SCOPERQST 65
106 #define	SCOPERPLY 66
107 #define	DARQST	  67
108 #define	DARPLY	  68
109 #define	DASTRIKE  69
110 
111 
112 /*
113  * error codes
114  */
115 
116 #define	OK				0x0000
117 #define	LANG_NOT_SUPPORTED		0x0001
118 #define	PROTOCOL_PARSE_ERR		0x0002
119 #define	INVALID_REGISTRATION		0x0003
120 #define	SCOPE_NOT_SUPPORTED		0x0004
121 #define	CHARSET_NOT_UNDERSTOOD		0x0005
122 #define	AUTHENTICATION_UNKNOWN		0x0005
123 #define	AUTHENTICATION_INVALID		0x0006
124 #define	V2_AUTHENTICATION_ABSENT	0x0006
125 #define	V2_AUTHENTICATION_FAILED	0x0007
126 #define	V2_VER_NOT_SUPPORTED		0x0009
127 #define	NOT_SUPPORTED_YET		0x000a
128 #define	V2_INTERNAL_ERROR		0x000a
129 #define	REQUEST_TIMED_OUT		0x000b
130 #define	V2_DA_BUSY_NOW			0x000b
131 #define	COULD_NOT_INIT_NET_RESOURCES	0x000c
132 #define	V2_OPTION_NOT_UNDERSTOOD	0x000c
133 #define	COULD_NOT_ALLOCATE_MEMORY	0x000d
134 #define	V2_INVALID_UPDATE		0x000d
135 #define	PARAMETER_BAD			0x000e
136 #define	V2_RQST_NOT_SUPPORTED		0x000e
137 #define	INVALID_LIFETIME		0x000f
138 
139 #define	INTERNAL_NET_ERROR		0x000f
140 #define	INTERNAL_SYSTEM_ERROR		0x0010
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif	/* _SNOOP_SLP_H */
147