Use version 0.6.0-SNAPSHOT of yangtools everywhere in controller.
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / opendaylight-port-types.yang
1 module opendaylight-port-types {
2     namespace "urn:opendaylight:flow:types:port";
3     prefix port-types;
4
5     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
6     import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";}
7     
8     revision "2013-09-25" {
9         description "Initial revision of Port Inventory model";
10     }
11     
12     typedef port-reason {
13         type enumeration {
14             enum add;
15             enum delete;
16             enum update;
17         }
18     }
19     
20     typedef port-config {
21         type bits {
22             bit PORT-DOWN;
23             bit NO-RECV;
24             bit NO-FWD;
25             bit NO-PACKET-IN;
26         }
27     }
28     
29     grouping port-state {
30         leaf link-down {
31             type boolean;
32         }
33         leaf blocked {
34             type boolean;
35         }   
36         leaf live {
37             type boolean;
38         }
39     }
40     
41     typedef port-features {
42         type bits {
43             bit ten-mb-hd;
44             bit ten-mb-fd;
45             bit hundred-mb-hd;
46             bit hundred-mb-fd;
47             bit one-gb-hd;
48             bit one-gb-fd;
49             bit ten-gb-fd;
50             bit forty-gb-fd;
51             bit hundred-gb-fd;
52             bit one-tb-fd;
53             bit other;
54             bit copper;
55             bit fiber;
56             bit autoeng;
57             bit pause;
58             bit pause-asym;
59         }
60     }
61     
62     grouping common-port {
63
64         leaf port-number {
65             type uint32;
66         }
67         
68         leaf hardware-address {
69             type yang:mac-address;
70             description "MAC Address of the port";
71             
72         }
73         
74         leaf configuration {
75             type port-config;
76             description "Bit map of OFPPC-* flags";          
77         }
78         
79         leaf advertised-features {
80             type port-features;
81             description "Features being advertised by the port";            
82         }
83     }
84     
85     grouping flow-port-status {
86         leaf reason {
87             type port-reason;
88         }
89         
90         uses flow-capable-port;
91     }
92     
93     grouping queues {
94         list queue {
95                 key "queue-id";
96                 uses queue-types:queue-packet;
97         }
98     }
99     
100     grouping flow-capable-port {    
101                 
102         uses common-port;
103         
104         leaf name {
105             type string;
106             description "Human readable name of the port";                    
107         }
108         
109         container state {
110             uses port-state;
111             description "Description of state of port";            
112         }
113         
114         leaf current-feature {
115             type port-features;
116             description "Bit map of OFPPF-* flags";            
117         }       
118         
119         leaf supported {
120             type port-features;
121             description "Features supported by the port";           
122         }
123         
124         leaf peer-features {
125             type port-features;
126             description "Features advertised by peer";            
127         }
128         
129         leaf current-speed {
130             type uint32;
131             units "kbps";
132             description "Current port bit rate in kbps";            
133         }
134         
135         leaf maximum-speed {
136             type uint32;
137             units "kbps";
138             description "Max port bit rate in kbps";            
139         }
140         
141         uses queues;
142     }    
143     
144     grouping port-mod {
145         container port {
146             list port {
147                 key "port-mod-order";
148                 leaf port-mod-order {
149                     type uint32;
150                 }    
151                 
152                 uses common-port;
153                 
154                 leaf mask {
155                     type port-config;
156                     description "Bitmap of OFPPC-* flags to be changed";
157                 }      
158                 
159                 leaf container-name {
160                     type string; 
161                 }
162             
163                 leaf port-name {
164                     type string; 
165                 } 
166
167                 leaf barrier {
168                     type boolean; 
169                 } 
170             }            
171         }    
172     }
173 }