7352c01ef5ec9960e721c677007ee7859299de49
[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
34     grouping ofj-nx-action-reg-load-grouping {
35         container action-reg-load {
36             leaf ofs_nbits {
37                 type uint16;
38             }
39             leaf dst {
40                 type uint32;
41             }
42             leaf value {
43                 type uint64;
44             }
45         }
46     }
47     grouping ofj-nx-action-reg-move-grouping {
48         container action-reg-move {
49             leaf n_bits {
50                 type uint16;
51             }
52             leaf src_ofs {
53                 type uint16;
54             }
55             leaf dst_ofs {
56                 type uint16;
57             }
58             leaf src {
59                 type uint32;
60             }
61             leaf dst {
62                 type uint32;
63             }
64         }
65     }
66     grouping ofj-nx-action-output-reg-grouping {
67         container action-output-reg {
68             leaf n_bits {
69                 type uint16;
70             }
71             leaf src {
72                 type uint32;
73             }
74             leaf max_len {
75                 type uint16;
76             }
77         }
78     }
79
80     grouping ofj-nx-action-resubmit-grouping {
81         container action-resubmit {
82             leaf in-port {
83                 type uint16;
84                 default 0xfff8; // OFPP_INPORT
85             }
86             leaf table {
87                 type uint8 {
88                     range "0 .. 255";
89                 }
90                 default 255; // Current Table
91             }
92         }
93     }
94
95     typedef ofj-nx-hash-fields {
96         type enumeration {
97             enum NX_HASH_FIELDS_ETH_SRC {
98                 value 0;
99                 description "eth src address only";
100             }
101             enum NX_HASH_FIELDS_SYMMETRIC_L4 {
102                 value 1;
103                 description "L2 through L4 fields";
104             }
105         }
106     }
107
108     typedef ofj-nx-mp-algorithm {
109         type enumeration {
110             enum NX_MP_ALG_MODULO_N {
111                 value 0;
112             }
113             enum NX_MP_ALG_HASH_THRESHOLD {
114                 value 1;
115             }
116             enum NX_MP_ALG_HRW {
117                 value 2;
118             }
119             enum NX_MP_ALG_ITER_HASH {
120                 value 3;
121             }
122         }
123     }
124
125     grouping ofj-nx-action-multipath-grouping {
126         container action-multipath {
127             leaf fields {
128                 type ofj-nx-hash-fields;
129             }
130             leaf basis {
131                 type uint16;
132                 default 0x400;
133             }
134             leaf algorithm {
135                 type ofj-nx-mp-algorithm;
136             }
137             leaf max-link {
138                 type uint16;
139             }
140             leaf arg {
141                 type uint32;
142             }
143             leaf ofs-nbits {
144                 type uint16;
145             }
146             leaf dst {
147                 type uint32;
148             }
149         }
150     }
151
152     augment "/ofaction:actions-container/ofaction:action" {
153         ext:augment-identifier "ofj-aug-nx-action";
154         uses ofj-nx-action-reg-load-grouping;
155         uses ofj-nx-action-reg-move-grouping;
156         uses ofj-nx-action-output-reg-grouping;
157         uses ofj-nx-action-resubmit-grouping;
158         uses ofj-nx-action-multipath-grouping;
159     }
160 }