a16926e85bc670a1d9df35f56ebc5cf563860fb7
[controller.git] / opendaylight / md-sal / model / model-inventory / src / main / yang / OFPort.yang
1 module opendaylight-port-inventory {
2     namespace "urn:opendaylight:port:inventory";
3     prefix portInv;
4
5     import yang-ext {prefix ext;}
6     import ietf-inet-types {prefix inet;}
7     import ietf-yang-types {prefix yang;}
8     import opendaylight-inventory {prefix inv;}
9
10     revision "2013-09-25" {
11         description "Initial revision of Port Inventory model";
12     }
13
14     typedef node-connector-Id {
15         type instance-identifier;
16     }
17     
18     grouping ofp-port-config {
19         leaf port-config {
20             type enumeration {
21                 enum OFPPC_PORT_DOWN;
22                 enum OFFPC_NO_RECV;
23                 enum OFFPC_NO_FWD;
24                 enum OFPPC_NO_PACKET_IN;
25             }
26         }
27     }
28     
29     grouping ofp-port-state {
30         leaf port-state {
31             type enumeration {
32                 enum OFPPS_LINK_DOWN;
33                 enum OFPPS_BLOCKED;
34                 enum OFFPS_LIVE;
35             }
36         }
37     }
38     
39     grouping ofp-port-features {
40         leaf port-features {
41             type enumeration {
42                 enum OFPPF_10MB_HD;
43                 enum OFPPF_10MB_FD;
44                 enum OFPPF_100MB_HD;
45                 enum OFPPF_100MB_FD;
46                 enum OFPPF_1GB_HD;
47                 enum OFPPF_1GB_FD;
48                 enum OFPPF_10GB_FD;
49                 enum OFPPF_40GB_FD;
50                 enum OFPPF_100GB_FD;
51                 enum OFPPF_1TB_FD;
52                 enum OFPPF_OTHER;
53                 enum OFPPF_COPPER;
54                 enum OFPPF_FIBER;
55                 enum OFPPF_AUTOENG;
56                 enum OFPPF_PAUSE;
57                 enum OFPPF_PAUSE_ASYM;
58             }
59         }
60     }
61     
62     grouping common-port {
63         leaf port_no {
64             type node-connector-Id;
65         }
66         
67         leaf-list hw_addr {
68             type uint8;
69             description "MAC Address of the port";
70             max-elements 6;
71         }
72         
73         leaf config {
74             type uint32;
75             description "Bit map of OFPPC_* flags"            
76         }
77         
78         leaf advertised {
79             type uint32;
80             description "Features being advertised by the port"            
81         }
82     }
83     
84     grouping ofp-port {
85         key "port-order";
86         leaf port-order {
87             type uint32;
88         }      
89         
90         uses common-port;
91         
92         leaf name {
93             type string;
94             description "Human readable name of the port";
95             length 16;
96         }
97         
98         leaf state {
99             type uint32;
100             description "Bit map of OFPPS_* flags"            
101         }
102         
103         leaf curr {
104             type uint32;
105             description "Bit map of OFPPF_* flags"            
106         }       
107         
108         leaf supported {
109             type uint32;
110             description "Features supported by the port"            
111         }
112         
113         leaf peer {
114             type uint32;
115             description "Features advertised by peer"            
116         }
117         
118         leaf curr_speed {
119             type uint32;
120             description "Current port bit rate in kbps"            
121         }
122         
123         leaf max_speed {
124             type uint32;
125             description "Max port bit rate in kbps"            
126         }
127     }    
128     
129     grouping ofp-port-mod {
130         key "port-mod-order";
131         leaf port-mod-order {
132             type uint32;
133         }    
134         
135         uses group-port;
136         
137         leaf mask {
138             type uint32;
139             description "Bitmap of OFPPC_* flags to be changed"
140         }        
141     }
142 }