022c623afd62d598dfd3d0897db5abf21c68e056
[controller.git] / opendaylight / md-sal / model / model-flow-service / src / main / yang / packet-processing.yang
1 module packet-processing {
2     namespace "urn:opendaylight:packet:service";
3     prefix flow;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
7     import ietf-yang-types {prefix yang;revision-date "2010-09-24";} 
8     import opendaylight-l2-types {prefix types;revision-date "2013-08-27";}
9     import opendaylight-match-types {prefix match-type;revision-date "2013-10-26";}
10     import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
11     import opendaylight-action-types {prefix action-type;revision-date "2013-11-12";}
12     import opendaylight-flow-types {prefix flow-type;revision-date "2013-10-26";}
13
14     
15     revision "2013-07-09" {
16         description "";
17     }
18
19     typedef buffer-id {
20         type uint32;
21     }
22
23     typedef connection-cookie {
24         type uint32;
25     }
26
27     grouping raw-packet {
28         leaf ingress {
29                 type inv:node-connector-ref;
30         }
31         leaf payload {
32                 type binary;
33         }
34     }
35
36     grouping ethernet-packet {
37         leaf source {
38                 type yang:mac-address;
39         }
40
41         leaf destination {
42                 type yang:mac-address;
43         }
44     }
45
46     identity packet-in-reason {
47         description "Base identity for all the available packet in reason"; 
48     }
49     
50     identity no-match {
51         base packet-in-reason;
52         description "No matching flow in the classifier";
53     }
54     
55     identity send-to-controller {
56         base packet-in-reason;
57         description "Explicit instruction to send packet to controller";
58     }
59     
60     identity invalid-ttl {
61         base packet-in-reason;
62         description "Packet with invalid TTL";
63     }
64
65     notification packet-received {
66
67         leaf buffer-id {
68             type buffer-id;
69         }
70
71         leaf connection-cookie {
72                 type connection-cookie;
73         }
74         
75         leaf flow-cookie {
76             type flow-type:flow-cookie;
77         }
78         
79         leaf table-id {
80                 type table-type:table-id;
81         }
82         
83         leaf packet-in-reason {
84                 type identityref {
85                         base packet-in-reason;
86                 }
87                 }
88         
89         container match {
90                         uses match-type:match;
91         }
92         
93         uses raw-packet;
94     }
95
96     rpc transmit-packet {
97         input {
98             uses inv:node-context-ref;
99
100             leaf connection-cookie {
101                 type connection-cookie;
102             }
103             
104                 leaf egress {
105                         type inv:node-connector-ref;
106                 }
107             leaf buffer-id {
108                   type buffer-id;
109             }
110
111                 uses raw-packet;
112                 uses action-type:action-list;
113         }
114     }
115 }