summaryrefslogtreecommitdiffstats
path: root/yang/frr-zebra-route-map.yang
blob: de0f64d3893df39e46f9e849d711963f2bd2d76e (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
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
module frr-zebra-route-map {
  yang-version 1.1;
  namespace "http://frrouting.org/yang/zebra-route-map";
  prefix frr-zebra-route-map;

  import ietf-inet-types {
    prefix inet;
  }

  import frr-route-map {
    prefix frr-route-map;
  }

  import frr-route-types {
    prefix frr-route-types;
  }

  organization
    "Free Range Routing";
  contact
    "FRR Users List:       <mailto:frog@lists.frrouting.org>
     FRR Development List: <mailto:dev@lists.frrouting.org>";
  description
    "This module defines zebra route map settings";

  revision 2020-01-02 {
    description
      "Initial revision";
  }

  identity ipv4-prefix-length {
    base frr-route-map:rmap-match-type;
    description
      "Match IPv4 address prefix length";
  }

  identity ipv4-next-hop-prefix-length {
    base frr-route-map:rmap-match-type;
    description
      "Match IPv4 next-hop address prefix length";
  }

  identity ipv6-prefix-length {
    base frr-route-map:rmap-match-type;
    description
      "Match IPv6 address prefix length";
  }

  identity source-instance {
    base frr-route-map:rmap-match-type;
    description
      "Match the protocol's instance number";
  }

  identity source-protocol {
    base frr-route-map:rmap-match-type;
    description
      "Match protocol via which the route was learnt";
  }

  identity src-address {
    base frr-route-map:rmap-set-type;
    description
      "Set IPv4/IPv6 source address for route";
  }

  augment "/frr-route-map:lib"
    + "/frr-route-map:route-map"
    + "/frr-route-map:entry"
    + "/frr-route-map:match-condition"
    + "/frr-route-map:rmap-match-condition"
    + "/frr-route-map:match-condition" {
    case ipv4-prefix-length {
      when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-prefix-length') or "
         + "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-next-hop-prefix-length')";
      leaf ipv4-prefix-length {
        type uint8 {
          range "0..32";
        }
      }
    }

    case ipv6-prefix-length {
      when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv6-prefix-length')";
      leaf ipv6-prefix-length {
        type uint8 {
          range "0..128";
        }
      }
    }

    case source-instance {
      when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:source-instance')";
      leaf source-instance {
        type uint8 {
          range "0..255";
        }
      }
    }

    case source-protocol {
      when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:source-protocol')";
      leaf source-protocol {
        type frr-route-types:frr-route-types;
      }
    }
  }

  augment "/frr-route-map:lib"
    + "/frr-route-map:route-map"
    + "/frr-route-map:entry"
    + "/frr-route-map:set-action"
    + "/frr-route-map:rmap-set-action"
    + "/frr-route-map:set-action" {
    case src-address {
      when "derived-from-or-self(../frr-route-map:action, 'frr-zebra-route-map:src-address')";
      choice src-address {
        description
          "Value of the source address";
        case ipv4-src-address {
          leaf ipv4-src-address {
            type inet:ipv4-address;
            mandatory true;
          }
        }

        case ipv6-src-address {
          leaf ipv6-src-address {
            type inet:ipv6-address;
            mandatory true;
          }
        }
      }
    }
  }
}