ietf-dhcpv6-relay@2018-09-04.yang 13.3 KB
Newer Older
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
module ietf-dhcpv6-relay {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay";
  prefix "dhcpv6-relay";

  import ietf-inet-types {
    prefix inet;
  }
  import ietf-dhcpv6-options {
    prefix dhcpv6-options;
  }
  import ietf-dhcpv6-types {
    prefix dhcpv6-types;
  }
  import ietf-interfaces {
    prefix if;
  }

  organization
    "IETF DHC (Dynamic Host Configuration) Working group";

  contact
    "cuiyong@tsinghua.edu.cn
     lh.sunlinh@gmail.com
     ian.farrer@telekom.de
     sladjana.zechlin@telekom.de
     hezihao9512@gmail.com";

  description
    "This model defines a YANG data model that can be
     used to configure and manage a DHCPv6 relay.";

33 34 35 36 37
    revision 2018-09-04 {
    description "";
    reference "I-D: draft-ietf-dhc-dhcpv6-yang";
  }

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
  revision 2018-03-04 {
    description "Resolved most issues on the DHC official
    github";
    reference "I-D: draft-ietf-dhc-dhcpv6-yang";
  }

  revision 2017-12-22 {
    description
      "Resolve most issues on Ian's github.";
    reference
      "I-D: draft-ietf-dhc-dhcpv6-yang";
  }

  revision 2017-11-24 {
    description
      "First version of the separated relay specific
       YANG model.";
    reference
      "I-D: draft-ietf-dhc-dhcpv6-yang";
  }

  /*
   * Data Nodes
   */

