134b0190b10bdba1f805d4d56ebcaf17077a2ce6
[openflowplugin.git] / 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     typedef port-number-uni {
63         type union {
64             type uint32;
65             type string;
66         }
67     }
68     
69     grouping common-port {
70
71         leaf port-number {
72             type port-number-uni;
73         }
74         
75         leaf hardware-address {
76             type yang:mac-address;
77             description "MAC Address of the port";
78             
79         }
80         
81         leaf configuration {
82             type port-config;
83             description "Bit map of OFPPC-* flags";          
84         }
85         
86         leaf advertised-features {
87             type port-features;
88             description "Features being advertised by the port";            
89         }
90     }
91     
92     grouping flow-port-status {
93         leaf reason {
94             type port-reason;
95         }
96         
97         uses flow-capable-port;
98     }
99     
100     grouping queues {
101         list queue {
102                 key "queue-id";
103                 uses queue-types:queue-packet;
104         }
105     }
106     
107     grouping flow-capable-port {    
108                 
109         uses common-port;
110         
111         leaf name {
112             type string;
113             description "Human readable name of the port";                    
114         }
115         
116         container state {
117             uses port-state;
118             description "Description of state of port";            
119         }
120         
121         leaf current-feature {
122             type port-features;
123             description "Bit map of OFPPF-* flags";            
124         }       
125         
126         leaf supported {
127             type port-features;
128             description "Features supported by the port";           
129         }
130         
131         leaf peer-features {
132             type port-features;
133             description "Features advertised by peer";            
134         }
135         
136         leaf current-speed {
137             type uint32;
138             units "kbps";
139             description "Current port bit rate in kbps";            
140         }
141         
142         leaf maximum-speed {
143             type uint32;
144             units "kbps";
145             description "Max port bit rate in kbps";            
146         }
147         
148         uses queues;
149     }    
150     
151     grouping port-mod {
152         container port {
153             list port {
154                 key "port-mod-order";
155                 leaf port-mod-order {
156                     type uint32;
157                 }    
158                 
159                 uses common-port;
160                 
161                 leaf mask {
162                     type port-config;
163                     description "Bitmap of OFPPC-* flags to be changed";
164                 }      
165                 
166                 leaf container-name {
167                     type string; 
168                 }
169             
170                 leaf port-name {
171                     type string; 
172                 } 
173
174                 leaf barrier {
175                     type boolean; 
176                 } 
177             }            
178         }    
179     }
180 }