af7c4dff531998dc150976f7c527e2258975e21f
[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 yang-ext {prefix ext;}
6     import ietf-inet-types {prefix inet;}
7     import ietf-yang-types {prefix yang;}
8     
9     revision "2013-09-25" {
10         description "Initial revision of Port Inventory model";
11     }
12
13     
14     typedef port-config {
15         type bits {
16             bit PORT-DOWN;
17             bit NO-RECV;
18             bit NO-FWD;
19             bit NO-PACKET-IN;
20         }
21     }
22     
23     typedef port-state {
24             type enumeration {
25                 enum LINK-DOWN;
26                 enum BLOCKED;
27                 enum LIVE;
28         }
29     }
30
31     
32     typedef port-features {
33         type bits {
34             bit 10mb-hd;
35             bit 10mb-fd;
36             bit 100mb-hd;
37             bit 100mb-fd;
38             bit 1gb-hd;
39             bit 1gb-fd;
40             bit 10gb-fd;
41             bit 40gb-fd;
42             bit 100gb-fd;
43             bit 1tb-fd;
44             bit other;
45             bit copper;
46             bit fiber;
47             bit autoeng;
48             bit pause;
49             bit pause-asym;
50         }
51     }
52     
53     grouping common-port {
54
55         leaf port-number {
56             type uint32;
57         }
58         
59         leaf hardware-address {
60             type yang:mac-address;
61             description "MAC Address of the port";
62             
63         }
64         
65         leaf configuration {
66             type port-config;
67             description "Bit map of OFPPC-* flags";          
68         }
69         
70         leaf advertised-features {
71             type port-features;
72             description "Features being advertised by the port";            
73         }
74     }
75     
76     grouping flow-capable-port {    
77                 
78         uses common-port;
79         
80         leaf name {
81             type string;
82             description "Human readable name of the port";                    
83         }
84         
85         leaf state {
86             type port-state;
87             description "Bit map of OFPPS-* flags";            
88         }
89         
90         leaf current-feature {
91             type port-features;
92             description "Bit map of OFPPF-* flags";            
93         }       
94         
95         leaf supported {
96             type port-features;
97             description "Features supported by the port";           
98         }
99         
100         leaf peer-features {
101             type port-features;
102             description "Features advertised by peer";            
103         }
104         
105         leaf current-speed {
106             type uint32;
107             units "kbps";
108             description "Current port bit rate in kbps";            
109         }
110         
111         leaf maximum-speed {
112             type uint32;
113             units "kbps";
114             description "Max port bit rate in kbps";            
115         }
116     }    
117     
118     grouping ofp-port-mod {
119         container port {
120             list port {
121                 key "port-mod-order";
122                 leaf port-mod-order {
123                     type uint32;
124                 }    
125                 
126                 uses common-port;
127                 
128                 leaf mask {
129                     type uint32;
130                     description "Bitmap of OFPPC-* flags to be changed";
131                 }       
132             }
133         }    
134     }
135 }