b3690a23eb90e56682323a7846afa9d861357911
[openflowplugin.git] / 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 opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
6     import ietf-yang-types {prefix yang;revision-date "2013-07-15";}
7     import opendaylight-match-types {prefix match-type;revision-date "2013-10-26";}
8     import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
9     import opendaylight-action-types {prefix action-type;revision-date "2013-11-12";}
10     import opendaylight-flow-types {prefix flow-type;revision-date "2013-10-26";}
11     import openflow-protocol { prefix ofproto; revision-date "2013-07-31"; }
12
13     description "Packet processing - sending and receiving.";
14
15     revision "2013-07-09" {
16         description "Initial.";
17     }
18
19     typedef connection-cookie {
20         description "Openflow connection identifier. Outgoing packets should use the same connection they came in.";
21         type uint32;
22     }
23
24     grouping raw-packet {
25         description "Basic packet structure.";
26         leaf ingress {
27             type inv:node-connector-ref;
28         }
29         leaf payload {
30             type binary;
31         }
32     }
33
34     grouping packet-in {
35         leaf connection-cookie {
36             type connection-cookie;
37         }
38
39         leaf flow-cookie {
40             type flow-type:flow-cookie;
41         }
42
43         leaf table-id {
44             type table-type:table-id;
45         }
46
47         leaf packet-in-reason {
48             type identityref {
49                 base packet-in-reason;
50             }
51         }
52
53         uses raw-packet;
54     }
55
56     grouping ethernet-packet {
57         description "Ethernet packet headers structure.";
58         leaf source {
59             type yang:mac-address;
60         }
61
62         leaf destination {
63             type yang:mac-address;
64         }
65     }
66
67     identity packet-in-reason {
68         description "Base identity for all the available packet in reasons.";
69     }
70
71     identity no-match {
72         base packet-in-reason;
73         description "No matching flow in the classifier";
74     }
75
76     identity send-to-controller {
77         base packet-in-reason;
78         description "Explicit instruction to send packet to controller";
79     }
80
81     identity invalid-ttl {
82         base packet-in-reason;
83         description "Packet with invalid TTL";
84     }
85
86     notification packet-received {
87         description "Delivery of incoming packet wrapped in openflow structure.";
88         uses packet-in;
89
90         container match {
91             uses match-type:match;
92         }
93     }
94
95     rpc transmit-packet {
96         description "Sending packet out through openflow device.";
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 uint32;
109             }
110
111             uses raw-packet;
112             uses action-type:action-list;
113         }
114     }
115
116     container packet-in-message {
117         uses packet-in;
118         uses ofproto:ofHeader;
119
120         container match {
121             uses match-type:match;
122         }
123     }
124 }