added content of grouping in of-protocol 90/1090/2
authorMichal Rehak <mirehak@cisco.com>
Wed, 4 Sep 2013 09:03:58 +0000 (11:03 +0200)
committerMichal Rehak <mirehak@cisco.com>
Thu, 5 Sep 2013 17:01:57 +0000 (19:01 +0200)
replaced tabs with spaces

Change-Id: Id093f4a31bf1382b6ad58dee4ca38f85714cfa0c
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflow-protocol-api/src/main/yang/openflow-action.yang
openflow-protocol-api/src/main/yang/openflow-extensible-match.yang
openflow-protocol-api/src/main/yang/openflow-instruction.yang
openflow-protocol-api/src/main/yang/openflow-protocol.yang
openflow-protocol-api/src/main/yang/openflow-types.yang

index c665a8a20d856a9e3a1563aee2aa1877c9ff8e59..a5dfcbfdd084949a92f802bf491c3c7154b4fc33 100644 (file)
 module openflow-action {
-       namespace "urn:opendaylight:openflow:common:action";
-       prefix "ofaction";
+    namespace "urn:opendaylight:openflow:common:action";
+    prefix "ofaction";
 
     import openflow-types { prefix oft; }
 
-       revision "2013-07-31" {
-               description "Initial model";
-       }
+    revision "2013-07-31" {
+        description "Initial model";
+    }
 
     /*
-       identity output {
-               description " Output to switch port. ";
-               base oft:action;
-       }
-       identity copy_ttl_out {
-               description " Copy TTL "outwards" -- from next-to-outermost to outermost ";
-               base oft:action;
-       }
-       identity copy_ttl_in {
-               description " Copy TTL "inwards" -- from outermost to next-to-outermost ";
-               base oft:action;
-       }
-       identity set_mpls_ttl {
-               description " MPLS TTL ";
-               base oft:action;
-       }
-       identity dec_mpls_ttl {
-               description " Decrement MPLS TTL ";
-               base oft:action;
-       }
-       identity push_vlan {
-               description " Push a new VLAN tag ";
-               base oft:action;
-       }
-       identity pop_vlan {
-               description " Pop the outer VLAN tag ";
-               base oft:action;
-       }
-       identity push_mpls {
-               description " Push a new MPLS tag ";
-               base oft:action;
-       }
-       identity pop_mpls {
-               description " Pop the outer MPLS tag ";
-               base oft:action;
-       }
-       identity set_queue {
-               description " Set queue id when outputting to a port ";
-               base oft:action;
-       }
-       identity group {
-               description " Apply group. ";
-               base oft:action;
-       }
-       identity set_nw_ttl {
-               description " IP TTL. ";
-               base oft:action;
-       }
-       identity dec_nw_ttl {
-               description " Decrement IP TTL. ";
-               base oft:action;
-       }
-       identity set_field {
-               description " Set a header field using OXM TLV format. ";
-               base oft:action;
-       }
-       identity push_pbb {
-               description " Push a new PBB service tag (I-TAG) ";
-               base oft:action;
-       }
-       identity pop_pbb {
-               description " Pop the outer PBB service tag (I-TAG) ";
-               base oft:action;
-       }
-       identity experimenter {
-               description "";
-               base oft:action;
-       }
+    identity output {
+        description " Output to switch port. ";
+        base oft:action;
+    }
+    identity copy_ttl_out {
+        description " Copy TTL "outwards" -- from next-to-outermost to outermost ";
+        base oft:action;
+    }
+    identity copy_ttl_in {
+        description " Copy TTL "inwards" -- from outermost to next-to-outermost ";
+        base oft:action;
+    }
+    identity set_mpls_ttl {
+        description " MPLS TTL ";
+        base oft:action;
+    }
+    identity dec_mpls_ttl {
+        description " Decrement MPLS TTL ";
+        base oft:action;
+    }
+    identity push_vlan {
+        description " Push a new VLAN tag ";
+        base oft:action;
+    }
+    identity pop_vlan {
+        description " Pop the outer VLAN tag ";
+        base oft:action;
+    }
+    identity push_mpls {
+        description " Push a new MPLS tag ";
+        base oft:action;
+    }
+    identity pop_mpls {
+        description " Pop the outer MPLS tag ";
+        base oft:action;
+    }
+    identity set_queue {
+        description " Set queue id when outputting to a port ";
+        base oft:action;
+    }
+    identity group {
+        description " Apply group. ";
+        base oft:action;
+    }
+    identity set_nw_ttl {
+        description " IP TTL. ";
+        base oft:action;
+    }
+    identity dec_nw_ttl {
+        description " Decrement IP TTL. ";
+        base oft:action;
+    }
+    identity set_field {
+        description " Set a header field using OXM TLV format. ";
+        base oft:action;
+    }
+    identity push_pbb {
+        description " Push a new PBB service tag (I-TAG) ";
+        base oft:action;
+    }
+    identity pop_pbb {
+        description " Pop the outer PBB service tag (I-TAG) ";
+        base oft:action;
+    }
+    identity experimenter {
+        description "";
+        base oft:action;
+    }
     */
-       grouping output {
-               description 
-                       "Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
-                       When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
-                       number of bytes to send. A 'max_len' of zero means no bytes of the
-                       packet should be sent. A 'max_len' of OFPCML_NO_BUFFER means that
-                       the packet is not buffered and the complete packet is to be sent to
-                       the controller.";
-               leaf port {
-                       type oft:any-port-number;
-               }
-               leaf max-length {
-                       description "Maximum packet length to be send to controller.";
-                       type union {
-                               type uint16 {
-                                       range "0..65294"; // 0..0xff0e
-                               }
-                               type enumeration {
-                                       enum no-buffer {
-                                               description 
-                                                       "indicates that no buffering should be
-                                                        applied and the whole packet is to be
-                                                        sent to the controller";
-                                               value 65535; //0xffff
-                                       }
-                               }
-                       }
-               }
-       }
+    grouping output {
+        description 
+            "Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
+            When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
+            number of bytes to send. A 'max_len' of zero means no bytes of the
+            packet should be sent. A 'max_len' of OFPCML_NO_BUFFER means that
+            the packet is not buffered and the complete packet is to be sent to
+            the controller.";
+        leaf port {
+            type oft:any-port-number;
+        }
+        leaf max-length {
+            description "Maximum packet length to be send to controller.";
+            type union {
+                type uint16 {
+                    range "0..65294"; // 0..0xff0e
+                }
+                type enumeration {
+                    enum no-buffer {
+                        description 
+                            "indicates that no buffering should be
+                             applied and the whole packet is to be
+                             sent to the controller";
+                        value 65535; //0xffff
+                    }
+                }
+            }
+        }
+    }
 
-       grouping group {
-               leaf group {
-                       type oft:group-id; // define action group-id type;
-               }
-       }
+    grouping group {
+        leaf group {
+            type oft:group-id; // define action group-id type;
+        }
+    }
 
-       grouping set_queue {
-               leaf queue {
-                       type oft:queue-id;
-               }
-       }
+    grouping set-queue {
+        leaf queue {
+            type oft:queue-id;
+        }
+    }
 
-       grouping set_mpls_ttl {
-               leaf mpls_ttl {
-                       type uint8;
-               }
-       }
+    grouping set-mpls-ttl {
+        leaf mpls_ttl {
+            type uint8;
+        }
+    }
 
-       grouping set_nw_ttl {
-               leaf nw_ttl {
-                       type uint8;
-               }
-       }
+    grouping set-nw-ttl {
+        leaf nw_ttl {
+            type uint8;
+        }
+    }
 
-       grouping push_pbb {
+    grouping push-pbb {
 
-       }
+    }
 
-       grouping push_mpls {
+    grouping push-mpls {
 
-       }
+    }
 
-       grouping push_vlan {
+    grouping push-vlan {
 
-       }
+    }
 
-       grouping pop_mpls {
-               leaf ethertype {
-                       type uint16; // TODO: define ethertype type
-               }
-       }
+    grouping pop-mpls {
+        leaf ethertype {
+            type uint16; // TODO: define ethertype type
+        }
+    }
 
-       grouping set_field {
-               container field {
-                       // TODO: figure definition
-               }
-       }
+    grouping set-field {
+        container field {
+            // TODO: figure definition
+        }
+    }
+    
+    
+    grouping action-header {
+        leaf type {
+            type action-type;
+        }
+    }
+    
+    typedef action-type {
+        /* ofp_action_type */
+        type enumeration {
+            enum OUTPUT {
+                description "Output to switch port.";
+            }
+            enum SET_VLAN_VID {
+                description "Set the 802.1q VLAN id.";
+            }
+            enum SET_VLAN_PCP {
+                description "Set the 802.1q priority.";
+            }
+            enum STRIP_VLAN {
+                description "Strip the 802.1q header.";
+            }
+            enum SET_DL_SRC {
+                description "Ethernet source address.";
+            }
+            enum SET_DL_DST {
+                description "Ethernet destination address.";
+            }
+            enum SET_NW_SRC {
+                description "IP source address.";
+            }
+            enum SET_NW_DST {
+                description "IP destination address.";
+            }
+            enum SET_TP_SRC {
+                description "TCP/UDP source port.";
+            }
+            enum SET_TP_DST {
+                description "TCP/UDP destination port.";
+            }
+            enum OFPAT_VENDOR {
+                value 65535; // 0xffff
+            }
+        }
+    }
 }
