ID's are made in sync with openflow specification. Flow/Group/Table/Port/Queue/Meter...
[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     
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     typedef port-state {
30         type enumeration {
31             enum link-down;
32             enum blocked;
33             enum live;
34         }
35     }
36     
37     typedef port-features {
38         type bits {
39             bit 10mb-hd;
40             bit 10mb-fd;
41             bit 100mb-hd;
42             bit 100mb-fd;
43             bit 1gb-hd;
44             bit 1gb-fd;
45             bit 10gb-fd;
46             bit 40gb-fd;
47             bit 100gb-fd;
48             bit 1tb-fd;
49             bit other;
50             bit copper;
51             bit fiber;
52             bit autoeng;
53             bit pause;
54             bit pause-asym;
55         }
56     }
57     
58     grouping common-port {
59
60         leaf port-number {
61             type uint32;
62         }
63         
64         leaf hardware-address {
65             type yang:mac-address;
66             description "MAC Address of the port";
67             
68         }
69         
70         leaf configuration {
71             type port-config;
72             description "Bit map of OFPPC-* flags";          
73         }
74         
75         leaf advertised-features {
76             type port-features;
77             description "Features being advertised by the port";            
78         }
79     }
80     
81     grouping flow-port-status {
82         leaf reason {
83             type port-reason;
84         }
85         
86         uses flow-capable-port;
87     }
88     
89     grouping flow-capable-port {    
90                 
91         uses common-port;
92         
93         leaf name {
94             type string;
95             description "Human readable name of the port";                    
96         }
97         
98         leaf state {
99             type port-state;
100             description "Bit map of OFPPS-* flags";            
101         }
102         
103         leaf current-feature {
104             type port-features;
105             description "Bit map of OFPPF-* flags";            
106         }       
107         
108         leaf supported {
109             type port-features;
110             description "Features supported by the port";           
111         }
112         
113         leaf peer-features {
114             type port-features;
115             description "Features advertised by peer";            
116         }
117         
118         leaf current-speed {
119             type uint32;
120             units "kbps";
121             description "Current port bit rate in kbps";            
122         }
123         
124         leaf maximum-speed {
125             type uint32;
126             units "kbps";
127             description "Max port bit rate in kbps";            
128         }
129     }    
130     
131     grouping port-mod {
132         container port {
133             list port {
134                 key "port-mod-order";
135                 leaf port-mod-order {
136                     type uint32;
137                 }    
138                 
139                 uses common-port;
140                 
141                 leaf mask {
142                     type port-config;
143                     description "Bitmap of OFPPC-* flags to be changed";
144                 }      
145                 
146                 leaf container-name {
147                     type string; 
148                 }
149             
150                 leaf port-name {
151                     type string; 
152                 } 
153
154                 leaf barrier {
155                     type boolean; 
156                 } 
157             }            
158         }    
159     }
160 }