summaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-if-tunnel.yang
blob: 4efff640c857e2bf7150f5573b380a2e6cb8b76b (plain)
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
module openconfig-if-tunnel {
  yang-version "1";

  namespace "http://openconfig.net/yang/interfaces/tunnel";

  prefix "oc-tun";

  import openconfig-interfaces { prefix oc-if; }
  import openconfig-extensions { prefix oc-ext; }
  import openconfig-inet-types { prefix oc-inet; }
  import openconfig-if-ip { prefix oc-ip; }

  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This model adds extensions to the OpenConfig interfaces
    model to configure tunnel interfaces on a network
    device.";

  oc-ext:openconfig-version "0.1.0";

  revision "2018-01-05" {
    description
      "Initial tunnel model";
    reference "0.1.0";
  }

  grouping tunnel-top {
    description
      "Top-level grouping for parameters related to
      a tunnel interface.";

    container tunnel {
      description
        "In the case that the interface is logical tunnel
        interface, the parameters for the tunnel are
        specified within this subtree. Tunnel interfaces
        have only a single logical subinterface associated
        with them.";

      container config {
        description
          "Configuration parameters associated with the
          tunnel interface";
        uses tunnel-config;
      }

      container state {
        config false;
        description
          "Operational state parameters associated with
          the tunnel interface.";
        uses tunnel-config;
      }

      uses oc-ip:ipv4-top;
      uses oc-ip:ipv6-top;
    }
  }

  grouping tunnel-config {
    description
      "Configuraton parameters relating to a tunnel
      interface.";

    leaf src {
      type oc-inet:ip-address;
      description
        "The source address that should be used for the
        tunnel.";
    }

    leaf dst {
      type oc-inet:ip-address;
      description
        "The destination address for the tunnel.";
    }

    leaf ttl {
      type uint8 {
        range "1..255";
      }
      description
        "The time-to-live (or hop limit) that should be utilised
        for the IP packets used for the tunnel transport.";
    }

    leaf gre-key {
      type uint32;
      description
        "The GRE key to be specified for the tunnel. The
        key is used to identify a traffic flow within
        a tunnel.";
      reference
        "RFC2890: Key and Sequence Number Extensions to GRE";
    }
  }

  augment "/oc-if:interfaces/oc-if:interface" {
    description
      "Augment to add tunnel configuration to interfaces";
    uses tunnel-top;
  }
}