\ No newline at end of file
index 164175df9d6e0a63c617eef5e0e3a300d1a11981..9611abbc8dfad32224ea759b9d3f8c4918d344d0 100644 (file)
 module openflow-extensible-match {
-       namespace "urn:openflowopenflow:oxm";
-       prefix "oxm";
+    namespace "urn:openflowopenflow:oxm";
+    prefix "oxm";
 
 
-       
-       import ietf-yang-types {prefix yang;}
-       import ietf-inet-types {prefix inet;}
-       import openflow-types {prefix oft;}
+    
+    import ietf-yang-types {prefix yang;}
+    import ietf-inet-types {prefix inet;}
+    import openflow-types {prefix oft;}
 
 
     revision "2013-07-31" {
         description "Initial model";
     }
 
-       identity oxm-match-type {
-               description 
-                  "The OpenFlow Extensible Match type must be supported by all OpenFlow
-                       switches.";
-               base oft:match-type;
-       }
+    identity oxm-match-type {
+        description 
+           "The OpenFlow Extensible Match type must be supported by all OpenFlow
+            switches.";
+        base oft:match-type-base;
+    }
+    
 
-       // oxm classes
-               identity class {
-                       description "Base identity for OXM classes";
-               }
+    // oxm classes
+        identity class {
+            description "Base identity for OXM classes";
+        }
 
 
-               identity nxm-0-class {
-                       description "Backward compatibility with NXM";
-                       base class;
-               }
-               identity nxm-1-class {
-                       description "Backward compatibility with NXM";
-                       base class;
-               }
-               identity openflow-basic-class {
-                       description "Basic class for OpenFlow";
-                       base class;
-               }
-               identity experimenter-class {
-                       description 
-                               "Marks Experimenter match type class.
-                               All experimenter match classes MUST use this class as a base.";
-                       base class;
-               }
+        identity nxm-0-class {
+            description "Backward compatibility with NXM";
+            base class;
+        }
+        identity nxm-1-class {
+            description "Backward compatibility with NXM";
+            base class;
+        }
+        identity openflow-basic-class {
+            description "Basic class for OpenFlow";
+            base class;
+        }
+        identity experimenter-class {
+            description 
+                "Marks Experimenter match type class.
+                All experimenter match classes MUST use this class as a base.";
+            base class;
+        }
 
 
 
-       // field types
-           /*
-               identity match-field {
-                       description "Base identity for OXM Fields";
-               }
+    // field types
+        /*
+        identity match-field {
+            description "Base identity for OXM Fields";
+        }
 
-           identity in_port {
-               base match-field;
-               description "Match for Switch input port.";
-           }
-           identity in_phy_port {
-               base match-field;
-               description "Match for Switch physical input port.";
-           }
-           identity metadata {
-               base match-field;
-               description "Match for Metadata passed between tables.";
-           }
-           identity eth_dst {
-               base match-field;
-               description "Match for Ethernet destination address.";
-           }
-           identity eth_src {
-               base match-field;
-               description "Match for Ethernet source address.";
-           }
-           identity eth_type {
-               base match-field;
-               description "Match for Ethernet frame type.";
-           }
-           identity vlan_vid {
-               base match-field;
-               description "Match for VLAN id.";
-           }
-           identity vlan_pcp {
-               base match-field;
-               description "Match for VLAN priority.";
-           }
-           identity ip_dscp {
-               base match-field;
-               description "Match for IP DSCP (6 bits in ToS field).";
-           }
-           identity ip_ecn {
-               base match-field;
-               description "Match for IP ECN (2 bits in ToS field).";
-           }
-           identity ip_proto {
-               base match-field;
-               description "Match for IP protocol.";
-           }
-           identity ipv4_src {
-               base match-field;
-               description "Match for IPv4 source address.";
-           }
-           identity ipv4_dst {
-               base match-field;
-               description "Match for IPv4 destination address.";
-           }
-           identity tcp_src {
-               base match-field;
-               description "Match for TCP source port.";
-           }
-           identity tcp_dst {
-               base match-field;
-               description "Match for TCP destination port.";
-           }
-           identity udp_src {
-               base match-field;
-               description "Match for UDP source port.";
-           }
-           identity udp_dst {
-               base match-field;
-               description "Match for UDP destination port.";
-           }
-           identity sctp_src {
-               base match-field;
-               description "Match for SCTP source port.";
-           }
-           identity sctp_dst {
-               base match-field;
-               description "Match for SCTP destination port.";
-           }
-           identity icmpv4_type {
-               base match-field;
-               description "Match for ICMP type.";
-           }
-           identity icmpv4_code {
-               base match-field;
-               description "Match for ICMP code.";
-           }
-           identity arp_op {
-               base match-field;
-               description "Match for ARP opcode.";
-           }
-           identity arp_spa {
-               base match-field;
-               description "Match for ARP source IPv4 address.";
-           }
-           identity arp_tpa {
-               base match-field;
-               description "Match for ARP target IPv4 address.";
-           }
-           identity arp_sha {
-               base match-field;
-               description "Match for ARP source hardware address.";
-           }
-           identity arp_tha {
-               base match-field;
-               description "Match for ARP target hardware address.";
-           }
-           identity ipv6_src {
-               base match-field;
-               description "Match for IPv6 source address.";
-           }
-           identity ipv6_dst {
-               base match-field;
-               description "Match for IPv6 destination address.";
-           }
-           identity ipv6_flabel {
-               base match-field;
-               description "Match for IPv6 Flow Label";
-           }
-           identity icmpv6_type {
-               base match-field;
-               description "Match for ICMPv6 type.";
-           }
-           identity icmpv6_code {
-               base match-field;
-               description "Match for ICMPv6 code.";
-           }
-           identity ipv6_nd_target {
-               base match-field;
-               description "Match for Target address for ND.";
-           }
-           identity ipv6_nd_sll {
-               base match-field;
-               description "Match for Source link-layer for ND.";
-           }
-           identity ipv6_nd_tll {
-               base match-field;
-               description "Match for Target link-layer for ND.";
-           }
-           identity mpls_label {
-               base match-field;
-               description "Match for MPLS label.";
-           }
-           identity mpls_tc {
-               base match-field;
-               description "Match for MPLS TC.";
-           }
-           identity mpls_bos {
-               base match-field;
-               description "Match for MPLS BoS bit.";
-           }
-           identity pbb_isid {
-               base match-field;
-               description "Match for PBB I-SID.";
-           }
-           identity tunnel_id {
-               base match-field;
-               description "Match for Logical Port Metadata";
-           }
-           identity ipv6_exthdr {
-               base match-field;
-               description "Match for IPv6 Extension Header pseudo-field";
-           }
+        identity in_port {
+            base match-field;
+            description "Match for Switch input port.";
+        }
+        identity in_phy_port {
+            base match-field;
+            description "Match for Switch physical input port.";
+        }
+        identity metadata {
+            base match-field;
+            description "Match for Metadata passed between tables.";
+        }
+        identity eth_dst {
+            base match-field;
+            description "Match for Ethernet destination address.";
+        }
+        identity eth_src {
+            base match-field;
+            description "Match for Ethernet source address.";
+        }
+        identity eth_type {
+            base match-field;
+            description "Match for Ethernet frame type.";
+        }
+        identity vlan_vid {
+            base match-field;
+            description "Match for VLAN id.";
+        }
+        identity vlan_pcp {
+            base match-field;
+            description "Match for VLAN priority.";
+        }
+        identity ip_dscp {
+            base match-field;
+            description "Match for IP DSCP (6 bits in ToS field).";
+        }
+        identity ip_ecn {
+            base match-field;
+            description "Match for IP ECN (2 bits in ToS field).";
+        }
+        identity ip_proto {
+            base match-field;
+            description "Match for IP protocol.";
+        }
+        identity ipv4_src {
+            base match-field;
+            description "Match for IPv4 source address.";
+        }
+        identity ipv4_dst {
+            base match-field;
+            description "Match for IPv4 destination address.";
+        }
+        identity tcp_src {
+            base match-field;
+            description "Match for TCP source port.";
+        }
+        identity tcp_dst {
+            base match-field;
+            description "Match for TCP destination port.";
+        }
+        identity udp_src {
+            base match-field;
+            description "Match for UDP source port.";
+        }
+        identity udp_dst {
+            base match-field;
+            description "Match for UDP destination port.";
+        }
+        identity sctp_src {
+            base match-field;
+            description "Match for SCTP source port.";
+        }
+        identity sctp_dst {
+            base match-field;
+            description "Match for SCTP destination port.";
+        }
+        identity icmpv4_type {
+            base match-field;
+            description "Match for ICMP type.";
+        }
+        identity icmpv4_code {
+            base match-field;
+            description "Match for ICMP code.";
+        }
+        identity arp_op {
+            base match-field;
+            description "Match for ARP opcode.";
+        }
+        identity arp_spa {
+            base match-field;
+            description "Match for ARP source IPv4 address.";
+        }
+        identity arp_tpa {
+            base match-field;
+            description "Match for ARP target IPv4 address.";
+        }
+        identity arp_sha {
+            base match-field;
+            description "Match for ARP source hardware address.";
+        }
+        identity arp_tha {
+            base match-field;
+            description "Match for ARP target hardware address.";
+        }
+        identity ipv6_src {
+            base match-field;
+            description "Match for IPv6 source address.";
+        }
+        identity ipv6_dst {
+            base match-field;
+            description "Match for IPv6 destination address.";
+        }
+        identity ipv6_flabel {
+            base match-field;
+            description "Match for IPv6 Flow Label";
+        }
+        identity icmpv6_type {
+            base match-field;
+            description "Match for ICMPv6 type.";
+        }
+        identity icmpv6_code {
+            base match-field;
+            description "Match for ICMPv6 code.";
+        }
+        identity ipv6_nd_target {
+            base match-field;
+            description "Match for Target address for ND.";
+        }
+        identity ipv6_nd_sll {
+            base match-field;
+            description "Match for Source link-layer for ND.";
+        }
+        identity ipv6_nd_tll {
+            base match-field;
+            description "Match for Target link-layer for ND.";
+        }
+        identity mpls_label {
+            base match-field;
+            description "Match for MPLS label.";
+        }
+        identity mpls_tc {
+            base match-field;
+            description "Match for MPLS TC.";
+        }
+        identity mpls_bos {
+            base match-field;
+            description "Match for MPLS BoS bit.";
+        }
+        identity pbb_isid {
+            base match-field;
+            description "Match for PBB I-SID.";
+        }
+        identity tunnel_id {
+            base match-field;
+            description "Match for Logical Port Metadata";
+        }
+        identity ipv6_exthdr {
+            base match-field;
+            description "Match for IPv6 Extension Header pseudo-field";
+        }
         */
-       // Abstract definitions of fields structure
+    // Abstract definitions of fields structure
 
-               grouping in_port {
-                       description 
-                               "Ingress port. Numerical representation of incoming port, starting at 1. This may be a physical or switch-defined logical port.";
-                       leaf port-number {
-                               type oft:port-number;
-                       }
-               }
-               grouping in_phy_port {
-                       description "Physical port. In ofp_packet_in messages, underlying physical port when packet received on a logical port.";
-                       leaf port-number {
-                               type oft:port-number;
-                       }
-               }
-               grouping metadata {
-                       description "Metadata passed between tables.";
-                       leaf value {
-                               type oft:metadata;
-                       }
-                       leaf mask {
-                               type oft:metadata;
-                       }
-               }
-               grouping eth_dst {
-                       description "Ethernet destination address.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-               }
-               grouping eth_src {
-                       description "Ethernet source address.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping eth_type {
-                       description "Ethernet frame type.";
-                       leaf type {
-                               type oft:ether-type; // Needs to define that as general model
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping vlan_vid {
-                       description "VLAN id.";
-                       leaf vlan-id {
-                               type uint16; // TODO: Define proper vlan id type.
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping vlan_pcp {
-                       description "VLAN priority.";
-                       leaf vlan-pcp {
-                               type uint8; // TODO: Define PCP type
-                       }
-               }
-               grouping ip_dscp {
-                       description "IP DSCP (6 bits in ToS field).";
+        grouping in-port {
+            description 
+                "Ingress port. Numerical representation of incoming port, starting at 1. This may be a physical or switch-defined logical port.";
+            leaf port-number {
+                type oft:port-number;
+            }
+        }
+        grouping in-phy-port {
+            description "Physical port. In ofp_packet_in messages, underlying physical port when packet received on a logical port.";
+            leaf port-number {
+                type oft:port-number;
+            }
+        }
+        grouping metadata {
+            description "Metadata passed between tables.";
+            leaf value {
+                type oft:metadata;
+            }
+            leaf mask {
+                type oft:metadata;
+            }
+        }
+        grouping eth-dst {
+            description "Ethernet destination address.";
+            leaf address {
+                type yang:mac-address;
+            }
+        }
+        grouping eth-src {
+            description "Ethernet source address.";
+            leaf address {
+                type yang:mac-address;
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping eth-type {
+            description "Ethernet frame type.";
+            leaf type {
+                type oft:ether-type; // Needs to define that as general model
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping vlan-vid {
+            description "VLAN id.";
+            leaf vlan-id {
+                type uint16; // TODO: Define proper vlan id type.
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping vlan-pcp {
+            description "VLAN priority.";
+            leaf vlan-pcp {
+                type uint8; // TODO: Define PCP type
+            }
+        }
+        grouping ip-dscp {
+            description "IP DSCP (6 bits in ToS field).";
 
-                       leaf dscp {
-                               type inet:dscp; // TODO: Define DSCP type
-                       }
-               }
-               grouping ip_ecn {
-                       description "IP ECN (2 bits in ToS field).";
-                       leaf ecn {
-                               type uint8; // TODO define ECN
-                       }
-               }
-               grouping ip_proto {
-                       description "IP protocol.";
-                       leaf protocol-number {
-                               type uint8; // TODO define IP protocol number
-                       }
-               }
-               grouping ipv4_src {
-                       description "IPv4 source address.";
-                       leaf prefix {
-                               type inet:ipv4-prefix;
-                       }
-               }
-               grouping ipv4_dst {
-                       description "IPv4 destination address.";
-                       leaf prefix {
-                               type inet:ipv4-prefix;
-                       }
-               }
-               grouping tcp_src {
-                       description "TCP source port.";
-                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping tcp_dst {
-                       description "TCP destination port.";
-                                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping udp_src {
-                       description "UDP source port.";
-                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping udp_dst {
-                       description "UDP destination port.";
-                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping sctp_src {
-                       description "SCTP source port.";
-                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping sctp_dst {
-                       description "SCTP destination port.";
-                       leaf port {
-                               type inet:port-number;
-                       }
-               }
-               grouping icmpv4_type {
-                       description "ICMP type.";
-                       leaf type {
-                               type uint8; // Define ICMP Type
-                       }
-               }
-               grouping icmpv4_code {
-                       description "ICMP code.";
-                       leaf code {
-                               type uint8; // Define ICMP Code
-                       }
-               }
-               grouping arp_op {
-                       description "ARP opcode.";
-                       leaf op-code {
-                               type uint16;
-                       }
-               }
-               grouping arp_spa {
-                       description "ARP source IPv4 address.";
-                       leaf prefix {
-                               type inet:ipv4-prefix;
-                       }
-               }
-               grouping arp_tpa {
-                       description "ARP target IPv4 address.";
-                       leaf prefix {
-                               type inet:ipv4-prefix;
-                       }
-               }
-               grouping arp_sha {
-                       description "ARP source hardware address.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping arp_tha {
-                       description "ARP target hardware address.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping ipv6_src {
-                       description "IPv6 source address.";
-                       leaf prefix {
-                               type inet:ipv6-prefix;
-                       }
-               }
-               grouping ipv6_dst {
-                       description "IPv6 destination address.";
-                       leaf prefix {
-                               type inet:ipv6-prefix;
-                       }
-               }
-               grouping ipv6_flabel {
-                       description "IPv6 Flow Label";
-                       leaf label {
-                               type inet:ipv6-flow-label;
-                       }
-               }
-               grouping icmpv6_type {
-                       description "ICMPv6 type.";
-                       leaf type {
-                               type uint8;
-                       }
-               }
-               grouping icmpv6_code {
-                       description "ICMPv6 code.";
-                       leaf code {
-                               type uint8;
-                       }
-               }
-               grouping ipv6_nd_target {
-                       description "Target address for ND.";
-                       leaf address {
-                               type inet:ipv6-address;
-                       }
-               }
-               grouping ipv6_nd_sll {
-                       description "Source link-layer for ND.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-               }
-               grouping ipv6_nd_tll {
-                       description "Target link-layer for ND.";
-                       leaf address {
-                               type yang:mac-address;
-                       }
-               }
-               grouping mpls_label {
-                       description "MPLS label.";
-                       leaf label {
-                               type uint32; // TODO define type
-                       }
-               }
-               grouping mpls_tc {
-                       description "MPLS TC.";
-                       leaf tc {
-                               type uint8;
-                       }
-               }
-               grouping mpls_bos {
-                       description "MPLS BoS bit.";
-                       leaf bos {
-                               type boolean;
-                       }
-               }
-               grouping pbb_isid {
-                       description "PBB I-SID.";
-                       leaf isid {
-                               type uint32;
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
-               grouping tunnel_id {
-                       description "Logical Port Metadata.";
-                       leaf value {
-                               type oft:metadata; 
-                       }
-                       leaf mask {
-                               type oft:metadata;
-                       }
-               }
-               grouping ipv6_exthdr {
-                       description "IPv6 Extension Header pseudo-field";
-                       leaf pseudo-field {
-                               type bits {
-                                       bit nonext {
-                                               description "<No next header> encountered.";
-                                               position 0;
-                                       }
-                                       bit esp {
-                                               description "Encrypted Sec Payload header present.";
-                                               position 1;
-                                       }
-                                       bit auth {
-                                               description "Authentication header present.";
-                                               position 2;
-                                       }
-                                       bit dest {
-                                               description "1 or 2 dest headers present.";
-                                               position 3;
-                                       }
-                                       bit frag {
-                                               description "Fragment header present.";
-                                               position 4;
-                                       }
-                                       bit router {
-                                               description "Router header present.";
-                                               position 5;
-                                       }
-                                       bit hop {
-                                               description "Hop-by-hop header present.";
-                                               position 6;
-                                       }
-                                       bit unrep {
-                                               description "Unexpected repeats encountered.";
-                                               position 7;
-                                       }
-                                       bit unseq {
-                                               description "Unexpected sequencing encountered.";
-                                               position 8;
-                                               }                                       
-                               }
-                       }
-                       leaf mask {
-                               type binary;
-                       }
-               }
+            leaf dscp {
+                type inet:dscp; // TODO: Define DSCP type
+            }
+        }
+        grouping ip-ecn {
+            description "IP ECN (2 bits in ToS field).";
+            leaf ecn {
+                type uint8; // TODO define ECN
+            }
+        }
+        grouping ip-proto {
+            description "IP protocol.";
+            leaf protocol-number {
+                type uint8; // TODO define IP protocol number
+            }
+        }
+        grouping ipv4-src {
+            description "IPv4 source address.";
+            leaf prefix {
+                type inet:ipv4-prefix;
+            }
+        }
+        grouping ipv4-dst {
+            description "IPv4 destination address.";
+            leaf prefix {
+                type inet:ipv4-prefix;
+            }
+        }
+        grouping tcp-src {
+            description "TCP source port.";
+            leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping tcp-dst {
+            description "TCP destination port.";
+                    leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping udp-src {
+            description "UDP source port.";
+            leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping udp-dst {
+            description "UDP destination port.";
+            leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping sctp-src {
+            description "SCTP source port.";
+            leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping sctp-dst {
+            description "SCTP destination port.";
+            leaf port {
+                type inet:port-number;
+            }
+        }
+        grouping icmpv4-type {
+            description "ICMP type.";
+            leaf type {
+                type uint8; // Define ICMP Type
+            }
+        }
+        grouping icmpv4-code {
+            description "ICMP code.";
+            leaf code {
+                type uint8; // Define ICMP Code
+            }
+        }
+        grouping arp-op {
+            description "ARP opcode.";
+            leaf op-code {
+                type uint16;
+            }
+        }
+        grouping arp-spa {
+            description "ARP source IPv4 address.";
+            leaf prefix {
+                type inet:ipv4-prefix;
+            }
+        }
+        grouping arp-tpa {
+            description "ARP target IPv4 address.";
+            leaf prefix {
+                type inet:ipv4-prefix;
+            }
+        }
+        grouping arp-sha {
+            description "ARP source hardware address.";
+            leaf address {
+                type yang:mac-address;
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping arp-tha {
+            description "ARP target hardware address.";
+            leaf address {
+                type yang:mac-address;
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping ipv6-src {
+            description "IPv6 source address.";
+            leaf prefix {
+                type inet:ipv6-prefix;
+            }
+        }
+        grouping ipv6-dst {
+            description "IPv6 destination address.";
+            leaf prefix {
+                type inet:ipv6-prefix;
+            }
+        }
+        grouping ipv6-flabel {
+            description "IPv6 Flow Label";
+            leaf label {
+                type inet:ipv6-flow-label;
+            }
+        }
+        grouping icmpv6-type {
+            description "ICMPv6 type.";
+            leaf type {
+                type uint8;
+            }
+        }
+        grouping icmpv6-code {
+            description "ICMPv6 code.";
+            leaf code {
+                type uint8;
+            }
+        }
+        grouping ipv6-nd-target {
+            description "Target address for ND.";
+            leaf address {
+                type inet:ipv6-address;
+            }
+        }
+        grouping ipv6-nd-sll {
+            description "Source link-layer for ND.";
+            leaf address {
+                type yang:mac-address;
+            }
+        }
+        grouping ipv6-nd-tll {
+            description "Target link-layer for ND.";
+            leaf address {
+                type yang:mac-address;
+            }
+        }
+        grouping mpls-label {
+            description "MPLS label.";
+            leaf label {
+                type uint32; // TODO define type
+            }
+        }
+        grouping mpls-tc {
+            description "MPLS TC.";
+            leaf tc {
+                type uint8;
+            }
+        }
+        grouping mpls-bos {
+            description "MPLS BoS bit.";
+            leaf bos {
+                type boolean;
+            }
+        }
+        grouping pbb-isid {
+            description "PBB I-SID.";
+            leaf isid {
+                type uint32;
+            }
+            leaf mask {
+                type binary;
+            }
+        }
+        grouping tunnel-id {
+            description "Logical Port Metadata.";
+            leaf value {
+                type oft:metadata; 
+            }
+            leaf mask {
+                type oft:metadata;
+            }
+        }
+        grouping ipv6-exthdr {
+            description "IPv6 Extension Header pseudo-field";
+            leaf pseudo-field {
+                type bits {
+                    bit nonext {
+                        description "<No next header> encountered.";
+                        position 0;
+                    }
+                    bit esp {
+                        description "Encrypted Sec Payload header present.";
+                        position 1;
+                    }
+                    bit auth {
+                        description "Authentication header present.";
+                        position 2;
+                    }
+                    bit dest {
+                        description "1 or 2 dest headers present.";
+                        position 3;
+                    }
+                    bit frag {
+                        description "Fragment header present.";
+                        position 4;
+                    }
+                    bit router {
+                        description "Router header present.";
+                        position 5;
+                    }
+                    bit hop {
+                        description "Hop-by-hop header present.";
+                        position 6;
+                    }
+                    bit unrep {
+                        description "Unexpected repeats encountered.";
+                        position 7;
+                    }
+                    bit unseq {
+                        description "Unexpected sequencing encountered.";
+                        position 8;
+                        }                    
+                }
+            }
+            leaf mask {
+                type binary;
+            }
+        }
 
-       /* Basic Match Fields : 
-          - Maybe it will be better to split into several groupings
-            based on protocol types:
-               - L2 match
-               - L3 match
-                  - IPv4 match
-                  - IPv6 match
-               - L4 match
-               - ARP match
-               etc...
-           Maybe this works belongs to other module.
-       */
+    /* Basic Match Fields : 
+       - Maybe it will be better to split into several groupings
+         based on protocol types:
+             - L2 match
+             - L3 match
+                - IPv4 match
+                - IPv6 match
+             - L4 match
+             - ARP match
+             etc...
+        Maybe this works belongs to other module.
+    */
 
-               grouping basic-match-fields {
-                       container in_port {
-                               presence "";
-                               uses in_port; 
-               
-                       }
-                       container in_phy_port {
-                               presence "";
-                               uses in_phy_port; 
-                               
-                       }
-                       container metadata {
-                               presence "";
-                               uses metadata; 
-                               
-                       }
-                       container eth_dst {
-                               presence "";
-                               uses eth_dst; 
-                               
-                       }
-                       container eth_src {
-                               presence "";
-                               uses eth_src; 
-                               
-                       }
-                       container eth_type {
-                               presence "";
-                               uses eth_type; 
-                               
-                       }
-                       container vlan_vid {
-                               presence "";
-                               uses vlan_vid; 
-                               
-                       }
-                       container vlan_pcp {
-                               presence "";
-                               uses vlan_pcp; 
-                               
-                       }
-                       container ip_dscp {
-                               presence "";
-                               uses ip_dscp; 
-                               
-                       }
-                       container ip_ecn {
-                               presence "";
-                               uses ip_ecn; 
-                               
-                       }
-                       container ip_proto {
-                               presence "";
-                               uses ip_proto; 
-                               
-                       }
-                       container ipv4_src {
-                               presence "";
-                               uses ipv4_src; 
-                               
-                       }
-                       container ipv4_dst {
-                               presence "";
-                               uses ipv4_dst; 
-                               
-                       }
-                       container tcp_src {
-                               presence "";
-                               uses tcp_src; 
-                               
-                       }
-                       container tcp_dst {
-                               presence "";
-                               uses tcp_dst; 
-                               
-                       }
-                       container udp_src {
-                               presence "";
-                               uses udp_src; 
-                               
-                       }
-                       container udp_dst {
-                               presence "";
-                               uses udp_dst; 
-                               
-                       }
-                       container sctp_src {
-                               presence "";
-                               uses sctp_src; 
-                               
-                       }
-                       container sctp_dst {
-                               presence "";
-                               uses sctp_dst; 
-                               
-                       }
-                       container icmpv4_type {
-                               presence "";
-                               uses icmpv4_type; 
-                               
-                       }
-                       container icmpv4_code {
-                               presence "";
-                               uses icmpv4_code; 
-                               
-                       }
-                       container arp_op {
-                               presence "";
-                               uses arp_op; 
-                               
-                       }
-                       container arp_spa {
-                               presence "";
-                               uses arp_spa; 
-                               
-                       }
-                       container arp_tpa {
-                               presence "";
-                               uses arp_tpa; 
-                               
-                       }
-                       container arp_sha {
-                               presence "";
-                               uses arp_sha; 
-                               
-                       }
-                       container arp_tha {
-                               presence "";
-                               uses arp_tha; 
-                               
-                       }
-                       container ipv6_src {
-                               presence "";
-                               uses ipv6_src; 
-                               
-                       }
-                       container ipv6_dst {
-                               presence "";
-                               uses ipv6_dst; 
-                               
-                       }
-                       container ipv6_flabel {
-                               presence "";
-                               uses ipv6_flabel; 
-                               
-                       }
-                       container icmpv6_type {
-                               presence "";
-                               uses icmpv6_type; 
-                               
-                       }
-                       container icmpv6_code {
-                               presence "";
-                               uses icmpv6_code; 
-                               
-                       }
-                       container ipv6_nd_target {
-                               presence "";
-                               uses ipv6_nd_target; 
-                               
-                       }
-                       container ipv6_nd_sll {
-                               presence "";
-                               uses ipv6_nd_sll; 
-                               
-                       }
-                       container ipv6_nd_tll {
-                               presence "";
-                               uses ipv6_nd_tll; 
-                               
-                       }
-                       container mpls_label {
-                               presence "";
-                               uses mpls_label; 
-                               
-                       }
-                       container mpls_tc {
-                               presence "";
-                               uses mpls_tc; 
-                               
-                       }
-                       container mpls_bos {
-                               presence "";
-                               uses mpls_bos; 
-                               
-                       }
-                       container pbb_isid {
-                               presence "";
-                               uses pbb_isid; 
-                               
-                       }
-                       container tunnel_id {
-                               presence "";
-                               uses tunnel_id; 
-                               
-                       }
-                       container ipv6_exthdr {
-                               presence "";
-                               uses ipv6_exthdr; 
-                               
-                       }
-               }
+        grouping basic-match-fields {
+            container in-port {
+                presence "";
+                uses in-port; 
+        
+            }
+            container in-phy-port {
+                presence "";
+                uses in-phy-port; 
+                
+            }
+            container metadata {
+                presence "";
+                uses metadata; 
+                
+            }
+            container eth-dst {
+                presence "";
+                uses eth-dst; 
+                
+            }
+            container eth-src {
+                presence "";
+                uses eth-src; 
+                
+            }
+            container eth-type {
+                presence "";
+                uses eth-type; 
+                
+            }
+            container vlan-vid {
+                presence "";
+                uses vlan-vid; 
+                
+            }
+            container vlan-pcp {
+                presence "";
+                uses vlan-pcp; 
+                
+            }
+            container ip-dscp {
+                presence "";
+                uses ip-dscp; 
+                
+            }
+            container ip-ecn {
+                presence "";
+                uses ip-ecn; 
+                
+            }
+            container ip-proto {
+                presence "";
+                uses ip-proto; 
+                
+            }
+            container ipv4-src {
+                presence "";
+                uses ipv4-src; 
+                
+            }
+            container ipv4-dst {
+                presence "";
+                uses ipv4-dst; 
+                
+            }
+            container tcp-src {
+                presence "";
+                uses tcp-src; 
+                
+            }
+            container tcp-dst {
+                presence "";
+                uses tcp-dst; 
+                
+            }
+            container udp-src {
+                presence "";
+                uses udp-src; 
+                
+            }
+            container udp-dst {
+                presence "";
+                uses udp-dst; 
+                
+            }
+            container sctp-src {
+                presence "";
+                uses sctp-src; 
+                
+            }
+            container sctp-dst {
+                presence "";
+                uses sctp-dst; 
+                
+            }
+            container icmpv4-type {
+                presence "";
+                uses icmpv4-type; 
+                
+            }
+            container icmpv4-code {
+                presence "";
+                uses icmpv4-code; 
+                
+            }
+            container arp-op {
+                presence "";
+                uses arp-op; 
+                
+            }
+            container arp-spa {
+                presence "";
+                uses arp-spa; 
+                
+            }
+            container arp-tpa {
+                presence "";
+                uses arp-tpa; 
+                
+            }
+            container arp-sha {
+                presence "";
+                uses arp-sha; 
+                
+            }
+            container arp-tha {
+                presence "";
+                uses arp-tha; 
+                
+            }
+            container ipv6-src {
+                presence "";
+                uses ipv6-src; 
+                
+            }
+            container ipv6-dst {
+                presence "";
+                uses ipv6-dst; 
+                
+            }
+            container ipv6-flabel {
+                presence "";
+                uses ipv6-flabel; 
+                
+            }
+            container icmpv6-type {
+                presence "";
+                uses icmpv6-type; 
+                
+            }
+            container icmpv6-code {
+                presence "";
+                uses icmpv6-code; 
+                
+            }
+            container ipv6-nd-target {
+                presence "";
+                uses ipv6-nd-target; 
+                
+            }
+            container ipv6-nd-sll {
+                presence "";
+                uses ipv6-nd-sll; 
+                
+            }
+            container ipv6-nd-tll {
+                presence "";
+                uses ipv6-nd-tll; 
+                
+            }
+            container mpls-label {
+                presence "";
+                uses mpls-label; 
+                
+            }
+            container mpls-tc {
+                presence "";
+                uses mpls-tc; 
+                
+            }
+            container mpls-bos {
+                presence "";
+                uses mpls-bos; 
+                
+            }
+            container pbb-isid {
+                presence "";
+                uses pbb-isid; 
+                
+            }
+            container tunnel-id {
+                presence "";
+                uses tunnel-id; 
+                
+            }
+            container ipv6-exthdr {
+                presence "";
+                uses ipv6-exthdr; 
+                
+            }
+        }
 }
\ No newline at end of file
index cb575a80edd8c114684aa0e3ae00a43eb26c94e3..da945f8feee5d4ed9d8c8fc91960c904a4eda4ca 100644 (file)
@@ -39,13 +39,13 @@ module openflow-instruction {
     */
     // Structures
 
-    grouping goto_table {
+    grouping goto-table {
         description " Setup the next table in the lookup pipeline";
         leaf table {
             type oft:table-id; // 
         }
     }
-    grouping write_metadata {
+    grouping write-metadata {
         description " Setup the metadata field for use later in     pipeline";
         leaf metadata {
             type oft:metadata;
index fa10668442a0e6dae2acb8e3f928b0d52df6cb5f..c538d3646564ee0b461470cacf9dcfdb07e02320 100644 (file)
@@ -21,11 +21,11 @@ module openflow-protocol {
 
         grouping port {
             // reference "ofp_port";
-            leaf port_no { 
+            leaf port-no { 
                 // reference "ofp_port.port_no"; 
                 type uint32;
             }
-            leaf hw_addr { 
+            leaf hw-addr { 
                 // reference "ofp_port.hw_addr"; 
                 type yang:mac-address;
             }
@@ -79,268 +79,710 @@ module openflow-protocol {
 
     // # MESSAGE Structures
         /* Immutable messages. */
+            grouping ofHeader {
+                //reference "ofpt_header struct in Openflow Switch 1.3 Spec"
+                leaf version {
+                    type uint8;
+                    //reference "OpenFlow Header - OFP_VERSION";
+                }
+                leaf xid {
+                    type uint32;
+                    //reference "OpenFlow Header - transaction id";
+                }
+            }
+            grouping ofHelloElementHeader {
+                //reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec"
+                leaf type {
+                    type oft:hello-element-type;
+                    //reference "OpenFlow Header element type - OFPHET_*";
+                }
+                leaf length {
+                    type uint16;
+                    //reference "OpenFlow Header element length";
+                }
+            }
             grouping hello {
                 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
-                
                 /* Symmetric message */
+                uses ofHeader;
+                
+                list elements {
+                    uses ofHelloElementHeader;
+                    
+                    leaf data {
+                        type binary;
+                    }
+                }
             }
             grouping error {
                 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
-                
                 /* Symmetric message */
+                uses ofHeader;
+                
+                leaf type {
+                    type oft:error-type;
+                }
+                leaf code {
+                    type uint16;
+                }
+                leaf data {
+                    type binary; 
+                }
             }
-            grouping echo_request {
+            grouping echo-request {
                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
-                
                 /* Symmetric message */
+                uses ofHeader;
+                
+                leaf data {
+                    type binary;
+                }
             }
-            grouping echo_reply {
+            grouping echo-reply {
                 // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"
-                
                 /* Symmetric message */
+                uses ofHeader;
+                
+                leaf data {
+                    type binary;
+                }
             }
             grouping experimenter {
                 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
-                
                 /* Symmetric message */
+                uses ofHeader;
+                
+                leaf experimenter {
+                    type uint32;
+                }
+                leaf exp_type {
+                    type uint32;
+                }
             }
         /* Switch configuration messages. */
-            grouping features_request {
+            grouping features-request {
                 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                uses ofHeader;
             }
-            grouping features_reply {
+            grouping features-reply {
                 // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                uses ofHeader;
+                
+                leaf datapathId {
+                    type uint64;
+                }
+                leaf buffers {
+                    type uint32;
+                }
+                leaf tables {
+                    type uint8;
+                }
+                leaf auxiliaryId {
+                    type uint8;
+                }
+                leaf capabilities {
+                    type uint32;
+                }
+                leaf reserved {
+                    type uint32;
+                }
             }
-            grouping get_config_request {
+            grouping get-config-request {
                 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                uses ofHeader;
             }
-            grouping get_config_reply {
+            grouping get-config-reply {
                 // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                uses ofHeader;
+                
+                leaf flags {
+                    type oft:switch-config-flag;
+                }
+                leaf miss-send-len {
+                    type uint16;
+                }
             }
-            grouping set_config {
+            grouping set-config {
                 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                
+                uses ofHeader;
+                
+                leaf flags {
+                    type oft:switch-config-flag;
+                }
+                leaf miss-send-len {
+                    type uint16;
+                }
             }
         /* Asynchronous messages. */
-            grouping packet_in {
+            grouping packet-in {
                 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
+                /* Async message */
+                
+                uses ofHeader;
+                
+                leaf buffer-id {
+                    // ID assigned by datapath.
+                    type uint32;
+                }  
+                leaf total-len {
+                    // Full length of frame.
+                    type uint16;
+                }
+                leaf reason {
+                    // Reason packet is being sent (one of OFPR_*) 
+                    type uint8;
+                }
+                leaf table-id {
+                    // ID of the table that was looked up
+                    type oft:table-id;
+                }
+                leaf cookie {
+                    // Cookie of the flow entry that was looked up.
+                    type uint64;
+                }
+                
+                //TODO:: add match leaf
+                // leaf match {
+                //     type oft:match
+                // }
+
+// struct ofp_match match; /* Packet metadata. Variable size. */
+// /* The variable size and padded match is always followed by:
+//  *   - Exactly 2 all-zero padding bytes, then
+//  *   - An Ethernet frame whose length is inferred from header.length.
+//  * The padding bytes preceding the Ethernet frame ensure that the IP
+//  * header (if any) following the Ethernet header is 32-bit aligned.
+//  */
+                leaf data {
+                    type binary;
+                }
                 
-             /* Async message */
             }
-            grouping flow_removed {
+            grouping flow-removed {
                 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
-                
                 /* Async message */
+                uses ofHeader;
+                
+                leaf cookie {
+                    type uint64;
+                }
+                leaf priority {
+                    type uint16;
+                }
+                leaf reason {
+                    type oft:flow-removed-reason;
+                }
+                leaf table-id {
+                    type oft:table-id;
+                }
+                leaf duration-sec {
+                    type uint32;
+                }
+                leaf duration-nsec {
+                    type uint32;
+                }
+                leaf idle-timeout {
+                    type uint16;
+                }
+                leaf hard-timeout {
+                    type uint16;
+                }
+                leaf packet-count {
+                    type uint64;
+                }
+                leaf byte-count {
+                    type uint64;
+                }
+                //TODO:: add match leaf
+                //leaf match {
+                //    type oft:match;
+                //}
             } 
-            grouping port_status {
+            grouping port-status {
                 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
                 
+                uses ofHeader;
+                
+                uses port;
+                
+                leaf reason {
+                    type oft:port-reason;
+                }
             } /* Async message */
         /* Controller command messages. */
-            grouping packet_out {
+            grouping packet-out {
                 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                
+                uses ofHeader;
+                
+                list actions {
+                    //TODO:: replace with>> uses ofaction:action-header;
+                    uses action-header;
+                    
+                    leaf data {
+                        type binary;
+                    }
+                }
+                
+                leaf buffer-id {
+                    type uint32;
+                }
+                leaf in-port {
+                    type oft:port-number;
+                }
             } 
-            grouping flow_mod {
+            grouping action-header {
+                //TODO:: remove this grouping
+                leaf type {
+                    type ofaction:action-type;
+                }
+            }
+            
+            grouping flow-mod {
                 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
+                
+                uses ofHeader;
+                
+                leaf cookie {
+                    type uint64;
+                }
+                leaf cookie-mask {
+                    type uint64;
+                }
+                leaf table-id {
+                    type oft:table-id;
+                }
+                leaf command {
+                    type oft:flow-mod-command;
+                }
+                leaf idle-timeout {
+                    type uint16;
+                }
+                leaf hard-timeout {
+                    type uint16;
+                }
+                leaf priority {
+                    type uint16;
+                }
+                leaf buffer-id {
+                    type uint32;
+                }
+                leaf out-port {
+                    type oft:port-number;
+                }
+                leaf out-group {
+                    type uint32;
+                }
+                leaf flags {
+                    type uint16;
+                }
+                //TODO:: add match leaf
             } 
-            grouping group_mod {
+            grouping group-mod {
                 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
-                
                 /* Controller/switch message */
-            } 
-            grouping port_mod {
+                
+                uses ofHeader;
+                
+                leaf command {
+                    type oft:group-mod-command;
+                }
+                leaf type {
+                    type oft:group-type;
+                }
+                leaf group-id {
+                    type uint32;
+                }
+                
+                list buckets {
+                    uses bucket;
+                }
+            }
+            grouping bucket {
+                leaf weight {
+                    type uint16;
+                }
+                leaf watch-port {
+                    type oft:port-number;
+                }
+                leaf watch-group {
+                    type uint32;
+                }
+                
+                list actions {
+                    //TODO:: replace with>> uses ofaction:action-header;
+                    uses action-header;
+                }
+            }
+            grouping port-mod {
                 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
-            grouping table_mod {
+                leaf port-no {
+                    type oft:port-number;
+                }
+                leaf hw-address {
+                    type yang:mac-address;
+                }       
+                leaf config {
+                    type oft:port-config;
+                }   
+                leaf mask {
+                    type oft:port-config;
+                }  
+                leaf advertise {
+                    type oft:port-config;
+                }
+            } 
+            grouping table-mod {
                 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
+                leaf table-id {
+                    type oft:table-id;
+                }
+                leaf config {
+                    type oft:port-config;
+                }                
+            } 
+            
         /* Multipart messages. */
-            grouping multipart_request {
+            grouping multipart-request {
                 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
-            grouping multipart_reply {
+                /* Controller/switch message */
+
+                uses ofHeader;
+                
+                leaf type {
+                    type oft:multipart-type;
+                }          
+                leaf flags {
+                    type oft:multipart-request-flags;
+                }      
+                leaf body {
+                    type binary;
+                }
+            } 
+            grouping multipart-reply {
                 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
+                leaf type {
+                    type oft:multipart-type;
+                }
+                leaf flags {
+                    type oft:multipart-request-flags;
+                }
+                leaf body {
+                    type binary;
+                }
+            } 
             /* Barrier messages. */
-            grouping barrier_request {
+            grouping barrier-request {
                 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
-            grouping barrier_reply {
+                /* Controller/switch message */
+                uses ofHeader;
+            } 
+            grouping barrier-reply {
                 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
+                /* Controller/switch message */
+                uses ofHeader;
+            } 
         /* Queue Configuration messages. */
-            grouping queue_get_config_request {
+            grouping queue-get-config-request {
                 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
                 
-            } /* Controller/switch message */
-            grouping queue_get_config_reply {
+                uses ofHeader;
+                
+                leaf port {
+                    type oft:port-number;
+                }
+            } 
+            grouping queue-get-config-reply {
                 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
+                leaf port {
+                    type oft:port-number;
+                }
+                list queues {
+                    uses packet-queue;
+                }
+            } 
+            grouping packet-queue {
+                leaf queue-id {
+                    type oft:queue-id;
+                }
+                leaf port {
+                    type oft:port-number;
+                }
+                list properties {
+                    uses queue-property-header;
+                }
+            }
+            grouping queue-property-header {
+                leaf property {
+                    type oft:queue-property;
+                }
+            }
             /* Controller role change request messages. */
-            grouping role_request {
+            grouping role-request {
                 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
                 
-            } /* Controller/switch message */
-            grouping role_reply {
+                uses ofHeader;
+                
+                leaf role {
+                    type oft:controller-role;
+                }
+                leaf generation-id {
+                    type uint64;
+                }
+            } 
+            grouping role-reply {
                 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
+                leaf role {
+                    type oft:controller-role;
+                }
+                leaf generation-id {
+                    type uint64;
+                }
+            } 
             /* Asynchronous message configuration. */
-            grouping get_async_request {
+            grouping get-async-request {
                 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
-            grouping get_async_reply {
+                /* Controller/switch message */
+
+                uses ofHeader;                
+            } 
+            grouping get-async-reply {
                 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
+
+                uses ofHeader;
                 
-            } /* Controller/switch message */
-            grouping set_async {
+                list packet-in-mask {
+                    type oft:packet-in-reason;
+                }
+                list port-status-mask {
+                    type oft:port-reason;
+                }
+                list flow-removed-mask {
+                    type oft:flow-removed-reason;
+                }
+            } 
+            grouping set-async {
                 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
+                /* Controller/switch message */
                 
-            } /* Controller/switch message */
+                uses ofHeader;
+                
+                list packet-in-mask {
+                    type oft:packet-in-reason;
+                }
+                list port-status-mask {
+                    type oft:port-reason;
+                }
+                list flow-removed-mask {
+                    type oft:flow-removed-reason;
+                }
+            } 
             /* Meters and rate limiters configuration messages. */
-            grouping meter_mod {
+            grouping meter-mod {
                 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
-                
-            } /* Controller/switch message */
+                /* Controller/switch message */
+
+                uses ofHeader;
+                
+                leaf command {
+                    type oft:meter-mod-command;
+                } 
+                leaf flags {
+                    type oft:meter-flags;
+                }            
+                leaf meter-id {
+                    type oft:meter-id;
+                }   
+                list bands {
+                    
+                }
+            } 
+            
+            grouping meter-band-header {
+                leaf type {
+                    type oft:meter-band-type;
+                }
+                leaf rate {
+                    type uint32;
+                }
+                leaf burst-size {
+                    type uint32;
+                }
+            }
 
 
 
                 /* Immutable messages. */
-            notification hello {
+            notification hello-message {
                 uses hello;
                 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
                 
                 /* Symmetric message */
             }
-            notification error {
+            notification error-message {
                 uses error;
                 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
                 
                 /* Symmetric message */
             }
-            notification echo_request {
-                uses echo_request;
+            notification echo-request-message {
+                uses echo-request;
                 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
                 
                 /* Symmetric message */
             }
-            notification echo_reply {
-                uses echo_reply;
-                // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"
-                
-                /* Symmetric message */
-            }
-            notification experimenter {
+            notification experimenter-message {
                 uses experimenter;
                 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
-                
+                // TODO:: does switch send this when understood experimenter msg from lib?
                 /* Symmetric message */
             }
     // # Notification and RPCs
-        
+        /* Symmetric RPC. */
+            rpc echo {
+                // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
+                input {
+                    uses echo-request;
+                }
+                /* Controller/switch message */
+                output {
+                    uses echo-reply;
+                }
+            }
+            
+            rpc echo-reply {
+                // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
+                input {
+                    uses echo-reply;
+                }
+            }
+            
+            rpc hello {
+                // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
+                input {
+                    uses hello;
+                }
+            }
+            
+            rpc experimenter {
+                // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
+                input {
+                    uses experimenter;
+                }
+            }
 
         /* Switch configuration messages. */
-            rpc get_features {
+            rpc get-features {
                 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
                 input {
-                    uses features_request;
+                    uses features-request;
                 }
                 /* Controller/switch message */
                 output {
-                    uses features_reply;
+                    uses features-reply;
                 }
             }
             
-            rpc get_config {
+            rpc get-config {
                 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
                 input {
-                    uses get_config_request;
+                    uses get-config-request;
                 }
                 output {
-                    uses get_config_reply;
+                    uses get-config-reply;
                 }
                 /* Controller/switch message */
             }
             
-            rpc set_config {
+            rpc set-config {
                 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
                 input {
-                    uses set_config;
+                    uses set-config;
                 }   
                 /* Controller/switch message */
             }
         /* Asynchronous messages. */
-            notification packet_in {
-                uses packet_in;
+            notification packet-in-message {
+                uses packet-in;
                 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
                 
              /* Async message */
             }
-            notification flow_removed {
-                uses flow_removed;
+            notification flow-removed-message {
+                uses flow-removed;
                 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
                 
                 /* Async message */
             } 
-            notification port_status {
-                uses port_status;
+            notification port-status-message {
+                uses port-status;
                 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
                 
             } /* Async message */
 
         /* Controller command messages. */
-            rpc packet_out {
+            rpc packet-out {
                 input {
-                    uses packet_out;
+                    uses packet-out;
                     // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
                 }
                 /* Controller/switch message */
             } 
-            rpc flow_mod {
+            rpc flow-mod {
                 input {
-                    uses flow_mod;
+                    uses flow-mod;
                     // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
                 }
                 /* Controller/switch message */
             } 
-            rpc group_mod {
+            rpc group-mod {
                 input {
-                    uses group_mod;
+                    uses group-mod;
                     // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
                 }
                 /* Controller/switch message */
             } 
-            rpc port_mod {
+            rpc port-mod {
                 input {
-                    uses port_mod;
+                    uses port-mod;
                     // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
                 }
             } /* Controller/switch message */
             
-            rpc table_mod {
+            rpc table-mod {
                 input {
-                    uses table_mod;
+                    uses table-mod;
                     // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
                 }
             } /* Controller/switch message */
@@ -348,13 +790,13 @@ module openflow-protocol {
         /* Multipart messages. */
             //FIXME: Arent this wire protocol specific?
 
-            notification multipart_request {
-                uses multipart_request;
+            notification multipart-request-message {
+                uses multipart-request;
                 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
                 
             } /* Controller/switch message */
-            notification multipart_reply {
-                uses multipart_reply;
+            notification multipart-reply-message {
+                uses multipart-reply;
                 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
                 
             } /* Controller/switch message */
@@ -363,58 +805,58 @@ module openflow-protocol {
             /* Barrier messages. */
             rpc barrier {
                 input {
-                    uses barrier_request;
+                    uses barrier-request;
                     // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
                 }
                 output {
-                    uses barrier_reply;
+                    uses barrier-reply;
                     // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
                 }
             }
         /* Queue Configuration messages. */
-            rpc get_queue_config {
+            rpc get-queue-config {
                 input {
-                    uses queue_get_config_request;
+                    uses queue-get-config-request;
                     // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
                 }
                 output {
-                    uses queue_get_config_reply;
+                    uses queue-get-config-reply;
                     // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
                 }
             } 
 
         /* Controller role change request messages. */
-            rpc role_request {
+            rpc role-request {
                 input {
-                    uses role_request;
+                    uses role-request;
                     // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
                 }
                 output {
-                    uses role_reply;
+                    uses role-reply;
                     // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
                 }
             } /* Controller/switch message */
             
         /* Asynchronous message configuration. */
-            notification get_async_request {
-                uses get_async_request;
+            notification get-async-request-message {
+                uses get-async-request;
                 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
                 
             } /* Controller/switch message */
-            notification get_async_reply {
-                uses get_async_reply;
+            notification get-async-reply-message {
+                uses get-async-reply;
                 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
                 
             } /* Controller/switch message */
-            notification set_async {
-                uses set_async;
+            notification set-async-message {
+                uses set-async;
                 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
                 
             } /* Controller/switch message */
         /* Meters and rate limiters configuration messages. */
-            rpc meter_mod {
+            rpc meter-mod {
                 input {
-                    uses meter_mod;
+                    uses meter-mod;
                     // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
                 }
             } /* Controller/switch message */
index 740496dd525719738f7d31ae9e68112de68f8412..f4c45ba662e3e8f8daa8e3f7d05836f80dff9635 100644 (file)
@@ -173,7 +173,7 @@ module openflow-types {
         }
     }
 
-    identity match-type {
+    identity match-type-base {
         description 
            "The match type indicates the match structure (set of fields that compose the
             match) in use. The match type is placed in the type field at the beginning
@@ -183,13 +183,16 @@ module openflow-types {
 
     identity standard-match-type {
         deprecated true;
-        base oft:match-type;
+        base oft:match-type-base;
     }
 
     typedef match-type {
-        type identityref {
-            base oft:match-type;
-        }
+        //type identityref {
+        //    base oft:match-type-base;
+        //}
+        
+        //TODO: use identityref, when generating available
+        type string;
     }
 
     identity instruction {
@@ -221,4 +224,442 @@ module openflow-types {
     typedef ether-type {
         type uint16;
     }
-}
\ No newline at end of file
+    
+    typedef error-type {
+        type enumeration {
+            enum HELLO_FAILED {
+                value 0; 
+                description "Hello Protocol failed.";
+            }
+            enum BAD_REQUEST {
+                value 1; 
+                description "Request was not understood.";
+            }
+            enum BAD_ACTION {
+                value 2; 
+                description "Error in action description.";
+            }
+            enum BAD_INSTRUCTION {
+                value 3; 
+                description "Error in instruction list.";
+            }
+            enum BAD_MATCH {
+                value 4; 
+                description "Error in match.";
+            }
+            enum FLOW_MOD_FAILED {
+                value 5; 
+                description "Problem modifying flow entry.";
+            }
+            enum GROUP_MOD_FAILED {
+                value 6; 
+                description "Problem modifying group entry.";
+            }
+            enum PORT_MOD_FAILED {
+                value 7; 
+                description "Port mod request failed.";
+            }
+            enum TABLE_MOD_FAILED {
+                value 8; 
+                description "Table mod request failed.";
+            }
+            enum QUEUE_OP_FAILED {
+                value 9; 
+                description "Queue operation failed.";
+            }
+            enum SWITCH_CONFIG_FAILED {
+                value 10; 
+                description "Switch config request failed.";
+            }
+            enum ROLE_REQUEST_FAILED {
+                value 11; 
+                description "Controller Role request failed.";
+            }
+            enum METER_MOD_FAILED {
+                value 12; 
+                description "Error in meter.";
+            }
+            enum TABLE_FEATURES_FAILED {
+                value 13; 
+                description "Setting table features failed.";
+            }
+            enum EXPERIMENTER {
+                value 65535; //0xffff 
+                description "Experimenter error messages.";
+            }
+        }
+    }
+    
+    typedef hello-element-type {
+        type enumeration {
+            enum VERSIONBITMAP {
+                value 1; 
+                description "Bitmap of version supported.";
+            }
+        }
+    }
+    
+    typedef switch-config-flag {
+        /* Handling of IP fragments. */
+        type enumeration {
+            enum FRAG_NORMAL {
+                value 0; 
+                description "No special handling for fragments.";
+            }
+            enum OFPC_FRAG_DROP {
+                value 1; 
+                description "Drop fragments.";
+            }
+            enum OFPC_FRAG_REASM {
+                value 2; 
+                description "Reassemble (only if OFPC_IP_REASM set)."
+            }
+            enum OFPC_FRAG_MASK {
+                value 3; 
+            }
+        }
+    }
+    
+    typedef flow-removed-reason {
+        /* flow removed */
+        type enumeration {
+            enum OFPRR_IDLE_TIMEOUT {
+                value 0;
+                description "Flow idle time exceeded idle_timeout.";
+            }
+            enum OFPRR_HARD_TIMEOUT {
+                value 1;
+                description "Time exceeded hard_timeout.";
+            }
+            enum OFPRR_DELETE {
+                value 2;
+                description "Evicted by a DELETE flow mod."
+            }
+            enum OFPRR_GROUP_DELETE {
+                value 3;
+                description "Group was removed.";
+            }
+        }
+    }
+    
+    typedef port-reason {
+        /* port status */
+        type enumeration {
+            enum OFPPR_ADD {
+                value 0;
+                description "The port was added.";
+            }
+            enum OFPPR_DELETE {
+                value 1;
+                description "he port was removed.";
+            }
+            enum OFPPR_MODIFY {
+                value 2;
+                description "Some attribute of the port has changed.";
+            }
+        }
+    }
+    
+    typedef flow-mod-command {
+        /* ofp_flow_mod_command */
+        type enumeration {
+            enum OFPFC_ADD {      
+                value 0;      
+                description "New flow.";    
+            }
+            enum OFPFC_MODIFY {
+                value 1;
+                description "Modify all matching flows.";
+            }
+            enum OFPFC_MODIFY_STRICT {
+                value 2;
+                description "Modify entry strictly matching wildcards and priority.";
+            }
+            enum OFPFC_DELETE {
+                value 3;
+                description "Delete all matching flows.";
+            }
+            enum OFPFC_DELETE_STRICT {
+                value 4;
+                description "Delete entry strictly matching wildcards and priority.";
+            }
+        }
+    }
+    
+    typedef group-mod-command {
+        /* ofp_group_mod_command */
+        type enumeration {
+            enum OFPGC_ADD {            
+              value 0;            
+              description "New group.";            
+            }
+            enum OFPGC_MODIFY {
+              value 1;
+              description "Modify all matching groups.";
+            }
+            enum OFPGC_DELETE {
+              value 2;
+              description "Delete all matching groups.";
+            }
+            
+        }
+    }
+    
+    
+    typedef group-type {
+        /* ofp_group_type */
+        type enumeration {
+            enum OFPGT_ALL {            
+              value 0;            
+              description "All (multicast/broadcast) group.";            
+            }
+            enum OFPGT_SELECT {
+              value 1;
+              description "Select group.";
+            }
+            enum OFPGT_INDIRECT {
+              value 2;
+              description "Indirect group.";
+            }
+            enum OFPGT_FF {
+              value 3;
+              description "Fast failover group.";
+            }
+        }
+    }
+    
+    typedef multipart-request-flags {
+        description
+            "enum ofp_multipart_request_flags ";
+        type bits {
+            bit OFPMPF_REQ_MORE {
+                //description "More requests to follow.";
+                position 0;
+            }
+        }
+    }
+    
+    typedef multipart-type {
+        /* ofp_multipart_type */
+        type enumeration {
+            enum OFPGT_ALL {
+              value 0;
+              description "All (multicast/broadcast) group.";
+            }
+            
+            enum OFPMP_DESC {
+              value 0;
+              description "Description of this OpenFlow switch.
+                 The request body is empty.
+                 The reply body is struct ofp_desc.";
+            }
+            enum OFPMP_FLOW {
+              value 1;
+              description "Individual flow statistics.
+                 The request body is struct ofp_flow_stats_request.
+                 The reply body is an array of struct ofp_flow_stats.";
+            }
+            enum OFPMP_AGGREGATE {
+              value 2;
+              description "Aggregate flow statistics.
+                 The request body is struct ofp_aggregate_stats_request.
+                 The reply body is struct ofp_aggregate_stats_reply.";
+            }
+            enum OFPMP_TABLE {
+              value 3;
+              description "Flow table statistics.
+                 The request body is empty.
+                 The reply body is an array of struct ofp_table_stats.";
+            }
+            enum OFPMP_PORT_STATS {
+              value 4;
+              description "Port statistics.
+                 The request body is struct ofp_port_stats_request.
+                 The reply body is an array of struct ofp_port_stats.";
+            }
+            enum OFPMP_QUEUE {
+              value 5;
+              description "Queue statistics for a port
+                 The request body is struct ofp_queue_stats_request.
+                 The reply body is an array of struct ofp_queue_stats";
+            }
+            enum OFPMP_GROUP {
+              value 6;
+              description "Group counter statistics.
+                 The request body is struct ofp_group_stats_request.
+                 The reply is an array of struct ofp_group_stats.";
+            }
+            enum OFPMP_GROUP_DESC {
+              value 7;
+              description "Group description.
+                 The request body is empty.
+                 The reply body is an array of struct ofp_group_desc.";
+            }
+            enum OFPMP_GROUP_FEATURES {
+              value 8;
+              description "Group features.
+                 The request body is empty.
+                 The reply body is struct ofp_group_features.";
+            }
+            enum OFPMP_METER {
+              value 9;
+              description "Meter statistics.
+                 The request body is struct ofp_meter_multipart_requests.
+                 The reply body is an array of struct ofp_meter_stats.";
+            }
+            enum OFPMP_METER_CONFIG {
+              value 10;
+              description "Meter configuration.
+                 The request body is struct ofp_meter_multipart_requests.
+                 The reply body is an array of struct ofp_meter_config.";
+            }
+            enum OFPMP_METER_FEATURES {
+              value 11;
+              description "Meter features.
+                 The request body is empty.
+                 The reply body is struct ofp_meter_features.";
+            }
+            enum OFPMP_TABLE_FEATURES {
+              value 12;
+              description "Table features.
+                 The request body is either empty or contains an array of
+                 struct ofp_table_features containing the controller’s
+                 desired view of the switch. If the switch is unable to
+                 set the specified view an error is returned.
+                 The reply body is an array of struct ofp_table_features.";
+            }
+            enum OFPMP_PORT_DESC {
+              value 13;
+              description "Port description.
+                 The request body is empty.
+                 The reply body is an array of struct ofp_port.";
+            }
+            enum OFPMP_EXPERIMENTER {
+              value 65535; //0xffff
+              description "Experimenter extension.
+                 The request and reply bodies begin with
+                 struct ofp_experimenter_multipart_header.
+                 The request and reply bodies are otherwise experimenter-defined.";
+            }
+        }
+    }
+    
+    typedef queue-property {
+        /* ofp_queue_properties */
+        type enumeration {
+            enum OFPGT_ALL {
+              value 0;
+              description "All (multicast/broadcast) group.";
+            }
+            enum OFPQT_MIN_RATE {
+                value 1;
+                description "Minimum datarate guaranteed.";
+            }
+            enum OFPQT_MAX_RATE {
+                value 2;
+                description "Maximum datarate.";
+            }
+            enum OFPQT_EXPERIMENTER {
+                value 65535; // 0xffff 
+                description "Experimenter defined property.";
+            }
+        }
+    }
+    
+    typedef controller-role {
+        /* ofp_controller_role */
+        type enumeration {
+            enum OFPCR_ROLE_NOCHANGE {
+              value 0;
+              description "Don’t change current role.";
+            }
+            enum OFPCR_ROLE_EQUAL {
+              value 1;
+              description "Default role, full access.";
+            }
+            enum OFPCR_ROLE_MASTER {
+              value 2;
+              description "Full access, at most one master.";
+            }
+            enum OFPCR_ROLE_SLAVE {
+              value 3;
+              description "Read-only access.";
+            }
+        }
+    }
+    
+    typedef packet-in-reason {
+        /* ofp_packet_in_reason */
+        type enumeration {
+            enum OFPR_NO_MATCH {
+              value 0;
+              description "No matching flow (table-miss flow entry). ";
+            }
+            enum OFPR_ACTION {
+              value 1;
+              description "Action explicitly output to controller. ";
+            }
+            enum OFPR_INVALID_TTL {
+              value 2;
+              description "Packet has invalid TTL ";
+            }
+        }
+    }
+    
+    typedef meter-mod-command {
+        /* ofp_meter_mod_command */
+        type enumeration {
+            enum OFPMC_ADD {
+              description "New meter. ";
+            }
+            enum OFPMC_MODIFY {
+              description "Modify specified meter. ";
+            }
+            enum OFPMC_DELETE {
+              description "Delete specified meter. ";
+            }
+
+        }
+    }
+    typedef meter-flags {
+        /* ofp_meter_flags */
+        type bits {
+            bit OFPMF_KBPS {
+                position 0;
+                /* Rate value in kb/s (kilo-bit per second). */
+            }
+            bit OFPMF_PKTPS {
+                position 1;
+                /* Rate value in packet/sec. */
+            }
+            bit OFPMF_BURST {
+                position 2;
+                /* Do burst size. */
+            }
+            bit OFPMF_STATS {
+                position 3;
+                /* Collect statistics. */
+            }
+        }
+    }
+    
+    typedef meter-band-type {
+        /* ofp_meter_band_type */
+        type enumeration {
+            enum OFPMBT_DROP {
+              value 1;
+              description "Drop packet. ";
+            }
+            enum OFPMBT_DSCP_REMARK {
+              value 2;
+              description "Remark DSCP in the IP header. ";
+            }
+            enum OFPMBT_EXPERIMENTER {
+              value 65535; //0xFFFF
+              description "Experimenter meter band. ";
+            }
+
+        }
+    }
+}