X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-api%2Fsrc%2Fmain%2Fyang%2Fopenflow-protocol.yang;h=32070d14cf900c973825c3fe47985df02d7e7e3a;hb=05bc9fb5cb06c747be728f8d695d2723db911514;hp=6a353a41352af81dee14bd98640080230dd4956f;hpb=ff2f581fe0e7a7138dc765cfe713bc2d0791297e;p=openflowjava.git diff --git a/openflow-protocol-api/src/main/yang/openflow-protocol.yang b/openflow-protocol-api/src/main/yang/openflow-protocol.yang index 6a353a41..32070d14 100644 --- a/openflow-protocol-api/src/main/yang/openflow-protocol.yang +++ b/openflow-protocol-api/src/main/yang/openflow-protocol.yang @@ -1,9 +1,15 @@ -module openflow-protocol { +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + + module openflow-protocol { namespace "urn:opendaylight:openflow:protocol"; prefix "ofproto"; - - import ietf-inet-types {prefix inet;} import ietf-yang-types {prefix yang;} import openflow-types {prefix oft;} @@ -11,115 +17,146 @@ module openflow-protocol { import openflow-instruction { prefix ofinstruction;} import openflow-action {prefix ofaction;} - - revision "2013-07-31" { - description "Initial model"; + description "OpenFlow 1.3 - protocol objects model"; } // Generic Structures - - grouping port { - // reference "ofp_port"; - leaf port-no { - // reference "ofp_port.port_no"; + grouping port-grouping { + reference "ofp_port"; + leaf port-no { type uint32; } - leaf hw-addr { - // reference "ofp_port.hw_addr"; + leaf hw-addr { type yang:mac-address; } - leaf name { - // reference "ofp_port.name"; + leaf name { type string; } - leaf config { - // reference "ofp_port.config"; + leaf config { + description "Bitmap of OFPPC_* flags."; type oft:port-config; } - leaf state { - // reference "ofp_port.state"; + leaf state { + description "Bitmap of OFPPS_* flags."; type oft:port-state; } - leaf current-features { + leaf current-features { description "Current features."; - // reference "ofp_port.curr"; - type oft:port-features; + type oft:port-features; } - leaf advertised-features { + leaf advertised-features { description "Features being advertised by the port."; - // reference "ofp_port.advertised"; - type oft:port-features; + type oft:port-features; } - leaf supported-features { + leaf supported-features { description "Features supported by the port."; - // reference "ofp_port.supported"; - type oft:port-features; + type oft:port-features; } - leaf peer-features { + leaf peer-features { description "Features advertised by peer."; - // reference "ofp_port.peer"; type oft:port-features; } - leaf curr_speed { + leaf curr-speed { description "Current port bitrate in kbps."; - // reference "ofp_port.curr_speed"; - type uint32; + type uint32; units "kbps"; } - leaf max_speed { + leaf max-speed { description "Max port bitrate in kbps"; - // reference "ofp_port.max_speed"; type uint32; - units "kbps"; + units "kbps"; + } + + // OF1.0 structures + leaf config-v10 { + type oft:port-config-v10; + } + leaf state-v10 { + type oft:port-state-v10; + } + leaf current-features-v10 { + description "Current features."; + type oft:port-features-v10; + } + leaf advertised-features-v10 { + description "Features being advertised by the port."; + type oft:port-features-v10; + } + leaf supported-features-v10 { + description "Features supported by the port."; + type oft:port-features-v10; + } + leaf peer-features-v10 { + description "Features advertised by peer."; + type oft:port-features-v10; } } - - grouping match { - leaf type { - type identityref { - base oft:match-type-base; + + grouping buckets-grouping { + list buckets-list { + uses bucket-grouping; } } - uses oxm:oxm-fields; - } - + + grouping bucket-grouping { + description "Bucket for use in groups."; + leaf weight { + description "Relative weight of bucket. Only + defined for select groups."; + type uint16; + } + leaf watch-port { + description "Port whose state affects whether this + bucket is live. Only required for fast + failover groups."; + type oft:port-number; + } + leaf watch-group { + description "Group whose state affects whether this + bucket is live. Only required for fast + failover groups."; + type uint32; + } + + uses ofaction:actions-grouping; + } + container table-features-properties-container { - uses table-features-properties; + uses table-features-properties-grouping; } - - grouping table-features-properties { + + grouping table-features-properties-grouping { list table-feature-properties { + config false; leaf type { type oft:table-features-prop-type; } } } - // TODO: ofp_packet_queue - // # MESSAGE Structures /* Immutable messages. */ grouping ofHeader { - //reference "ofpt_header struct in Openflow Switch 1.3 Spec" + reference "ofp_header struct in Openflow Switch 1.3 Spec"; leaf version { type uint8; - //reference "OpenFlow Header - OFP_VERSION"; + description "OpenFlow version"; } leaf xid { type uint32; - //reference "OpenFlow Header - transaction id"; + description "Transaction ID"; } } grouping ofHelloElementHeader { - //reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec" + 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_*"; } } grouping hello { - // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec" + reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; @@ -129,29 +166,31 @@ module openflow-protocol { leaf-list version-bitmap { type boolean; } - - leaf data { - type binary; - } } } grouping error { - // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec" + reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; leaf type { - type oft:error-type; + type uint16; } leaf code { type uint16; } + leaf type-string { + type string; + } + leaf code-string { + type string; + } leaf data { type binary; } } grouping echo-request { - // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; @@ -160,7 +199,7 @@ module openflow-protocol { } } grouping echo-reply { - // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; @@ -169,28 +208,25 @@ module openflow-protocol { } } grouping experimenter { - // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec" + reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; leaf experimenter { - type uint32; + type oft:experimenter-id; } leaf exp_type { type uint32; } - leaf data { - type binary; - } } /* Switch configuration messages. */ grouping features-request { - // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; } grouping features-reply { - // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -207,19 +243,29 @@ module openflow-protocol { type uint8; } leaf capabilities { - type uint32; + type oft:capabilities; } leaf reserved { type uint32; } + // OF1.0 structures + leaf capabilities-v10 { + type oft:capabilities-v10; + } + leaf actions-v10 { + type oft:action-type-v10; + } + list phy-port { + uses port-grouping; + } } grouping get-config-request { - // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; } grouping get-config-reply { - // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -231,12 +277,12 @@ module openflow-protocol { } } grouping set-config { - // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec" + reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - leaf-list flags { + leaf flags { type oft:switch-config-flag; } leaf miss-send-len { @@ -245,7 +291,7 @@ module openflow-protocol { } /* Asynchronous messages. */ grouping packet-in { - // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec" + reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"; /* Async message */ uses ofHeader; @@ -260,7 +306,7 @@ module openflow-protocol { } leaf reason { // Reason packet is being sent (one of OFPR_*) - type uint8; + type oft:packet-in-reason; } leaf table-id { // ID of the table that was looked up @@ -270,24 +316,19 @@ module openflow-protocol { // Cookie of the flow entry that was looked up. type uint64; } - container match { - uses match; - } + uses oxm:match-grouping; -// 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; } + // OF1.0 structures + leaf in-port { + type uint16; + } } grouping flow-removed { - // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec" + reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"; /* Async message */ uses ofHeader; @@ -321,36 +362,34 @@ module openflow-protocol { leaf byte-count { type uint64; } - container match { - uses match; - } + uses oxm:match-grouping; + + // OF1.0 structures + uses oxm:match-v10-grouping; } grouping port-status { - // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec" + reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"; uses ofHeader; - uses port; + uses port-grouping; leaf reason { type oft:port-reason; } - } /* Async message */ + } /* Controller command messages. */ grouping packet-out { - // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec" + reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - list actions-list { - uses ofaction:action-header; - - leaf data { - type binary; - } - } + uses ofaction:actions-grouping; + leaf data { + type binary; + } leaf buffer-id { type uint32; } @@ -359,7 +398,7 @@ module openflow-protocol { } } grouping flow-mod { - // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec" + reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -397,12 +436,19 @@ module openflow-protocol { leaf flags { type oft:flow-mod-flags; } - container match { - uses match; + uses oxm:match-grouping; + + uses ofinstruction:instructions-grouping; + + // OF1.0 structures + leaf flags-v10 { + type oft:flow-mod-flags-v10; } + uses oxm:match-v10-grouping; + uses ofaction:actions-grouping; } grouping group-mod { - // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec" + reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -414,30 +460,14 @@ module openflow-protocol { 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; + type oft:group-id; } - list actions-list { - uses ofaction:action-header; - } + uses buckets-grouping; } + grouping port-mod { - // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec" + reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -453,13 +483,23 @@ module openflow-protocol { } leaf mask { type oft:port-config; - } + } leaf advertise { type oft:port-features; } + // OF1.0 structures + leaf config-v10 { + type oft:port-config-v10; + } + leaf mask-v10 { + type oft:port-config-v10; + } + leaf advertise-v10 { + type oft:port-features-v10; + } } grouping table-mod { - // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec" + reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -468,465 +508,563 @@ module openflow-protocol { type oft:table-id; } leaf config { - type oft:port-config; - } + type oft:table-config; + } } /* Multipart messages. */ grouping multipart-request { - // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; leaf type { type oft:multipart-type; - } + } leaf flags { type oft:multipart-request-flags; - } + } choice multipart-request-body { - case multipart-request-flow { - leaf table-id { - type uint8; - } - leaf out-port { - type uint32; - } - leaf out-group { - type uint32; - } - leaf cookie { - type uint64; - } - leaf cookie-mask { - type uint64; - } - container match { - uses match; - } - } - case multipart-request-aggregate { - leaf table-id { - type uint8; - } - leaf out-port { - type uint32; - } - leaf out-group { - type uint32; - } - leaf cookie { - type uint64; - } - leaf cookie-mask { - type uint64; - } - container match { - uses match; - } - } - case multipart-request-port-stats { - leaf port-no { - type uint32; - } - } - case multipart-request-queue { - leaf port-no { - type uint32; - } - leaf queue-id { - type uint32; - } - } - case multipart-request-group { - leaf group-id { - type uint32; - } - } - case multipart-request-meter { - leaf meter-id { - type uint32; - } - } - case multipart-request-meter-config { - leaf meter-id { - type uint32; + case multipart-request-desc-case { + container multipart-request-desc { + leaf empty { + type empty; + } } } - case multipart-request-table-features { - list table-features { + case multipart-request-flow-case { + container multipart-request-flow { leaf table-id { type uint8; } - leaf name { - type string; + leaf out-port { + type uint32; } - leaf metadata-match { - type uint64; + leaf out-group { + type uint32; } - leaf metadata-write { + leaf cookie { type uint64; } - leaf config { - type oft:table-config; - } - leaf max-entries { - type uint32; + leaf cookie-mask { + type uint64; } - uses table-features-properties; - } - } - case multipart-request-experimenter { - leaf experimenter { - type uint32; - } - leaf exp-type { - type uint32; - } - } - } - } - grouping multipart-reply { - // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec" - /* Controller/switch message */ - - uses ofHeader; - - leaf type { - type oft:multipart-type; - } - leaf flags { - type oft:multipart-request-flags; - } - choice multipart-reply-body { - case multipart-reply-desc { - leaf mfr_desc { - type string; - } - leaf hw_desc { - type string; - } - leaf sw_desc { - type string; - } - leaf serial_num { - type string; - } - leaf dp_desc { - type string; + uses oxm:match-grouping; + + // OF1.0 structures + uses oxm:match-v10-grouping; } } - case multipart-reply-flow { - list flow-stats { + case multipart-request-aggregate-case { + container multipart-request-aggregate { leaf table-id { type uint8; } - leaf duration-sec { + leaf out-port { type uint32; } - leaf duration-nsec { + leaf out-group { type uint32; } - leaf priority { - type uint16; - } - leaf idle-timeout { - type uint16; - } - leaf hard-timeout { - type uint16; - } - leaf flags { - type oft:flow-mod-flags; - } leaf cookie { type uint64; } - leaf packet-count { + leaf cookie-mask { type uint64; } - leaf byte-count { - type uint64; - } - container match { - uses match; - } + uses oxm:match-grouping; + + // OF1.0 structures + uses oxm:match-v10-grouping; } } - case multipart-reply-aggregate { - leaf packet-count { - type uint64; - } - leaf byte-count { - type uint64; - } - leaf flow-count { - type uint32; + case multipart-request-table-case { + container multipart-request-table { + leaf empty { + type empty; + } } } - case multipart-reply-table { - list table-stats { - leaf table-id { - type uint8; - } - leaf active-count { + case multipart-request-port-stats-case { + container multipart-request-port-stats { + leaf port-no { type uint32; } - leaf lookup-count { - type uint64; - } - leaf matched-count { - type uint64; - } } } - case multipart-reply-port-stats { - list port-stats { + case multipart-request-queue-case { + container multipart-request-queue { leaf port-no { type uint32; } - leaf rx-packets { - type uint64; - } - leaf tx-packets { - type uint64; - } - leaf rx-bytes { - type uint64; - } - leaf tx-bytes { - type uint64; - } - leaf rx-dropped { - type uint64; - } - leaf tx-dropped { - type uint64; - } - leaf rx-errors { - type uint64; - } - leaf tx-errors { - type uint64; + leaf queue-id { + type uint32; } - leaf rx-frame-err { - type uint64; + } + } + case multipart-request-group-case { + container multipart-request-group { + leaf group-id { + type oft:group-id; } - leaf rx-over-err { - type uint64; + } + } + case multipart-request-group-desc-case { + container multipart-request-group-desc { + leaf empty { + type empty; } - leaf rx-crc-err { - type uint64; + } + } + case multipart-request-group-features-case { + container multipart-request-group-features { + leaf empty { + type empty; } - leaf collisions { - type uint64; + } + } + case multipart-request-meter-case { + container multipart-request-meter { + leaf meter-id { + type oft:meter-id; } - leaf duration-sec { - type uint32; + } + } + case multipart-request-meter-config-case { + container multipart-request-meter-config { + leaf meter-id { + type oft:meter-id; } - leaf duration-nsec { - type uint32; + } + } + case multipart-request-meter-features-case { + container multipart-request-meter-features { + leaf empty { + type empty; } } } - case multipart-reply-queue { - list queue-stats { - leaf port-no { - type uint32; + case multipart-request-table-features-case { + container multipart-request-table-features { + list table-features { + leaf table-id { + type uint8; + } + leaf name { + type string; + } + leaf metadata-match { + type uint64; + } + leaf metadata-write { + type uint64; + } + leaf config { + type oft:table-config; + } + leaf max-entries { + type uint32; + } + uses table-features-properties-grouping; } - leaf queue-id { - type uint32; + } + } + case multipart-request-port-desc-case { + container multipart-request-port-desc { + leaf empty { + type empty; } - leaf tx-bytes { - type uint64; + } + } + case multipart-request-experimenter-case { + container multipart-request-experimenter { + // empty body - used for experimenter augmentation + } + } + } + } + grouping multipart-reply { + reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"; + /* Controller/switch message */ + + uses ofHeader; + + leaf type { + type oft:multipart-type; + } + leaf flags { + type oft:multipart-request-flags; + } + choice multipart-reply-body { + case multipart-reply-desc-case { + container multipart-reply-desc { + leaf mfr_desc { + type string; } - leaf tx-packets { - type uint64; + leaf hw_desc { + type string; } - leaf tx-errors { - type uint64; + leaf sw_desc { + type string; } - leaf duration-sec { - type uint32; + leaf serial_num { + type string; } - leaf duration-nsec { - type uint32; + leaf dp_desc { + type string; } } } - case multipart-reply-group { - list group-stats { - leaf group-id { - type uint32; - } - leaf ref-count { - type uint32; + case multipart-reply-flow-case { + container multipart-reply-flow { + list flow-stats { + leaf table-id { + type uint8; + } + leaf duration-sec { + type uint32; + } + leaf duration-nsec { + type uint32; + } + leaf priority { + type uint16; + } + leaf idle-timeout { + type uint16; + } + leaf hard-timeout { + type uint16; + } + leaf flags { + type oft:flow-mod-flags; + } + leaf cookie { + type uint64; + } + leaf packet-count { + type uint64; + } + leaf byte-count { + type uint64; + } + uses oxm:match-grouping; + + uses ofinstruction:instructions-grouping; + + // OF1.0 structures + uses oxm:match-v10-grouping; + uses ofaction:actions-grouping; } + } + } + case multipart-reply-aggregate-case { + container multipart-reply-aggregate { leaf packet-count { type uint64; } leaf byte-count { type uint64; } - leaf duration-sec { - type uint32; - } - leaf duration-nsec { + leaf flow-count { type uint32; } - list bucket-stats { - leaf packet-count { + } + } + case multipart-reply-table-case { + container multipart-reply-table { + list table-stats { + leaf table-id { + type uint8; + } + leaf active-count { + type uint32; + } + leaf lookup-count { type uint64; } - leaf byte-count { + leaf matched-count { type uint64; } + + // OF1.0 structures + leaf name { + type string; + } + leaf wildcards { + type oft:flow-wildcards-v10; + } + leaf nw-src-mask { + type uint8; + } + leaf nw-dst-mask { + type uint8; + } + leaf max-entries { + type uint32; + } } } } - case multipart-reply-group-desc { - list group-desc { - leaf type { - //type uint8; - type oft:group-type; - } - leaf group-id { - type uint32; - } - list buckets { - uses bucket; + case multipart-reply-port-stats-case { + container multipart-reply-port-stats { + list port-stats { + leaf port-no { + type uint32; + } + leaf rx-packets { + type uint64; + } + leaf tx-packets { + type uint64; + } + leaf rx-bytes { + type uint64; + } + leaf tx-bytes { + type uint64; + } + leaf rx-dropped { + type uint64; + } + leaf tx-dropped { + type uint64; + } + leaf rx-errors { + type uint64; + } + leaf tx-errors { + type uint64; + } + leaf rx-frame-err { + type uint64; + } + leaf rx-over-err { + type uint64; + } + leaf rx-crc-err { + type uint64; + } + leaf collisions { + type uint64; + } + leaf duration-sec { + type uint32; + } + leaf duration-nsec { + type uint32; + } } } } - case multipart-reply-group-features { - leaf types { - type oft:group-types; - } - leaf capabilities { - type oft:group-capabilities; - } - leaf-list max_groups { - type uint32; - } - //leaf-list actions { - // type ofaction:action-type; - //} - list actions-list { - uses ofaction:action-header; + case multipart-reply-queue-case { + container multipart-reply-queue { + list queue-stats { + leaf port-no { + type uint32; + } + leaf queue-id { + type uint32; + } + leaf tx-bytes { + type uint64; + } + leaf tx-packets { + type uint64; + } + leaf tx-errors { + type uint64; + } + leaf duration-sec { + type uint32; + } + leaf duration-nsec { + type uint32; + } + } } } - case multipart-reply-meter { - list meter-stats { - leaf meter-id { - type uint32; + case multipart-reply-group-case { + container multipart-reply-group { + list group-stats { + leaf group-id { + type oft:group-id; + } + leaf ref-count { + type uint32; + } + leaf packet-count { + type uint64; + } + leaf byte-count { + type uint64; + } + leaf duration-sec { + type uint32; + } + leaf duration-nsec { + type uint32; + } + list bucket-stats { + leaf packet-count { + type uint64; + } + leaf byte-count { + type uint64; + } + } } - leaf flow-count { - type uint32; + } + } + case multipart-reply-group-desc-case { + container multipart-reply-group-desc { + list group-desc { + leaf type { + type oft:group-type; + } + leaf group-id { + type oft:group-id; + } + uses buckets-grouping; } - leaf packet-in-count { - type uint64; + } + } + case multipart-reply-group-features-case { + container multipart-reply-group-features { + leaf types { + type oft:group-types; } - leaf byte-in-count { - type uint64; + leaf capabilities { + type oft:group-capabilities; } - leaf duration-sec { + leaf-list max_groups { type uint32; } - leaf duration-nsec { - type uint32; + leaf-list actions-bitmap { + type oft:action-type; } - list meter-band-stats { - leaf packet-band-count { + } + } + case multipart-reply-meter-case { + container multipart-reply-meter { + list meter-stats { + leaf meter-id { + type oft:meter-id; + } + leaf flow-count { + type uint32; + } + leaf packet-in-count { type uint64; } - leaf byte-band-count { + leaf byte-in-count { type uint64; } + leaf duration-sec { + type uint32; + } + leaf duration-nsec { + type uint32; + } + list meter-band-stats { + leaf packet-band-count { + type uint64; + } + leaf byte-band-count { + type uint64; + } + } } } } - case multipart-reply-meter-config { - list meter-config { - leaf flags { - type oft:meter-mod-command; - } - leaf meter-id { - type uint32; - } - list bands { - uses meter-band-header; + case multipart-reply-meter-config-case { + container multipart-reply-meter-config { + list meter-config { + leaf flags { + type oft:meter-flags; + } + leaf meter-id { + type oft:meter-id; + } + list bands { + uses meter-band-header; + } } } } - case multipart-reply-meter-features { - leaf max-meter { - type uint32; - } - leaf band-types { - type oft:meter-band-type; - } - leaf capabilities { - type oft:meter-flags; - } - leaf max-bands { - type uint8; - } - leaf max-color { - type uint8; - } - } - case multipart-reply-table-features { - list table-features { - leaf table-id { - type uint8; + case multipart-reply-meter-features-case { + container multipart-reply-meter-features { + leaf max-meter { + type uint32; } - leaf name { - type string; + leaf band-types { + type oft:meter-band-type-bitmap; } - leaf metadata-match { - type binary; + leaf capabilities { + type oft:meter-flags; } - leaf metadata-write { - type binary; + leaf max-bands { + type uint8; } - leaf config { - type oft:port-config; - } - leaf max-entries { - type uint32; + leaf max-color { + type uint8; } } } - case multipart-reply-port-desc { - list ports { - uses port; + case multipart-reply-table-features-case { + container multipart-reply-table-features { + list table-features { + leaf table-id { + type uint8; + } + leaf name { + type string; + } + leaf metadata-match { + type binary; + } + leaf metadata-write { + type binary; + } + leaf config { + type oft:table-config; + } + leaf max-entries { + type uint32; + } + uses table-features-properties-grouping; + } } } - case multipart-reply-experimenter { - leaf experimenter { - type uint32; + case multipart-reply-port-desc-case { + container multipart-reply-port-desc { + list ports { + uses port-grouping; + } } - leaf exp-type { - type uint32; + } + case multipart-reply-experimenter-case { + container multipart-reply-experimenter { + // empty body - used for experimenter augmentation } } } } /* Barrier messages. */ grouping barrier-request { - // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; } grouping barrier-reply { - // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; } /* Queue Configuration messages. */ grouping queue-get-config-request { - // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -936,7 +1074,7 @@ module openflow-protocol { } } grouping queue-get-config-reply { - // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -947,7 +1085,7 @@ module openflow-protocol { list queues { uses packet-queue; } - } + } grouping packet-queue { leaf queue-id { type oft:queue-id; @@ -955,18 +1093,22 @@ module openflow-protocol { leaf port { type oft:port-number; } - list properties { - uses queue-property-header; - } + uses queue-property-header; + } + container queue-prop-container { + uses queue-property-header; } grouping queue-property-header { - leaf property { - type oft:queue-property; + list queue-property { + config false; + leaf property { + type oft:queue-properties; + } } } /* Controller role change request messages. */ grouping role-request { - // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -979,7 +1121,7 @@ module openflow-protocol { } } grouping role-reply { - // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -993,17 +1135,27 @@ module openflow-protocol { } /* Asynchronous message configuration. */ grouping get-async-request { - // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - uses ofHeader; + uses ofHeader; } grouping get-async-reply { - // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec" + reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; + uses async-body-grouping; + } + grouping set-async { + reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"; + /* Controller/switch message */ + uses ofHeader; + uses async-body-grouping; + } + + grouping async-body-grouping { list packet-in-mask { leaf-list mask { type oft:packet-in-reason; @@ -1019,26 +1171,10 @@ module openflow-protocol { type oft:flow-removed-reason; } } - } - grouping set-async { - // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec" - /* Controller/switch message */ - - uses ofHeader; - - leaf-list packet-in-mask { - type oft:packet-in-reason; - } - leaf-list port-status-mask { - type oft:port-reason; - } - leaf-list flow-removed-mask { - type oft:flow-removed-reason; - } - } + } /* Meters and rate limiters configuration messages. */ grouping meter-mod { - // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec" + reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; @@ -1048,30 +1184,36 @@ module openflow-protocol { } leaf flags { type oft:meter-flags; - } + } leaf meter-id { type oft:meter-id; - } + } list bands { uses meter-band-header; } - } + } + container meter-band-container { + uses meter-band-header; + } grouping meter-band-header { choice meter-band { - case meter-band-drop { - uses meter-band-commons; + case meter-band-drop-case { + container meter-band-drop { + uses meter-band-commons; + } } - case meter-band-dscp-remark { - uses meter-band-commons; - leaf prec-level { - type uint8; + case meter-band-dscp-remark-case { + container meter-band-dscp-remark { + uses meter-band-commons; + leaf prec-level { + type uint8; + } } } - case meter-band-experimenter { - uses meter-band-commons; - leaf experimenter { - type uint32; + case meter-band-experimenter-case { + container meter-band-experimenter { + uses meter-band-commons; } } } @@ -1089,36 +1231,34 @@ module openflow-protocol { } } - /* Immutable messages. */ notification hello-message { uses hello; - // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec" + reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"; /* Symmetric message */ } notification error-message { uses error; - // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec" + reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"; /* Symmetric message */ } notification echo-request-message { uses echo-request; - // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec" + reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"; /* Symmetric message */ } notification experimenter-message { uses experimenter; - // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec" + 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; } @@ -1129,21 +1269,18 @@ module openflow-protocol { } 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; } @@ -1151,7 +1288,6 @@ module openflow-protocol { /* Switch configuration messages. */ rpc get-features { - // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec" input { uses features-request; } @@ -1162,7 +1298,6 @@ module openflow-protocol { } rpc get-config { - // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec" input { uses get-config-request; } @@ -1173,7 +1308,6 @@ module openflow-protocol { } rpc set-config { - // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec" input { uses set-config; } @@ -1182,19 +1316,16 @@ module openflow-protocol { /* Asynchronous messages. */ notification packet-in-message { uses packet-in; - // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec" /* Async message */ } notification flow-removed-message { uses flow-removed; - // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec" /* Async message */ } notification port-status-message { uses port-status; - // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec" } /* Async message */ @@ -1202,50 +1333,45 @@ module openflow-protocol { rpc packet-out { input { uses packet-out; - // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec" } /* Controller/switch message */ } rpc flow-mod { input { uses flow-mod; - // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec" } /* Controller/switch message */ } rpc group-mod { input { uses group-mod; - // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec" } /* Controller/switch message */ } rpc port-mod { input { uses port-mod; - // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec" } } /* Controller/switch message */ rpc table-mod { input { uses table-mod; - // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec" } } /* Controller/switch message */ /* Multipart messages. */ - //FIXME: Arent this wire protocol specific? - notification multipart-request-message { - uses multipart-request; - // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec" - - } /* Controller/switch message */ + rpc multipart-request { + input { + uses multipart-request; + } + } + + /* Controller/switch message */ notification multipart-reply-message { uses multipart-reply; - // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec" - + // notification because of multiple following responses } /* Controller/switch message */ @@ -1253,22 +1379,18 @@ module openflow-protocol { rpc barrier { input { uses barrier-request; - // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec" } output { uses barrier-reply; - // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec" } } /* Queue Configuration messages. */ rpc get-queue-config { input { uses queue-get-config-request; - // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec" } output { uses queue-get-config-reply; - // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec" } } @@ -1276,11 +1398,9 @@ module openflow-protocol { rpc role-request { input { uses role-request; - // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec" } output { uses role-reply; - // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec" } } /* Controller/switch message */ @@ -1288,18 +1408,15 @@ module openflow-protocol { rpc get-async { input { uses get-async-request; - // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec" } output { uses get-async-reply; - // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec" } } /* Controller/switch message */ rpc set-async { input { uses set-async; - // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec" } } @@ -1307,7 +1424,6 @@ module openflow-protocol { rpc meter-mod { input { uses meter-mod; - // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec" } } /* Controller/switch message */ } \ No newline at end of file