From e9353ae079bc6d8ab1c3c3c249bc92a9ebd8d1e9 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Thu, 11 Jun 2009 19:16:29 -0700 Subject: [PATCH] Spec: Add _EPERM error codes An OpenFlow hypervisor might choose to reject an OpenFlow request, but currently has no message type defined for this error. It is not a vendor-specific error, thus we define an _EPERM error code for each error type. Also remove unused, commented-out text. --- doc/of-spec/appendix.tex | 14 +++++--------- include/openflow/openflow.h | 14 +++++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/of-spec/appendix.tex b/doc/of-spec/appendix.tex index 8fc0014..583ec4e 100755 --- a/doc/of-spec/appendix.tex +++ b/doc/of-spec/appendix.tex @@ -277,10 +277,12 @@ There are times that the switch needs to notify the controller of a problem. Th \input{struct/ofp_error_msg} The \verb|type| value indicates the high-level type of error. The \verb|code| value is interpreted based on the type. The \verb|data| is variable length and interpreted based on the \verb|type| and \verb|code|; in most cases this is the message that caused the problem. \\\\ +Error codes ending in \verb|_EPERM| correspond to a permissions error generated by an entity between a controller and switch, such as an OpenFlow hypervisor. +\\\\ Currently defined error types are: \input{enum/ofp_error_type} -For the \verb|OFPET_HELLO_FAILED| error \verb|type|, one \verb|code| is currently defined: +For the \verb|OFPET_HELLO_FAILED| error \verb|type|, the following \verb|code|s are currently defined: \input{enum/ofp_hello_failed_code} The \verb|data| field contains an ASCII text string that adds detail on why the error occurred. @@ -295,18 +297,12 @@ For the \verb|OFPET_BAD_ACTION| error \verb|type|, the following \verb|code|s ar \input{enum/ofp_bad_action_code} The \verb|data| field contains at least 64 bytes of the failed request. \\\\ -For the \verb|OFPET_FLOW_MOD_FAILED| error \verb|type|, one \verb|code| is currently defined: +For the \verb|OFPET_FLOW_MOD_FAILED| error \verb|type|, the following \verb|code|s are currently defined: \input{enum/ofp_flow_mod_failed_code} The \verb|data| field contains at least 64 bytes of the failed request. \\\\ -If the error message is in response to a specific message from the controller, e.g., \verb|OFPET_BAD_REQUEST|, \verb|OFPET_BAD_ACTION|, or \verb|OFPET_FLOW_MOD_FAILED|, then the The \verb|xid| field of the header should match that of the offending message. - -%If the controller attempts a \verb|flow_mod| and fails, and the \verb|flow_mod| entry had the \verb|REPORT_ERROR| flag set, then the switch responds with one of the following. The data field must include the full message that failed. - -%xxx These flow errors are not supported in v0.9.0. --JDP -%\input{enum/ofp_error_flow_mod} -%If the controller attempts a \verb|port_mod| and fails, it should report an error. The \verb|data| field must include the full message that failed. +If the error message is in response to a specific message from the controller, e.g., \verb|OFPET_BAD_REQUEST|, \verb|OFPET_BAD_ACTION|, or \verb|OFPET_FLOW_MOD_FAILED|, then the \verb|xid| field of the header should match that of the offending message. \subsection{Symmetric Messages} \subsubsection{Hello} diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h index 2d221f6..fd4e1a2 100644 --- a/include/openflow/openflow.h +++ b/include/openflow/openflow.h @@ -590,7 +590,8 @@ enum ofp_error_type { /* ofp_error_msg 'code' values for OFPET_HELLO_FAILED. 'data' contains an * ASCII text string that may give failure details. */ enum ofp_hello_failed_code { - OFPHFC_INCOMPATIBLE /* No compatible version. */ + OFPHFC_INCOMPATIBLE, /* No compatible version. */ + OFPHFC_EPERM /* Permissions error. */ }; /* ofp_error_msg 'code' values for OFPET_BAD_REQUEST. 'data' contains at least @@ -601,7 +602,8 @@ enum ofp_bad_request_code { OFPBRC_BAD_STAT, /* ofp_stats_request.type not supported. */ OFPBRC_BAD_VENDOR, /* Vendor not supported (in ofp_vendor_header * or ofp_stats_request or ofp_stats_reply). */ - OFPBRC_BAD_SUBTYPE /* Vendor subtype not supported. */ + OFPBRC_BAD_SUBTYPE, /* Vendor subtype not supported. */ + OFPBRC_EPERM /* Permissions error. */ }; /* ofp_error_msg 'code' values for OFPET_BAD_ACTION. 'data' contains at least @@ -612,15 +614,17 @@ enum ofp_bad_action_code { OFPBAC_BAD_VENDOR, /* Unknown vendor id specified. */ OFPBAC_BAD_VENDOR_TYPE, /* Unknown action type for vendor id. */ OFPBAC_BAD_OUT_PORT, /* Problem validating output action. */ - OFPBAC_BAD_ARGUMENT /* Bad action argument. */ + OFPBAC_BAD_ARGUMENT, /* Bad action argument. */ + OFPBAC_EPERM /* Permissions error. */ }; /* ofp_error_msg 'code' values for OFPET_FLOW_MOD_FAILED. 'data' contains * at least the first 64 bytes of the failed request. */ enum ofp_flow_mod_failed_code { OFPFMFC_ALL_TABLES_FULL, /* Flow not added because of full tables. */ - OFPFMFC_OVERLAP /* Attempted to add overlapping flow with - * CHECK_OVERLAP flag set. */ + OFPFMFC_OVERLAP, /* Attempted to add overlapping flow with + * CHECK_OVERLAP flag set. */ + OFPFMFC_EPERM /* Permissions error. */ }; /* OFPT_ERROR: Error message (datapath -> controller). */