Update draft-ietf-client-server models
[netconf.git] / transport / transport-tcp / src / main / yang / ietf-tcp-server@2023-04-17.yang
1 module 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>";
30   description
31     "This module defines reusable groupings for TCP servers that
32      can be used as a basis for specific TCP server instances.
33
34      Copyright (c) 2023 IETF Trust and the persons identified
35      as authors of the code. All rights reserved.
36
37      Redistribution and use in source and binary forms, with
38      or without modification, is permitted pursuant to, and
39      subject to the license terms contained in, the Revised
40      BSD License set forth in Section 4.c of the IETF Trust's
41      Legal Provisions Relating to IETF Documents
42      (https://trustee.ietf.org/license-info).
43
44      This version of this YANG module is part of RFC DDDD
45      (https://www.rfc-editor.org/info/rfcDDDD); see the RFC
46      itself for full legal notices.
47
48      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
49      'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
50      'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
51      are to be interpreted as described in BCP 14 (RFC 2119)
52      (RFC 8174) when, and only when, they appear in all
53      capitals, as shown here.";
54
55   revision 2023-04-17 {
56     description
57       "Initial version";
58     reference
59       "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
60   }
61
62   // Features
63
64   feature tcp-server-keepalives {
65     description
66       "Per socket TCP keepalive parameters are configurable for
67        TCP servers on the server implementing this feature.";
68     reference
69       "RFC 9293: Transmission Control Protocol (TCP)";
70   }
71
72   // Groupings
73
74   grouping tcp-server-grouping {
75     description
76       "A reusable grouping for configuring a TCP server.
77
78        Note that this grouping uses fairly typical descendant
79        node names such that a stack of 'uses' statements will
80        have name conflicts.  It is intended that the consuming
81        data model will resolve the issue (e.g., by wrapping
82        the 'uses' statement in a container called
83        'tcp-server-parameters').  This model purposely does
84        not do this itself so as to provide maximum flexibility
85        to consuming models.";
86     leaf local-address {
87       type inet:ip-address;
88       mandatory true;
89       description
90         "The local IP address to listen on for incoming
91          TCP client connections.  INADDR_ANY (0.0.0.0) or
92          INADDR6_ANY (0:0:0:0:0:0:0:0 a.k.a. ::) MUST be
93          used when the server is to listen on all IPv4 or
94          IPv6 addresses, respectively.";
95     }
96     leaf local-port {
97       type inet:port-number;
98       default "0";
99       description
100         "The local port number to listen on for incoming TCP
101          client connections.  An invalid default value (0)
102          is used (instead of 'mandatory true') so that an
103          application level data model may 'refine' it with
104          an application specific default port number value.";
105     }
106     uses tcpcmn:tcp-common-grouping {
107       augment "keepalives" {
108         if-feature "tcp-server-keepalives";
109         description
110           "Add an if-feature statement so that implementations
111            can choose to support TCP server keepalives.";
112       }
113     }
114   }
115 }