summaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-igmp.yang
blob: 4668ea16771a94ce4c10bf3612c4abc239269aa0 (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
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
module openconfig-igmp {

    yang-version "1";

    // namespace
    namespace "http://openconfig.net/yang/igmp";

    prefix "oc-igmp";

    // import some basic types/interfaces
    import openconfig-igmp-types { prefix oc-igmp-types; }
    import openconfig-types { prefix "oc-types"; }
    import openconfig-acl { prefix "oc-acl"; }
    import openconfig-extensions { prefix "oc-ext"; }
    import openconfig-interfaces { prefix oc-if; }
    import ietf-inet-types { prefix "inet"; }

    // meta
    organization
      "OpenConfig working group";

    contact
      "OpenConfig working group
      www.openconfig.net";

    description
      "An OpenConfig model for Internet Group Management Protocol (IGMP).";

    oc-ext:openconfig-version "0.1.0";

    revision "2018-02-19" {
        description
          "Initial revision.";
        reference "0.1.0";
    }

    grouping admin-config {
        description
          "Re-usable grouping to enable or disable a particular feature.";

        leaf enabled {
            type boolean;
            default false;
            description
              "When set to true, the functionality within which this
              leaf is defined is enabled, when set to false it is
              explicitly disabled.";
        }
    }

    grouping igmp-interface-config {
        description
          "Configuration data for IGMP on each interface.";

        leaf interface-id {
            type oc-if:interface-id;
            description
              "Reference to an interface on which IGMP is enabled.";
        }

        uses admin-config;

        leaf version {
            type oc-igmp-types:igmp-version;
            description
              "IGMP Version.";
        }

        leaf query-interval {
            type oc-igmp-types:igmp-interval-type;
            description
              "Interval at which the router sends the IGMP membership
              queries.";
        }

        leaf filter-prefixes {
            type string;
            // TODO work out what this should be.
            // On Juniper it's a "policy" and on Cisco a sort of "class map"
            description
              "List used to filter joins.";
        }
    }

    grouping igmp-counters-per-version {
        description
          "Counters for each IGMP protocol version.";

        container state {
            config false;
            description
              "Counters for each IGMP protocol version.";

            leaf v1 {
                type uint32;
                description
                  "IGMP v1.";
            }
            leaf v2 {
                type uint32;
                description
                  "IGMP v2.";
            }
            leaf v3 {
                type uint32;
                description
                  "IGMP v3.";
            }
        }
    }

    grouping igmp-interface-counters {
        description
          "State and session data for IGMP on each interface.";


        container counters {
            description
              "Counters avaiable on a per interface bases for IGMP.";

            container queries {
                description
                  "IGMP membership queries.";

                container sent {
                    description
                      "Number of IGMP membership queries sent.";
                    uses igmp-counters-per-version;
                }

                container received {
                    description
                      "Number of IGMP membership queries received.";
                    uses igmp-counters-per-version;
                }
            }

            container reports {
                description
                  "Number of IGMP membership reports received.";
                uses igmp-counters-per-version;
            }
        }
    }

    grouping igmp-snooping-state {
        description
          "IGMP membership snooping state.";

        leaf group {
            type inet:ipv4-address;
            description
              "Multicast address.";
        }

        leaf source {
            type inet:ipv4-address;
            description
              "Source address of multicast.";
        }

        leaf reporter {
            type inet:ipv4-address;
            description
              "Address of the last reporter.";
        }
    }

    grouping igmp-snooping-structural {
        description
          "IGMP membership information determined through snooping.";

        container membership-groups {
            description
              "List of IGMP Membership information.";

            list group {
                key "group";
                config false;
                description
                  "Multicast group membership.";

                leaf group {
                    type leafref {
                        path "../state/group";
                    }
                    description
                      "Multicast address.";
                }

                container state {
                    config false;
                    description
                      "Multicast group membership.";

                    uses igmp-snooping-state;
                }
            }
        }
    }

    grouping igmp-interface-state {
        description
          "IGMP interface state.";

        leaf query-expires {
            type oc-types:timeticks64;
            description
              "This timestamp indicates the time that the next query is sent.
              The value is the timestamp in seconds relative to
              the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
        }
    }

    grouping igmp-interface-top {
        description
          "Configuration and state data for IGMP on each interface.";

        container interfaces {
            description
              "The interfaces on which IGMP is configured.";

            list interface {
                key "interface-id";
                description
                  "This container defines interface IGMP configuration and
                  state information.";

                leaf interface-id {
                    type leafref {
                        path "../config/interface-id";
                    }
                    description
                      "Reference to an interface on which IGMP is enabled.";
                }

                container config {
                    description
                      "IGMP interface configuration.";

                    uses igmp-interface-config;
                }

                container state {
                    config false;
                    description
                      "This container defines state information for IGMP
                      interfaces.";

                    uses igmp-interface-state;
                    uses igmp-interface-config;
                }

                uses igmp-interface-counters;
                uses igmp-snooping-structural;
                uses oc-if:interface-ref;
            }
        }
    }

    grouping igmp-ssm-maps-config {
        description
          "A Source Specific Multicast (SSM) mapping. This allows
          IGMP v2 hosts to be able to join in SSM environments
          by translating IGMP v2 reports into IGMP v3 reports.
          The request in an IGMP v2 join is sent toward the source
          address found by matching the multicast address.";

        leaf source {
            type inet:ipv4-address;
            description
              "Multicast source address.";
        }

        leaf ssm-ranges {
            type leafref {
                path "/oc-acl:acl/oc-acl:acl-sets/oc-acl:acl-set/" +
                    "oc-acl:config/oc-acl:name";
            }
            description
              "List of accepted source specific multicast (SSM) address
              ranges.";
        }
    }

    grouping igmp-global-config {
        description
          "This grouping defines global config options for IGMP.";

    }

    grouping igmp-global-top {
        description
          "Top level grouping for global IGMP configuration.";

        container ssm {
            description
              "Source specific multicast (SSM).";

            container mappings {
                description
                  "A list of source specific multicast (SSM) mappings.";

                list mapping {
                    key "source";
                    description
                      "A Source Specific Multicast (SSM) mapping. This allows
                      IGMP v2 hosts to be able to join in SSM environments
                      by translating IGMP v2 reports into IGMP v3 reports.
                      The request in an IGMP v2 join is sent toward the source
                      address found by matching the multicast address.";

                    leaf source {
                        type leafref {
                            path "../config/source";
                        }
                        description
                          "Multicast source address.";
                    }

                    container config {
                        description
                          "Configuration for SSM maps.";
                        uses igmp-ssm-maps-config;
                    }
                    container state {
                        config false;
                        description
                          "State for SSM maps.";
                        uses igmp-ssm-maps-config;
                    }
                }
            }
        }
    }

    grouping igmp-top {
        description
          "Top-level grouping for IGMP.";

        container igmp {
            description
              "Top-level IGMP configuration and operational state.";

            container global {
                description
                  "Global IGMP configuration and operational state.";
                uses igmp-global-top;
            }

            uses igmp-interface-top;
        }
    }

    // data definition statements
}