Merge "Revert "BUG-2613: Migrating Openflow Specific NSF from controller project...
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / yang / nicira-action.yang
1 module nicira-action {
2     yang-version 1;
3
4     namespace "urn:opendaylight:openflowjava:nx:action";
5     prefix "nicira-action";
6
7     import openflow-action {prefix ofaction;}
8     import openflow-types {prefix oft;}
9     import yang-ext {prefix ext; revision-date "2013-07-09";}
10
11     description 
12         "Nicira openflow extensions of action.";
13
14     revision "2014-04-21" {
15         description "Initial revision";
16     }
17     
18     identity nxm-nx-reg-load {
19         base ofaction:experimenter-action-sub-type;
20     }
21     identity nxm-nx-reg-move {
22         base ofaction:experimenter-action-sub-type;
23     }
24     identity nxm-nx-output-reg {
25         base ofaction:experimenter-action-sub-type;
26     }
27     identity nxm-nx-resubmit {
28         base ofaction:experimenter-action-sub-type;
29     }
30     identity nxm-nx-multipath {
31         base ofaction:experimenter-action-sub-type;
32     }
33     identity nxm-nx-set-nsp {
34         base ofaction:experimenter-action-sub-type;
35     }
36     identity nxm-nx-set-nsi {
37         base ofaction:experimenter-action-sub-type;
38     }
39
40     grouping ofj-nx-action-reg-load-grouping {
41         container action-reg-load {
42             leaf ofs_nbits {
43                 type uint16;
44             }
45             leaf dst {
46                 type uint32;
47             }
48             leaf value {
49                 type uint64;
50             }
51         }
52     }
53     grouping ofj-nx-action-reg-move-grouping {
54         container action-reg-move {
55             leaf n_bits {
56                 type uint16;
57             }
58             leaf src_ofs {
59                 type uint16;
60             }
61             leaf dst_ofs {
62                 type uint16;
63             }
64             leaf src {
65                 type uint32;
66             }
67             leaf dst {
68                 type uint32;
69             }
70         }
71     }
72     grouping ofj-nx-action-output-reg-grouping {
73         container action-output-reg {
74             leaf n_bits {
75                 type uint16;
76             }
77             leaf src {
78                 type uint32;
79             }
80             leaf max_len {
81                 type uint16;
82             }
83         }
84     }
85
86     grouping ofj-nx-action-resubmit-grouping {
87         container action-resubmit {
88             leaf in-port {
89                 type uint16;
90                 default 0xfff8; // OFPP_INPORT
91             }
92             leaf table {
93                 type uint8 {
94                     range "0 .. 255";
95                 }
96                 default 255; // Current Table
97             }
98         }
99     }
100
101     typedef ofj-nx-hash-fields {
102         type enumeration {
103             enum NX_HASH_FIELDS_ETH_SRC {
104                 value 0;
105                 description "eth src address only";
106             }
107             enum NX_HASH_FIELDS_SYMMETRIC_L4 {
108                 value 1;
109                 description "L2 through L4 fields";
110             }
111         }
112     }
113
114     typedef ofj-nx-mp-algorithm {
115         type enumeration {
116             enum NX_MP_ALG_MODULO_N {
117                 value 0;
118             }
119             enum NX_MP_ALG_HASH_THRESHOLD {
120                 value 1;
121             }
122             enum NX_MP_ALG_HRW {
123                 value 2;
124             }
125             enum NX_MP_ALG_ITER_HASH {
126                 value 3;
127             }
128         }
129     }
130
131     grouping ofj-nx-action-multipath-grouping {
132         container action-multipath {
133             leaf fields {
134                 type ofj-nx-hash-fields;
135             }
136             leaf basis {
137                 type uint16;
138                 default 0x400;
139             }
140             leaf algorithm {
141                 type ofj-nx-mp-algorithm;
142             }
143             leaf max-link {
144                 type uint16;
145             }
146             leaf arg {
147                 type uint32;
148             }
149             leaf ofs-nbits {
150                 type uint16;
151             }
152             leaf dst {
153                 type uint32;
154             }
155         }
156     }
157
158     grouping ofj-nx-action-set-nsp-grouping {
159         container action-set-nsp {
160             leaf nsp {
161                 type uint32;
162             }
163         }
164     }
165
166     grouping ofj-nx-action-set-nsi-grouping {
167         container action-set-nsi {
168             leaf nsi {
169                 type uint8;
170             }
171         }
172     }
173
174     augment "/ofaction:actions-container/ofaction:action" {
175         ext:augment-identifier "ofj-aug-nx-action";
176         uses ofj-nx-action-reg-load-grouping;
177         uses ofj-nx-action-reg-move-grouping;
178         uses ofj-nx-action-output-reg-grouping;
179         uses ofj-nx-action-resubmit-grouping;
180         uses ofj-nx-action-multipath-grouping;
181         uses ofj-nx-action-set-nsp-grouping;
182         uses ofj-nx-action-set-nsi-grouping;
183     }
184 }