bb43ed402485cf40d59a8ff7ba16441004186d68
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-action.yang
1 module openflow-action {
2     namespace "urn:opendaylight:openflow:common:action";
3     prefix "ofaction";
4
5     import openflow-types { prefix oft; }
6
7     revision "2013-07-31" {
8         description "Initial model";
9     }
10
11     identity output {
12         description " Output to switch port. ";
13         base oft:action;
14     }
15     identity copy_ttl_out {
16         description " Copy TTL \"outwards\" -- from next-to-outermost to outermost ";
17         base oft:action;
18     }
19     identity copy_ttl_in {
20         description " Copy TTL \"inwards\" -- from outermost to next-to-outermost ";
21         base oft:action;
22     }
23     identity set_mpls_ttl {
24         description " MPLS TTL ";
25         base oft:action;
26     }
27     identity dec_mpls_ttl {
28         description " Decrement MPLS TTL ";
29         base oft:action;
30     }
31     identity push_vlan {
32         description " Push a new VLAN tag ";
33         base oft:action;
34     }
35     identity pop_vlan {
36         description " Pop the outer VLAN tag ";
37         base oft:action;
38     }
39     identity push_mpls {
40         description " Push a new MPLS tag ";
41         base oft:action;
42     }
43     identity pop_mpls {
44         description " Pop the outer MPLS tag ";
45         base oft:action;
46     }
47     identity set_queue {
48         description " Set queue id when outputting to a port ";
49         base oft:action;
50     }
51     identity group {
52         description " Apply group. ";
53         base oft:action;
54     }
55     identity set_nw_ttl {
56         description " IP TTL. ";
57         base oft:action;
58     }
59     identity dec_nw_ttl {
60         description " Decrement IP TTL. ";
61         base oft:action;
62     }
63     identity set_field {
64         description " Set a header field using OXM TLV format. ";
65         base oft:action;
66     }
67     identity push_pbb {
68         description " Push a new PBB service tag (I-TAG) ";
69         base oft:action;
70     }
71     identity pop_pbb {
72         description " Pop the outer PBB service tag (I-TAG) ";
73         base oft:action;
74     }
75     identity experimenter {
76         description "";
77         base oft:action;
78     }
79     
80     grouping output {
81         description 
82             "Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
83             When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
84             number of bytes to send. A 'max_len' of zero means no bytes of the
85             packet should be sent. A 'max_len' of OFPCML_NO_BUFFER means that
86             the packet is not buffered and the complete packet is to be sent to
87             the controller.";
88         leaf port {
89             type oft:any-port-number;
90         }
91         leaf max-length {
92             description "Maximum packet length to be send to controller.";
93             type union {
94                 type uint16 {
95                     range "0..65294"; // 0..0xff0e
96                 }
97                 type enumeration {
98                     enum no-buffer {
99                         description 
100                             "indicates that no buffering should be
101                              applied and the whole packet is to be
102                              sent to the controller";
103                         value 65535; //0xffff
104                     }
105                 }
106             }
107         }
108     }
109
110     grouping group {
111         leaf group {
112             type oft:group-id; // define action group-id type;
113         }
114     }
115
116     grouping set-queue {
117         leaf queue {
118             type oft:queue-id;
119         }
120     }
121
122     grouping set-mpls-ttl {
123         leaf mpls_ttl {
124             type uint8;
125         }
126     }
127
128     grouping set-nw-ttl {
129         leaf nw_ttl {
130             type uint8;
131         }
132     }
133
134     grouping push-pbb {
135         leaf ethertype {
136             type oft:ether-type;
137         }
138     }
139
140     grouping push-mpls {
141         leaf ethertype {
142             type oft:ether-type;
143         }
144     }
145
146     grouping push-vlan {
147         leaf ethertype {
148             type oft:ether-type;
149         }
150     }
151
152     grouping pop-mpls {
153         leaf ethertype {
154             type oft:ether-type;
155         }
156     }
157
158     grouping set-field {
159         container field {
160             // TODO: figure definition
161         }
162     }
163     
164     
165     grouping action-header {
166         leaf type {
167             type identityref {
168                 base oft:action;
169             }
170         }
171         choice action-type {
172             case output {
173                 uses output;
174             }
175         }
176     }
177     
178 }