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