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