summaryrefslogtreecommitdiffstats
path: root/acl/acl-api/src/main/yang/ietf-packet-fields.yang
blob: 0b1ce5cddc8d938b2b8bf42e291f871d5a3ab1f8 (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
module ietf-packet-fields {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields";
  prefix packet-fields;
  import ietf-inet-types {
    prefix inet;
  }
  import ietf-yang-types {
    prefix yang;
  }
  organization "IETF NETMOD (NETCONF Data Modeling Language) Working 
                Group";
  contact
    "WG Web: http://tools.ietf.org/wg/netmod/
    WG List: netmod@ietf.org
    WG Chair: Juergen Schoenwaelder
    j.schoenwaelder@jacobs-university.de
    WG Chair: Tom Nadeau
    tnadeau@lucidvision.com
    Editor: Dean Bogdanovic
    deanb@juniper.net
    Editor: Kiran Agrahara Sreenivasa
    kkoushik@cisco.com
    Editor: Lisa Huang
    lyihuang16@gmail.com
    Editor: Dana Blair
    dblair@cisco.com";
  description
    "This YANG module defines groupings that are used by 
    ietf-access-control-list YANG module. Their usage is not 
    limited to ietf-access-control-list and can be
    used anywhere as applicable.
    Copyright (c) 2015 IETF Trust and the persons identified as
    the document authors.  All rights reserved.
    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject
    to the license terms contained in, the Simplified BSD
    License set forth in Section 4.c of the IETF Trust's Legal
    Provisions Relating to IETF Documents
    (http://trustee.ietf.org/license-info).
    This version of this YANG module is part of RFC XXXX; see
    the RFC itself for full legal notices.";
  revision 2016-07-08 {
    description
      "Initial version of packet fields used by
      ietf-access-control-list";
    reference
      "RFC XXXX: Network Access Control List (ACL)
      YANG Data  Model";
  }
  grouping acl-transport-header-fields {
    description
      "Transport header fields";
    container source-port-range {
      presence "Enables setting source port range";
      description 
        "Inclusive range representing source ports to be used.
        When only lower-port is present, it represents a single port.";
      leaf lower-port {
        type inet:port-number;
        mandatory true;
        description
          "Lower boundary for port.";
      }
      leaf upper-port {
        type inet:port-number;
        must ". >= ../lower-port" {
          error-message
          "The upper-port must be greater than or equal to lower-port";
        }
        description
          "Upper boundary for port . If existing, the upper port
          must be greater or equal to lower-port.";
      }
    }
    container destination-port-range {
      presence "Enables setting destination port range";
      description
        "Inclusive range representing destination ports to be used. When 
	only lower-port is present, it represents a single port.";
      leaf lower-port {
        type inet:port-number;
        mandatory true;
        description
          "Lower boundary for port.";
      }
      leaf upper-port {
        type inet:port-number;
        must ". >= ../lower-port" {
          error-message
            "The upper-port must be greater than or equal to lower-port";
        }

        description
          "Upper boundary for port. If existing, the upper port must
          be greater or equal to lower-port";
      }
    }
  }
  grouping acl-ip-header-fields {
    description
      "IP header fields common to ipv4 and ipv6";
    leaf dscp {
      type inet:dscp;
      description
        "Value of dscp.";
    }
    leaf protocol {
      type uint8;
      description
        "Internet Protocol number.";
    }
    uses acl-transport-header-fields;
  }
  grouping acl-ipv4-header-fields {
    description
      "Fields in IPv4 header.";
    leaf destination-ipv4-network {
      type inet:ipv4-prefix;
      description
        "Destination IPv4 address prefix.";
    }
    leaf source-ipv4-network {
      type inet:ipv4-prefix;
      description
        "Source IPv4 address prefix.";
    }
  }
  grouping acl-ipv6-header-fields {
    description
      "Fields in IPv6 header";
    leaf destination-ipv6-network {
      type inet:ipv6-prefix;
      description
        "Destination IPv6 address prefix.";
    }
    leaf source-ipv6-network {
      type inet:ipv6-prefix;
      description
        "Source IPv6 address prefix.";
    }
    leaf flow-label {
      type inet:ipv6-flow-label;
      description
        "IPv6 Flow label.";
    }
    reference
      "RFC 4291: IP Version 6 Addressing Architecture
      RFC 4007: IPv6 Scoped Address Architecture
      RFC 5952: A Recommendation for IPv6 Address Text Representation";
  }
  grouping acl-eth-header-fields {
    description
      "Fields in Ethernet header.";
    leaf destination-mac-address {
      type yang:mac-address;
      description
        "Destination IEEE 802 MAC address.";
    }
    leaf destination-mac-address-mask {
      type yang:mac-address;
      description
        "Destination IEEE 802 MAC address mask.";
    }
    leaf source-mac-address {
      type yang:mac-address;
      description
        "Source IEEE 802 MAC address.";
    }
    leaf source-mac-address-mask {
      type yang:mac-address;
      description
        "Source IEEE 802 MAC address mask.";
    }
    reference
      "IEEE 802: IEEE Standard for Local and Metropolitan Area
      Networks: Overview and Architecture.";
  }

}