proto files: add a simplified bsd licence to the dot-x files
[deb_libnfs.git] / portmap / portmap.x
CommitLineData
84004dbf 1/*
2f5c161b
RS
2Copyright (c) 2014, Ronnie Sahlberg
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
81. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
102. 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
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25The views and conclusions contained in the software and documentation are those
26of the authors and should not be interpreted as representing official policies,
27either expressed or implied, of the FreeBSD Project.
28*/
84004dbf
RS
29
30const PMAP_PORT = 111; /* portmapper port number */
31
4edd7830 32struct pmap2_mapping {
84004dbf
RS
33 unsigned int prog;
34 unsigned int vers;
35 unsigned int prot;
36 unsigned int port;
37};
38
4edd7830 39struct pmap2_call_args {
84004dbf
RS
40 unsigned int prog;
41 unsigned int vers;
42 unsigned int proc;
43 opaque args<>;
44};
45
4edd7830 46struct pmap2_call_result {
947e8930
RS
47 unsigned int port;
48 opaque res<>;
49};
84004dbf 50
4edd7830
RS
51struct pmap2_mapping_list {
52 pmap2_mapping map;
53 pmap2_mapping_list *next;
8ae943f6
RS
54};
55
4edd7830
RS
56struct pmap2_dump_result {
57 struct pmap2_mapping_list *list;
58};
59
24f45c54 60struct pmap3_string_result {
7fbedfde
RS
61 string addr<>;
62};
63
4edd7830
RS
64struct pmap3_mapping {
65 unsigned int prog;
66 unsigned int vers;
67 string netid<>;
68 string addr<>;
69 string owner<>;
70};
71
72struct pmap3_mapping_list {
73 pmap3_mapping map;
74 pmap3_mapping_list *next;
75};
76
77struct pmap3_dump_result {
78 struct pmap3_mapping_list *list;
8ae943f6
RS
79};
80
b71f7e82
RS
81struct pmap3_call_args {
82 unsigned int prog;
83 unsigned int vers;
84 unsigned int proc;
85 opaque args<>;
86};
87
88struct pmap3_call_result {
89 unsigned int port;
90 opaque res<>;
91};
92
729266a7
RS
93struct pmap3_netbuf {
94 unsigned int maxlen;
f3684c08
RS
95 /* This pretty much contains a sockaddr_storage.
96 * Beware differences in endianess for ss_family
97 * and whether or not ss_len exists.
98 */
729266a7
RS
99 opaque buf<>;
100};
101
84004dbf
RS
102program PMAP_PROGRAM {
103 version PMAP_V2 {
104 void
0f0e352f 105 PMAP2_NULL(void) = 0;
84004dbf
RS
106
107 bool
4edd7830 108 PMAP2_SET(pmap2_mapping) = 1;
84004dbf
RS
109
110 bool
4edd7830 111 PMAP2_UNSET(pmap2_mapping) = 2;
84004dbf
RS
112
113 unsigned int
4edd7830 114 PMAP2_GETPORT(pmap2_mapping) = 3;
947e8930 115
4edd7830 116 pmap2_dump_result
7fbedfde 117 PMAP2_DUMP(void) = 4;
8ae943f6 118
4edd7830
RS
119 pmap2_call_result
120 PMAP2_CALLIT(pmap2_call_args) = 5;
84004dbf 121 } = 2;
4edd7830
RS
122 version PMAP_V3 {
123 void
124 PMAP3_NULL(void) = 0;
125
d731e94c
RS
126 bool
127 PMAP3_SET(pmap3_mapping) = 1;
128
129 bool
130 PMAP3_UNSET(pmap3_mapping) = 2;
131
24f45c54 132 pmap3_string_result
7fbedfde
RS
133 PMAP3_GETADDR(pmap3_mapping) = 3;
134
4edd7830
RS
135 pmap3_dump_result
136 PMAP3_DUMP(void) = 4;
5245608a 137
b71f7e82
RS
138 pmap3_call_result
139 PMAP3_CALLIT(pmap3_call_args) = 5;
140
5245608a
RS
141 unsigned int
142 PMAP3_GETTIME(void) = 6;
729266a7
RS
143
144 pmap3_netbuf
145 PMAP3_UADDR2TADDR(string) = 7;
29258a73 146
24f45c54 147 struct pmap3_string_result
29258a73 148 PMAP3_TADDR2UADDR(pmap3_netbuf) = 8;
4edd7830 149 } = 3;
84004dbf
RS
150} = 100000;
151