aboutsummaryrefslogtreecommitdiff
path: root/lib/ofp-errors.h
AgeCommit message (Collapse)Author
2013-08-27ofp-util: Abstract flow_mod OFPFF_* flags.Ben Pfaff
The OFPFF_* flags used in flow_mods are just confusing enough that it seems worthwhile to try to abstract them out. In particular: * OFPFF_EMERG was introduced in OF1.0, deleted in OF1.1, and then its bit was reused for a different purpose in OF1.2. * OFPFF_RESET_COUNTS was introduced in OF1.2 but the semantics that it specifies are implied by "add" commands in earlier versions, so proper translation requires the OpenFlow version number and flow_mod command. This commit does the abstraction. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-23meta-flow: Use correct OF1.2+ errors for invalid fields in actions.Ben Pfaff
OFPERR_OFPBAC_BAD_ARGUMENT is not as specific as the errors provided by OpenFlow 1.2 and later. Some of these errors needed Nicira extension numbers for use with OpenFlow 1.0 and 1.1, so this commit also adds those. Some of these errors had poor explanations likely to confuse users, so this commits improves them. Some of the errors had the wrong names, so this commit fixes them. Reported-by: Jean Tourrilhes <jt@hpl.hp.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jean Tourrilhes <jt@hpl.hp.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2013-06-28ofp-errors: Fix typos in error enumeration names.Ben Pfaff
OFPGMFC is so nice these constants said it twice. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-25ofp-errors: New error code ONFBIC_DUP_INSTRUCTION.Ben Pfaff
This is a prototype of OpenFlow enhancement proposal EXT-260 "Add error code for duplicate instruction." It uses the error code proposed there. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-25ofp-errors: Implement OpenFlow 1.2+ experimenter error codes.Ben Pfaff
OpenFlow 1.2 standardized experimenter error codes in a way different from the Nicira extension. This commit implements the OpenFlow 1.2+ version. This commit also makes it easy to add error codes for new experimenter IDs by adding new *_VENDOR_ID definitions to openflow-common.h. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-21ofp-errors: Make ofperr_decode() static.Ben Pfaff
It had no users outside of ofp-errors.c. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-21ofp-errors: Fix typos in comment.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-12-04ofp-errors: Make every error encodable.Ben Pfaff
Until now, some values could not be encoded to send over OpenFlow, for a few possible reasons. This meant that, when one of these situations came up, that a controller would not receive any notification that its request failed. This is not a good way to behave, so this commit changes the error encoder so that, if a particular error cannot be encoded, it will instead encode a fallback error code. This commit also slightly simplifies ofconn_send_error() because it no longer has to handle ofperr_encode_error() returning NULL. Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-12-04ofp-errors: Remove OFPERR_* values for error categories.Jarno Rajahalme
The main use of OFPERR_* is to define specific errors, but OFPERR_* also existed for each possible category of error, to enable partial decoding of unknown specific errors within a known category. However, in practice, it was very easy to misuse the error categories as if they were particular errors. This commit removes the error category values, to make that error impossible. (If partial decoding of unknown specific errors turns out to have been a valuable feature, then we can reintroduce it some other way.) Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-12-04ofp-errors: Correctly encode errors as extensions or not depending on domain.Ben Pfaff
When ofp-errors was introduced, each OFPERR_* was either an extension or not. However, since then, some Nicira extension error code have been given official error codes in later OpenFlow versions, so now whether an OFPERR_* is an extension depends on the OpenFlow versions. This means that certain errors were encoded incorrectly as extensions in later OpenFlow versions. This commit fixes the problem. This commit also adds a test that should prevent a regression. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-12-04Don't use error categories as if they were actually errors.Jarno Rajahalme
The OFPERR_* naming scheme is confusing, because it mixes categories with specific errors. Categories can't be encoded for sending to controllers, so this is a problem. This commit fixes up the cases where categories were used as errors, replacing them by real errors types. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-11-27Initial OpenFlow 1.3 supportJarno Rajahalme
Initial OpenFlow 1.3 support with new include/openflow/openflow-1.3.h. Most of the messages that differ from 1.2 are implemented. OFPT_SET_ASYNC is implemented via NX_SET_ASYNC_CONFIG, other new message types are yet to be implemented. Stats replies that add duration fields are implemented at encode/decode level only. Test cases for implemented features are included. Remaining FIXME:s should not cause runtime aborts. Make check comes out clean. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-10-13ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".Ben Pfaff
These codes represent essentially the same condition and only one of them exists in any given version of OpenFlow, so merge them together into a single OFPERR_* code. Reported-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-05ofp-errors: Use OFPERR_OFPBRC_BAD_TABLE_IDSimon Horman
* In the case of OpenFlow 1.1+ OFPERR_OFPBRC_BAD_TABLE_ID is defined in the specification and seems to be the most appropriate error to use when an unknown table id is encountered. * In the case of OpenFlow 1.0 no appropriate error message seems to exist. Perhaps because an invalid port is not possible? I'm unsure. In any case, make use of a non-standard error code (1,512). This was formerly known as OFPERR_NXBRC_BAD_TABLE_ID but has been rolled into OFPERR_OFPBRC_BAD_TABLE_ID to allow the latter to be used without concern for the prevailing Open Flow version. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-05ofp-errors: Use OFPERR_OFPBRC_BAD_PORTSimon Horman
* In the case of OpenFlow 1.2+ OFPERR_OFPBRC_BAD_PORT is defined in the specification and seems to be the most appropriate error to use when an invalid port is encountered in a Packet Out request. * In the case of OpenFlow 1.0 and 1.1 no appropriate error message seems to exist. Perhaps because an invalid port is not possible? I'm unsure. In any case, make use of a non-standard error code (1,514). This was formerly known as OFPERR_NXBRC_BAD_IN_PORT but has been rolled into OFPERR_NXBRC_BAD_IN_PORT to allow the latter to be used without concern for the prevailing Open Flow version. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-05ofp-errors: Ignore text enclosed in square bracketsSimon Horman
Enhance to extract-ofp-errors to omit text enclosed in square brackets from error description. This allows some commentary other than the error description to be supplied in ofp-errors.h As suggested by Ben Pfaff <blp@nicira.com> Signed-off-by: Simon Horman <horms@verge.net.au> [blp@nicira.com added the large comment on enum ofperr.] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04ofp-errors: Use standardised code for OFPERR_OFPBMC_BAD_VALUESimon Horman
Use standardised code for Open Flow 1.1 OFPERR_OFPBMC_BAD_VALUE OFPERR_OFPBMC_BAD_VALUE is defined in Open Flow 1.1 as (4,7), so use that code instead of a non-standard one. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04ofp-errors: Remove OFPERR_NXFMFC_GROUPS_NOT_SUPPORTEDSimon Horman
OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED is currently only used in paths which are part of a non-NX extension portions of the Open Flow 1.1+ implementation. After recent discussion it has been decided to attempt to only use standardised, albeit lest-specify, errors unless errors arise from use of an NX extension. With the above in mind it seems appropriate to: * Use OFPERR_OFPFMFC_UNKNOWN in place of OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED. * Remove OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED as it is no longer used. An unfortunate side-effect of this change is that the error for the case in question is now less-specific. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04ofp-errors: Remove OFPERR_NXBIC_DUP_TYPESimon Horman
OFPERR_NXBIC_DUP_TYPE is currently only used in decode_openflow11_instructions() which is part of a non-NX extension portion of the Open Flow 1.1+ implementation. After recent discussion it has been decided to attempt to only use standardised, albeit less-specific, errors unless errors arise from use of an NX extension. With the above in mind it seems appropriate to: * Use OFPERR_OFPIT_BAD_INSTRUCTION in place of OFPERR_NXBIC_DUP_TYPE. * Remove OFPERR_NXBIC_DUP_TYPE as it is no longer used. An unfortunate side-effect of this change is that the error for the case in question is now less-specific. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-06ofp-error: Remove ofperr_domain from external APISimon Horman
It seems that ofp_version suffices in all cases. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-06ofp-util: Make ofperr_encode_msg__() use correct Open Flow versionSimon Horman
Make ofperr_encode_msg__() use correct Open Flow version in the header of messages. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-30ofp-util: Work on decoding OF1.1 flow_mods.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Tested-by: Simon Horman <horms@verge.net.au> Reviewed-by: Simon Horman <horms@verge.net.au>
2012-07-30ofp-msgs: New approach to encoding and decoding OpenFlow headers.Ben Pfaff
OpenFlow headers are not as uniform as they could be, with size, alignment, and numbering changes from one version to another and across varieties (e.g. ordinary messages vs. "stats" messages). Until now the Open vSwitch internal APIs haven't done a good job of abstracting those differences in header formats. This commit changes that; from this commit forward very little code actually needs to understand the header format or numbering. Instead, it can just encode or decode, or pull or put, the header using a more abstract API using the ofpraw_, ofptype_, and other APIs in the new ofp-msgs module. Signed-off-by: Ben Pfaff <blp@nicira.com> Tested-by: Simon Horman <horms@verge.net.au> Reviewed-by: Simon Horman <horms@verge.net.au>
2012-07-12ofproto: New feature to notify controllers of flow table changes.Ben Pfaff
OpenFlow switching monitoring and controller coordination can be made more efficient if the switch can notify a controller of flow table changes as they occur, rather than periodically polling for changes. This commit implements such a feature. Feature #6633. CC: Natasha Gude <natasha@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-03ofp-actions: Add decoding and encoding OF1.1 instructions and actions.Ben Pfaff
So far, only the Apply-Actions instruction is supported, and only actions that have identical semantics to OpenFlow 1.0 actions. Co-authored-by: Simon Horman <horms@verge.net.au> Co-authored-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-27Add error codes for Open Flow v1.2Simon Horman
* Where Open Flow 1.2 breaks apart error codes defined in previous versions, provide all new definitions to previous versions and map the numeric error code to the first first definition supplied in ofp-errors.h. The case handled so far is: OFPERR_OFPBIC_BAD_EXP_TYPE -> { OFPERR_OFPBIC_BAD_EXPERIMENTER, OFPERR_OFPBIC_BAD_EXP_TYPE } * Where Open Flow 1.2 adds error codes that were previously defined as Nicira extension errors define the later in terms of the new codes. Signed-off-by: Simon Horman <horms@verge.net.au> [blp@nicira.com added better error checking in extract-ofp-errors, added unit tests, miscellaneous cleanup] Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
2012-03-27ofp-errors: Use OF1.1+ in place of OF1.1 throughout.Ben Pfaff
In general, I guess that the common case is for most error codes to be retained without change in future versions of OpenFlow, so to me it seems best to use the "+" version "by default". Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
2012-03-27ofp-errors: Rename "OF" to "OF1.0+", "NX" to "NX1.0+".Ben Pfaff
This seems like a more reasonable way to do things given that we will soon need "OpenFlow 1.1 and later" and "OpenFlow 1.1 only" keywords. Signed-off-by: Ben Pfaff <blp@nicira.com> Reviewed-by: Simon Horman <horms@verge.net.au>
2012-03-07Abstract everything that uses ofp_phy_port, add OF1.1 support.Ben Pfaff
Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-27Add ability to direct "packet-in"s to particular controllers.Ben Pfaff
Nicira's controllers are somewhat heterogeneous, so that particular "packet-in" messages should be directed to particular controllers. This new Nicira extension action allows designating a controller or controllers to receive the "packet-in" using a 16-bit integer ID. The new NXAST_CONTROLLER action also specifies the "reason" code to include in the "packet-in" message. This is particularly useful for simulating a "no-match" "packet-in" using a rule. Feature #8946. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-12Better abstract OpenFlow error codes.Ben Pfaff
This commit switches from using the actual protocol values of error codes internally in Open vSwitch, to using abstract values that are translated to and from protocol values at message parsing and serialization time. I believe that this makes the code easier to read and to write. This is also one step along the way toward OpenFlow 1.1 support because OpenFlow 1.1 renumbered a bunch of error codes. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-12Automatically extract error types and codes for formatting.Ben Pfaff