-
Notifications
You must be signed in to change notification settings - Fork 0
/
ietf-tcp-client.yang
346 lines (320 loc) · 11.6 KB
/
ietf-tcp-client.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
module ietf-tcp-client {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-tcp-client";
prefix tcpc;
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-crypto-types {
prefix ct;
reference
"RFC AAAA: YANG Data Types and Groupings for Cryptography";
}
import ietf-tcp-common {
prefix tcpcmn;
reference
"RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
}
organization
"IETF NETCONF (Network Configuration) Working Group and the
IETF TCP Maintenance and Minor Extensions (TCPM) Working Group";
contact
"WG Web: https://datatracker.ietf.org/wg/netconf
https://datatracker.ietf.org/wg/tcpm
WG List: NETCONF WG list <mailto:[email protected]>
TCPM WG list <mailto:[email protected]>
Authors: Kent Watsen <mailto:[email protected]>
Michael Scharf
<mailto:[email protected]>";
description
"This module defines reusable groupings for TCP clients that
can be used as a basis for specific TCP client instances.
Copyright (c) 2024 IETF Trust and the persons identified
as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with
or without modification, is permitted pursuant to, and
subject to the license terms contained in, the Revised
BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC DDDD
(https://www.rfc-editor.org/info/rfcDDDD); see the RFC
itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision YYYY-MM-DD {
description
"Initial version";
reference
"RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
}
// Features
feature local-binding-supported {
description
"Indicates that the server supports configuring local
bindings (i.e., the local address and local port) for
TCP clients.";
}
feature tcp-client-keepalives {
description
"Per socket TCP keepalive parameters are configurable for
TCP clients on the server implementing this feature.";
reference
"RFC 9293: Transmission Control Protocol (TCP)";
}
feature proxy-connect {
description
"Indicates the TCP-client supports connecting through
TCP proxies.";
}
feature socks4-supported {
if-feature proxy-connect;
description
"Indicates the TCP-client supports Socks4-based proxies.";
reference
"SOCKS Proceedings:
1992 Usenix Security Symposium.";
}
feature socks4a-supported {
if-feature proxy-connect;
description
"Indicates the TCP-client supports Socks4a-based proxies.";
reference
"OpenSSH message:
SOCKS 4A: A Simple Extension to SOCKS 4 Protocol
https://www.openssh.com/txt/socks4a.protocol.";
}
feature socks5-supported {
if-feature proxy-connect;
description
"Indicates the TCP-client supports Socks5-based proxies.";
reference
"RFC 1928:
SOCKS Protocol Version 5";
}
feature socks5-gss-api {
if-feature socks5-supported;
description
"Indicates that the server, when acting as a TCP-client,
supports authenticating to a SOCKS Version 5 proxy server
using GSSAPI credentials.";
reference
"RFC 1928: SOCKS Protocol Version 5";
}
feature socks5-username-password {
if-feature socks5-supported;
description
"Indicates that the server, when acting as a TCP-client,
supports authenticating to a SOCKS Version 5 proxy server
using 'username' and 'password' credentials.";
reference
"RFC 1928: SOCKS Protocol Version 5";
}
// Groupings
grouping tcp-client-grouping {
description
"A reusable grouping for configuring a TCP client.
Note that this grouping uses fairly typical descendant
node names such that a stack of 'uses' statements will
have name conflicts. It is intended that the consuming
data model will resolve the issue (e.g., by wrapping
the 'uses' statement in a container called
'tcp-client-parameters'). This model purposely does
not do this itself so as to provide maximum flexibility
to consuming models.";
leaf remote-address {
type inet:host;
mandatory true;
description
"The IP address or hostname of the remote peer to
establish a connection with. If a domain name is
configured, then the DNS resolution should happen on
each connection attempt. If the DNS resolution
results in multiple IP addresses, the IP addresses
are tried according to local preference order until
a connection has been established or until all IP
addresses have failed.";
}
leaf remote-port {
type inet:port-number;
description
"The port number of the remote TCP server.";
}
leaf local-address {
if-feature "local-binding-supported";
type inet:ip-address;
description
"The local IP address/interface to bind to for when
connecting to the remote peer. INADDR_ANY ('0.0.0.0') or
INADDR6_ANY ('0:0:0:0:0:0:0:0' a.k.a. '::') MAY be used to
explicitly indicate the implicit default, that the server
can bind to any IPv4 or IPv6 address.";
}
leaf local-port {
if-feature "local-binding-supported";
type inet:port-number;
default "0";
description
"The local IP port number to bind to for when connecting
to the remote peer. The port number '0', which is the
default value, indicates that any available local port
number may be used.";
}
container proxy-server {
if-feature "proxy-connect";
presence
"Indicates that a proxy connection has been configured.
Present so that the mandatory descendant nodes do not
imply that this node must be configured.";
choice proxy-type {
mandatory true;
description
"Selects a proxy connection protocol.";
case socks4 {
if-feature socks4-supported;
container socks4-parameters {
leaf remote-address {
type inet:ip-address;
mandatory true;
description
"The IP address of the proxy server.";
}
leaf remote-port {
type inet:port-number;
default "1080";
description
"The IP port number for the proxy server.";
}
description
"Parameters for connecting to a TCP-based proxy
server using the SOCKS4 protocol.";
reference
"SOCKS, Proceedings: 1992 Usenix Security Symposium.";
}
}
case socks4a {
if-feature socks4a-supported;
container socks4a-parameters {
leaf remote-address {
type inet:host;
mandatory true;
description
"The IP address or hostname of the proxy server.";
}
leaf remote-port {
type inet:port-number;
default "1080";
description
"The IP port number for the proxy server.";
}
description
"Parameters for connecting to a TCP-based proxy
server using the SOCKS4a protocol.";
reference
"SOCKS Proceedings:
1992 Usenix Security Symposium.
OpenSSH message:
SOCKS 4A: A Simple Extension to SOCKS 4 Protocol
https://www.openssh.com/txt/socks4a.protocol";
}
}
case socks5 {
if-feature socks5-supported;
container socks5-parameters {
leaf remote-address {
type inet:host;
mandatory true;
description
"The IP address or hostname of the proxy server.";
}
leaf remote-port {
type inet:port-number;
default "1080";
description
"The IP port number for the proxy server.";
}
container authentication-parameters {
presence
"Indicates that an authentication mechanism
has been configured. Present so that the
mandatory descendant nodes do not imply that
this node must be configured.";
description
"A container for SOCKS Version 5 authentication
mechanisms.
A complete list of methods is defined at:
https://www.iana.org/assignments/socks-methods
/socks-methods.xhtml.";
reference
"RFC 1928: SOCKS Protocol Version 5";
choice auth-type {
mandatory true;
description
"A choice amongst supported SOCKS Version 5
authentication mechanisms.";
case gss-api {
if-feature "socks5-gss-api";
container gss-api {
description
"Contains GSS-API configuration. Defines
as an empty container to enable specific
GSS-API configuration to be augmented in
by future modules.";
reference
"RFC 1928: SOCKS Protocol Version 5
RFC 2743: Generic Security Service
Application Program Interface
Version 2, Update 1";
}
}
case username-password {
if-feature "socks5-username-password";
container username-password {
leaf username {
type string;
mandatory true;
description
"The 'username' value to use for client
identification.";
}
uses ct:password-grouping {
description
"The password to be used for client
authentication.";
}
description
"Contains Username/Password configuration.";
reference
"RFC 1929: Username/Password Authentication
for SOCKS V5";
}
}
}
}
description
"Parameters for connecting to a TCP-based proxy server
using the SOCKS5 protocol.";
reference
"RFC 1928: SOCKS Protocol Version 5";
}
}
}
description
"Proxy server settings.";
}
uses tcpcmn:tcp-common-grouping {
refine "keepalives" {
if-feature "tcp-client-keepalives";
description
"An if-feature statement so that implementations
can choose to support TCP client keepalives.";
}
}
}
}