f3db3181f7935665a8731d5bb76119aac5036df4
[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
13     
14     revision "2013-07-09" {
15         description "";
16     }
17
18     typedef cookie {
19         type uint32;
20     }
21
22     grouping raw-packet {
23         leaf ingress {
24                 type inv:node-connector-ref;
25         }
26         leaf payload {
27                 type binary;
28         }
29     }
30
31     grouping ethernet-packet {
32         leaf source {
33                 type yang:mac-address;
34         }
35
36         leaf destination {
37                 type yang:mac-address;
38         }
39     }
40
41     identity packet-in-reason {
42         description "Base identity for all the available packet in reason"; 
43     }
44     
45     identity no-match {
46         base packet-in-reason;
47         description "No matching flow in the classifier";
48     }
49     
50     identity send-to-controller {
51         base packet-in-reason;
52         description "Explicit instruction to send packet to controller";
53     }
54     
55     identity invalid-ttl {
56         base packet-in-reason;
57         description "Packet with invalid TTL";
58     }
59
60     notification packet-received {
61         leaf cookie {
62                 type cookie;
63         }
64         
65         leaf table-id {
66                 type table-type:table-id;
67         }
68         
69         leaf packet-in-reason {
70                 type identityref {
71                         base packet-in-reason;
72                 }
73                 }
74         
75         container match {
76                         uses match-type:match;
77         }
78         
79         uses raw-packet;
80     }
81
82     rpc transmit-packet {
83         input {
84             uses inv:node-context-ref;
85
86             leaf cookie {
87                 type cookie;
88             }
89             
90                 leaf egress {
91                         type inv:node-connector-ref;
92                 }
93                 leaf buffer-id {
94                   type uint32;
95             }
96
97                 uses raw-packet;
98                 uses action-type:action-list;
99         }
100     }
101 }