blob: ee6c657d30c9847bb519863fd397217b4a8544fb [file] [log] [blame]
romanc1d2b092023-02-02 08:58:27 +01001module ietf-tcp-server {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:ietf-tcp-server";
4 prefix tcps;
5
6 import ietf-inet-types {
7 prefix inet;
8 reference
9 "RFC 6991: Common YANG Data Types";
10 }
11
12 import ietf-tcp-common {
13 prefix tcpcmn;
14 reference
15 "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
16 }
17
18 organization
19 "IETF NETCONF (Network Configuration) Working Group and the
20 IETF TCP Maintenance and Minor Extensions (TCPM) Working Group";
21
22 contact
23 "WG Web: https://datatracker.ietf.org/wg/netconf
24 https://datatracker.ietf.org/wg/tcpm
25 WG List: NETCONF WG list <mailto:netconf@ietf.org>
26 TCPM WG list <mailto:tcpm@ietf.org>
27 Authors: Kent Watsen <mailto:kent+ietf@watsen.net>
28 Michael Scharf
29 <mailto:michael.scharf@hs-esslingen.de>";
Michal Vaskocf898172024-01-15 15:04:28 +010030
romanc1d2b092023-02-02 08:58:27 +010031 description
32 "This module defines reusable groupings for TCP servers that
33 can be used as a basis for specific TCP server instances.
34
roman7fdc84d2023-06-06 13:14:53 +020035 Copyright (c) 2023 IETF Trust and the persons identified
romanc1d2b092023-02-02 08:58:27 +010036 as authors of the code. All rights reserved.
37
38 Redistribution and use in source and binary forms, with
39 or without modification, is permitted pursuant to, and
40 subject to the license terms contained in, the Revised
41 BSD License set forth in Section 4.c of the IETF Trust's
42 Legal Provisions Relating to IETF Documents
43 (https://trustee.ietf.org/license-info).
44
45 This version of this YANG module is part of RFC DDDD
46 (https://www.rfc-editor.org/info/rfcDDDD); see the RFC
47 itself for full legal notices.
48
49 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
50 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
51 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
52 are to be interpreted as described in BCP 14 (RFC 2119)
53 (RFC 8174) when, and only when, they appear in all
54 capitals, as shown here.";
55
Michal Vaskocf898172024-01-15 15:04:28 +010056 revision 2023-12-28 {
romanc1d2b092023-02-02 08:58:27 +010057 description
58 "Initial version";
59 reference
60 "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
61 }
62
63 // Features
64
65 feature tcp-server-keepalives {
66 description
67 "Per socket TCP keepalive parameters are configurable for
68 TCP servers on the server implementing this feature.";
roman7fdc84d2023-06-06 13:14:53 +020069 reference
70 "RFC 9293: Transmission Control Protocol (TCP)";
romanc1d2b092023-02-02 08:58:27 +010071 }
72
73 // Groupings
74
75 grouping tcp-server-grouping {
76 description
77 "A reusable grouping for configuring a TCP server.
78
79 Note that this grouping uses fairly typical descendant
80 node names such that a stack of 'uses' statements will
81 have name conflicts. It is intended that the consuming
82 data model will resolve the issue (e.g., by wrapping
83 the 'uses' statement in a container called
84 'tcp-server-parameters'). This model purposely does
85 not do this itself so as to provide maximum flexibility
86 to consuming models.";
87 leaf local-address {
88 type inet:ip-address;
89 mandatory true;
90 description
91 "The local IP address to listen on for incoming
92 TCP client connections. INADDR_ANY (0.0.0.0) or
93 INADDR6_ANY (0:0:0:0:0:0:0:0 a.k.a. ::) MUST be
94 used when the server is to listen on all IPv4 or
95 IPv6 addresses, respectively.";
96 }
97 leaf local-port {
98 type inet:port-number;
99 default "0";
100 description
101 "The local port number to listen on for incoming TCP
102 client connections. An invalid default value (0)
103 is used (instead of 'mandatory true') so that an
104 application level data model may 'refine' it with
105 an application specific default port number value.";
106 }
107 uses tcpcmn:tcp-common-grouping {
Michal Vaskocf898172024-01-15 15:04:28 +0100108 refine "keepalives" {
romanc1d2b092023-02-02 08:58:27 +0100109 if-feature "tcp-server-keepalives";
110 description
111 "Add an if-feature statement so that implementations
112 can choose to support TCP server keepalives.";
113 }
114 }
115 }
116}