+module opendaylight-port-types {
+ namespace "urn:opendaylight:flow:types:port";
+ prefix port-types;
+
+ import yang-ext {prefix ext;}
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+
+ revision "2013-09-25" {
+ description "Initial revision of Port Inventory model";
+ }
+
+
+ typedef port-config {
+ type bits {
+ bit PORT-DOWN;
+ bit NO-RECV;
+ bit NO-FWD;
+ bit NO-PACKET-IN;
+ }
+ }
+
+ typedef port-state {
+ type enumeration {
+ enum LINK-DOWN;
+ enum BLOCKED;
+ enum LIVE;
+ }
+ }
+
+
+ typedef port-features {
+ type bits {
+ bit 10mb-hd;
+ bit 10mb-fd;
+ bit 100mb-hd;
+ bit 100mb-fd;
+ bit 1gb-hd;
+ bit 1gb-fd;
+ bit 10gb-fd;
+ bit 40gb-fd;
+ bit 100gb-fd;
+ bit 1tb-fd;
+ bit other;
+ bit copper;
+ bit fiber;
+ bit autoeng;
+ bit pause;
+ bit pause-asym;
+ }
+ }
+
+ grouping common-port {
+
+ leaf port-number {
+ type uint32;
+ }
+
+ leaf hardware-address {
+ type yang:mac-address;
+ description "MAC Address of the port";
+
+ }
+
+ leaf configuration {
+ type port-config;
+ description "Bit map of OFPPC-* flags";
+ }
+
+ leaf advertised-features {
+ type port-features;
+ description "Features being advertised by the port";
+ }
+ }
+
+ grouping flow-capable-port {
+
+ uses common-port;
+
+ leaf name {
+ type string;
+ description "Human readable name of the port";
+ }
+
+ leaf state {
+ type port-state;
+ description "Bit map of OFPPS-* flags";
+ }
+
+ leaf current-feature {
+ type port-features;
+ description "Bit map of OFPPF-* flags";
+ }
+
+ leaf supported {
+ type port-features;
+ description "Features supported by the port";
+ }
+
+ leaf peer-features {
+ type port-features;
+ description "Features advertised by peer";
+ }
+
+ leaf current-speed {
+ type uint32;
+ units "kbps";
+ description "Current port bit rate in kbps";
+ }
+
+ leaf maximum-speed {
+ type uint32;
+ units "kbps";
+ description "Max port bit rate in kbps";
+ }
+ }
+
+ grouping ofp-port-mod {
+ container port {
+ list port {
+ key "port-mod-order";
+ leaf port-mod-order {
+ type uint32;
+ }
+
+ uses common-port;
+
+ leaf mask {
+ type uint32;
+ description "Bitmap of OFPPC-* flags to be changed";
+ }
+ }
+ }
+ }
+}
\ No newline at end of file