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