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