ctdb-scripts: Use more unique temporary file names
[obnox/samba/samba-obnox.git] / librpc / idl / negoex.idl
1 #include "idl_types.h"
2
3 /*
4   NEGOEX interface definition
5   See http://ietfreport.isoc.org/all-ids/draft-zhu-negoex-04.txt
6 */
7
8 import "misc.idl";
9
10 [
11         uuid("fcc30ddc-98d0-11e5-8a56-83e9a6706f2f"),
12         helper("../librpc/ndr/ndr_negoex.h"),
13         helpstring("NEGOEX messages")
14 ]
15 interface negoex
16 {
17         typedef [nopush,nopull,noprint] struct {
18 #if 0
19                 [relative,size_is(length)] uint8 *data;
20                 uint32 length;
21 #else
22                 DATA_BLOB blob;
23                 /*
24                  * internal helper variable */
25                 uint32 _length;
26                 /*
27                  * the dummy pointer is needed in order to let the
28                  * callers use NDR_BUFFERS
29                  */
30                 [relative] uint8 *_dummy;
31 #endif
32         } negoex_BYTE_VECTOR;
33
34         typedef [public] struct {
35                 GUID guid;
36         } negoex_AUTH_SCHEME;
37
38         typedef [nopush,nopull] struct {
39                 [relative,size_is(count)] negoex_AUTH_SCHEME *array;
40                 uint32 count;
41         } negoex_AUTH_SCHEME_VECTOR;
42
43         typedef [v1_enum] enum {
44                 NEGOEX_EXTENSION_TYPE_TODO = 0 /* TODO */
45         } negoex_ExtensionTypes;
46
47         typedef [public] struct {
48                 negoex_ExtensionTypes type;
49                 negoex_BYTE_VECTOR value;
50         } negoex_EXTENSION;
51
52         typedef [nopush,nopull] struct {
53                 [relative,size_is(count)] negoex_EXTENSION *array;
54                 uint32 count;
55         } negoex_EXTENSION_VECTOR;
56
57         typedef [v1_enum] enum {
58                 NEGOEX_CHECKSUM_SCHEME_RFC3961 = 1
59         } negoex_ChecksumSchemes;
60
61         typedef struct {
62                 [value(20)] uint32 header_length;
63                 negoex_ChecksumSchemes scheme;
64                 uint32 type;
65                 negoex_BYTE_VECTOR value;
66         } negoex_CHECKSUM;
67
68         typedef [v1_enum] enum {
69                 NEGOEX_ALERT_VERIFY_NO_KEY = 1
70         } negoex_AlertReason;
71
72         typedef [public] struct {
73                 [value(4)] uint32 header_length; /* TODO: is 4 correct? */
74                 negoex_AlertReason reason;
75         } negoex_ALERT_PULSE;
76
77         typedef [v1_enum] enum {
78                 NEGOEX_ALERT_TYPE_PULSE = 1
79         } negoex_AlertTypes;
80
81         typedef [public] struct {
82                 negoex_AlertTypes type;
83                 negoex_BYTE_VECTOR value;
84         } negoex_ALERT;
85
86         typedef [nopush,nopull] struct {
87                 [relative,size_is(count)] negoex_ALERT *array;
88                 uint32 count;
89         } negoex_ALERT_VECTOR;
90
91         typedef [public,v1_enum] enum {
92                 NEGOEX_MESSAGE_TYPE_INITIATOR_NEGO = 0,
93                 NEGOEX_MESSAGE_TYPE_ACCEPTOR_NEGO = 1,
94                 NEGOEX_MESSAGE_TYPE_INITIATOR_META_DATA = 2,
95                 NEGOEX_MESSAGE_TYPE_ACCEPTOR_META_DATA = 3,
96                 NEGOEX_MESSAGE_TYPE_CHALLENGE = 4,
97                 NEGOEX_MESSAGE_TYPE_AP_REQUEST = 5,
98                 NEGOEX_MESSAGE_TYPE_VERIFY = 6,
99                 NEGOEX_MESSAGE_TYPE_ALERT = 7
100         } negoex_MESSAGE_TYPE;
101
102         const uint32 NEGOEX_PROTOCOL_VERSION_0 = 0;
103
104         typedef [flag(NDR_PAHEX)] struct {
105                 [flag(NDR_PAHEX)] uint8 random[32];
106                 [value(NEGOEX_PROTOCOL_VERSION_0)] udlong protocol_version;
107                 negoex_AUTH_SCHEME_VECTOR auth_schemes;
108                 negoex_EXTENSION_VECTOR extensions;
109         } negoex_NEGO_PAYLOAD;
110
111         typedef struct {
112                 negoex_AUTH_SCHEME auth_scheme;
113                 negoex_BYTE_VECTOR exchange;
114         } negoex_EXCHANGE_PAYLOAD;
115
116         typedef struct {
117                 negoex_AUTH_SCHEME auth_scheme;
118                 negoex_CHECKSUM checksum;
119         } negoex_VERIFY_PAYLOAD;
120
121         typedef struct {
122                 negoex_AUTH_SCHEME auth_scheme;
123                 NTSTATUS status;
124                 negoex_ALERT_VECTOR alerts;
125         } negoex_ALERT_PAYLOAD;
126
127         typedef [public,nodiscriminant] union {
128         [case(NEGOEX_MESSAGE_TYPE_INITIATOR_NEGO)] negoex_NEGO_PAYLOAD nego;
129         [case(NEGOEX_MESSAGE_TYPE_ACCEPTOR_NEGO)] negoex_NEGO_PAYLOAD nego;
130         [case(NEGOEX_MESSAGE_TYPE_INITIATOR_META_DATA)] negoex_EXCHANGE_PAYLOAD exchange;
131         [case(NEGOEX_MESSAGE_TYPE_ACCEPTOR_META_DATA)] negoex_EXCHANGE_PAYLOAD exchange;
132         [case(NEGOEX_MESSAGE_TYPE_CHALLENGE)] negoex_EXCHANGE_PAYLOAD exchange;
133         [case(NEGOEX_MESSAGE_TYPE_AP_REQUEST)] negoex_EXCHANGE_PAYLOAD exchange;
134         [case(NEGOEX_MESSAGE_TYPE_VERIFY)] negoex_VERIFY_PAYLOAD verify;
135         [case(NEGOEX_MESSAGE_TYPE_ALERT)] negoex_ALERT_PAYLOAD alert;
136         } negoex_PAYLOAD;
137
138         typedef [public,relative_base,gensize,nopull] struct {
139                 [charset(DOS),value("NEGOEXTS")] uint8 signature[8];
140                 negoex_MESSAGE_TYPE type;
141                 uint32 sequence_number;
142                 [value(ndr_negoex_MESSAGE_header_length(r))] uint32 header_length;
143                 [value(ndr_size_negoex_MESSAGE(r, ndr->flags))] uint32 message_length;
144                 GUID conversation_id;
145                 [switch_is(type)] negoex_PAYLOAD p;
146         } negoex_MESSAGE;
147
148         typedef [public,nopush,nopull,flag(NDR_NOALIGN)] struct {
149                 uint32 count;
150                 negoex_MESSAGE messages[count];
151         } negoex_MESSAGE_ARRAY;
152
153         void decode_negoex_MESSAGE(
154                 [in] negoex_MESSAGE_ARRAY array
155                 );
156 }