  container relay {
    presence
      "Enables the relay";
    description
      "DHCPv6 relay portion";

    container relay-config {
      description
        "This container contains the configuration data
        of the relay.";
      container relay-attributes {
        description
          "A container describes some basic attributes of the relay
           agent including some relay agent specific options data that
           need to be configured previously.
           Such options include Remote-Id option and Subscriber-Id
           option.";
        leaf name {
          type string;
          description
            "Relay agent name";
        }
        leaf description {
          type string;
          description
            "Textual description of the relay agent";
        }
        leaf-list dest-addrs {
          type inet:ipv6-address;
          description
            "Each DHCPv6 relay agent may be configured with a list
             of destination addresses.
             This node defines such a list of IPv6 addresses that
             may include unicast addresses, multicast addresses or
             other addresses.";
        }
        list subscribers {
          key subscriber;
          description
            "Subscribers";
          leaf subscriber {
            type uint8;
            mandatory true;
            description
              "Subscriber";
          }
          leaf subscriber-id {
            type string;
            mandatory true;
            description
              "Subscriber id";
          }
        }
        list remote-host {
          key ent-num;
          description
            "Remote host";
          leaf ent-num {
            type uint32;
            mandatory true;
            description
              "Enterprise number";
          }
          leaf remote-id {
            type string;
            mandatory true;
            description
              "Remote id";
          }
        }
        uses dhcpv6-types:vendor-infor;
      }
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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
      container rsoo-option-sets {
        description
         "DHCPv6 relay agent could provide some information that would
          be useful to DHCPv6 client.
          Since relay agent cannot provide options directly to the
          client, RSOO-enabled options are defined to propose options
          for the server to send to the client.
          This container models such RSOO-enabled options.";
        reference
          "RFC6422";
        list option-set {
          key option-set-id;
          description
            "This list under the 'rsoo-option-sets' container is similar
             to the that defined in server module.
             It allows the relay to implement several sets of RSOO-enabled
             options for different interfaces.
             The list only includes the EAP Re-authentication Protocol
             (ERP) Local Domain Name DHCPv6 Option defined in RFC6440,
             since it is the only one RSOO-enabled options accepted by
             IANA so far.";
          leaf option-set-id {
            type uint32;
            description "Option sed id";
          }
          uses dhcpv6-options:relay-supplied-option-definitions;
        }
      }

      list relay-if {
        // if - This should reference an entry in ietf-interfaces
        key if-name;
        description
        "A relay agent may have several interfaces, we should provide
         a way to configure and manage parameters on the interface-level.
         A list that describes specific interfaces and their corresponding
         parameters is employed to fulfil the configfuration. Here we use
         a string called 'if-name' as the key of list.";
        leaf if-name {
          type if:interface-ref;
          mandatory true;
          description
            "Interface name";
        }
        leaf interface-id {
          type string;
          description
            "Interface id";
        }

        /*
        leaf enable {
          type boolean;
          mandatory true;
          description "whether this interface is enabled";
        }
        */

        leaf ipv6-address {
          type inet:ipv6-address;
          description
            "IPv6 address for this interface";
        }

        leaf rsoo-option-set-id {
          type leafref {
            path "/relay/relay-config/rsoo-option-sets/option-set/option-set-id";
          }
          description "Configured Relay Supplied Option set";
        }

        list next-entity {
          key dest-addr;
          description
            "This node defines a list that is used to describe the
             next hop entity of this relay distinguished by their
             addresses.";
          leaf dest-addr {
            type inet:ipv6-address;
            mandatory true;
            description
              "Destination addr";
          }
          leaf available {
            type boolean;
            mandatory true;
            description
              "Whether the next entity is available or not";
          }
          leaf multicast {
            type boolean;
            mandatory true;
            description
              "Whether the address is multicast or not";
          }
          leaf server {
            type boolean;
            mandatory true;
            description
              "Whether the next entity is a server";
          }
        }
      }
    }


    container relay-state {
      config "false";
      description
        "State data of relay";
      list relay-if {
        key if-name;
        description
        "A relay agent may have several interfaces, we should provide
         a way to configure and manage parameters on the interface-level.
         A list that describes specific interfaces and their corresponding
         parameters is employed to fulfil the configfuration. Here we use
         a string called 'if-name' as the key of list.";
        leaf if-name{
          type string;
          mandatory true;
          description
            "Interface name";
        }
        list pd-route {
          // if - need to look at if/how we model these. If they are
          // going to be modelled, then they should be ro state
          // entries (we're not trying to configure routes here)
          key pd-route-id;
          description "pd route";
          leaf pd-route-id {
            type uint8;
            mandatory true;
            description
              "PD route id";
          }
          leaf requesting-router-id {
            type uint32;
            mandatory true;
            description
              "Requesting router id";
          }
          leaf delegating-router-id {
            type uint32;
            mandatory true;
            description
              "Delegating router id";
          }
          leaf next-router {
            type inet:ipv6-address;
            mandatory true;
            description
              "Next router";
          }
          leaf last-router {
            type inet:ipv6-address;
            mandatory true;
            description
              "Previous router";
          }
        }
        list next-entity {
          key dest-addr;
          description "This node defines a list that is used to
            describe the next hop entity of this relay agent.
            Different entities are distinguished by their
            addresses.";
          leaf dest-addr {
            type inet:ipv6-address;
            mandatory true;
            description "destination addr";
          }
          container packet-stats {
            description "packet statistics";
            leaf solicit-rvd-count {
              type uint32;
              mandatory true;
              description "solicit received counter";
            }
            leaf request-rvd-count {
              type uint32;
              mandatory true;
              description "request received counter";
            }
            leaf renew-rvd-count {
              type uint32;
              mandatory true;
              description "renew received counter";
            }
            leaf rebind-rvd-count {
              type uint32;
              mandatory true;
              description "rebind recevied counter";
            }
            leaf decline-rvd-count {
              type uint32;
              mandatory true;
              description "decline received counter";
            }
            leaf release-rvd-count {
              type uint32;
              mandatory true;
              description "release received counter";
            }
            leaf info-req-rvd-count {
              type uint32;
              mandatory true;
              description "information request counter";
            }
            leaf relay-for-rvd-count {
              type uint32;
              mandatory true;
              description "relay forward received counter";
            }
            leaf relay-rep-rvd-count {
              type uint32;
              mandatory true;
              description "relay reply received counter";
            }
            leaf packet-to-cli-count {
              type uint32;
              mandatory true;
              description "packet to client counter";
            }
            leaf adver-sent-count {
              type uint32;
              mandatory true;
              description "advertisement sent counter";
            }
            leaf confirm-sent-count {
              type uint32;
              mandatory true;
              description "confirm sent counter";
            }
            leaf reply-sent-count {
              type uint32;
              mandatory true;
              description "reply sent counter";
            }
            leaf reconfig-sent-count {
              type uint32;
              mandatory true;
              description "reconfigure sent counter";
            }
            leaf relay-for-sent-count {
              type uint32;
              mandatory true;
              description "relay forward sent counter";
            }
            leaf relay-rep-sent-count {
              type uint32;
              mandatory true;
              description "relay reply sent counter";
            }
          }
        }
      }
      container relay-stats {
        config "false";
        description
          "Relay statistics";
        leaf cli-packet-rvd-count {
          type uint32;
          mandatory true;
          description
            "Client packet received counter";
        }
        leaf relay-for-rvd-count {
          type uint32;
          mandatory true;
          description
            "Relay forward received counter";
        }
        leaf relay-rep-rvd-count {
          type uint32;
          mandatory true;
          description
            "Relay reply recevied counter";
        }
        leaf packet-to-cli-count {
          type uint32;
          mandatory true;
          description
            "Packet to client counter";
        }
        leaf relay-for-sent-count {
          type uint32;
          mandatory true;
          description
            "Relay forward sent counter";
        }
        leaf relay-rep-sent-count {
          type uint32;
          mandatory true;
          description
            "Relay reply sent counter";
        }
        leaf discarded-packet-count {
          type uint32;
          mandatory true;
          description
            "Discarded packet counter";
        }
      }
    }
  }

  /*
   * Notifications
   */

  notification notifications {
    description "DHCPv6 relay notification module";
    container dhcpv6-relay-event {
      description
        "DHCPv6 relay event";
      container topo-changed {
        description
        "Raised when the topology of the relay agent is changed.";
        leaf relay-if-name {
          type string;
          mandatory true;
          description
            "Relay interface name";
        }
        leaf first-hop {
          type boolean;
          mandatory true;
          description
            "First hop";
        }
        leaf last-entity-addr {
          type inet:ipv6-address;
          mandatory true;
          description
            "Last entity address";
        }
      }
    }
  }
}