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