Signed-off-by: Simon Horman <[email protected]>
---
build-aux/extract-ofp-errors | 23 ++++++---
lib/ofp-errors.h | 101 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 115 insertions(+), 9 deletions(-)
diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index 5c3cd26..765e079 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -145,7 +145,7 @@ def extract_ofp_errors(filenames):
names = []
domain = {}
reverse = {}
- for domain_name in ("OF1.0", "OF1.1", "NX1.0", "NX1.1"):
+ for domain_name in ("OF1.0", "OF1.1", "OF1.2", "NX1.0", "NX1.1"):
domain[domain_name] = {}
reverse[domain_name] = {}
@@ -194,22 +194,28 @@ def extract_ofp_errors(filenames):
names.append(enum)
for dst in dsts.split(', '):
- m = re.match(r'([A-Z0-9.]+)\((\d+)(?:,(\d+))?\)$', dst)
+ m =
re.match(r'([A-Z0-9.]+(?:only)?)\((\d+|(0x)[0-9a-fA-F]+)(?:,(\d+))?\)$', dst)
if not m:
fatal("%s: syntax error in destination" % dst)
targets = m.group(1)
- type_ = int(m.group(2))
if m.group(3):
- code = int(m.group(3))
+ base = 16
+ else:
+ base = 10
+ type_ = int(m.group(2), base)
+ if m.group(4):
+ code = int(m.group(4))
else:
code = None
- target_map = {"OF": ("OF1.0", "OF1.1"),
+ target_map = {"OF": ("OF1.0", "OF1.1", "OF1.2"),
"OF1.0": ("OF1.0",),
- "OF1.1": ("OF1.1",),
- "NX": ("OF1.0", "OF1.1"),
+ "OF1.1only": ("OF1.1",),
+ "OF1.1": ("OF1.1", "OF1.2"),
+ "NX": ("OF1.0", "OF1.1", "OF1.2"),
"NX1.0": ("OF1.0",),
- "NX1.1": ("OF1.1",)}
+ "NX1.1": ("OF1.1",),
+ "OF1.2": ("OF1.2",)};
if targets not in target_map:
fatal("%s: unknown error domain" % target)
for target in target_map[targets]:
@@ -306,6 +312,7 @@ const struct ofperr_domain %s = {
output_domain(reverse["OF1.0"], "ofperr_of10", "OpenFlow 1.0", 0x01)
output_domain(reverse["OF1.1"], "ofperr_of11", "OpenFlow 1.1", 0x02)
+ output_domain(reverse["OF1.2"], "ofperr_of12", "OpenFlow 1.2", 0x03)
if __name__ == '__main__':
if '--help' in sys.argv:
diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h
index cef32f2..5062f3e 100644
--- a/lib/ofp-errors.h
+++ b/lib/ofp-errors.h
@@ -95,6 +95,15 @@ enum ofperr {
/* OF1.1(1,9). Specified table-id invalid or does not exist. */
OFPERR_OFPBRC_BAD_TABLE_ID,
+ /* OF1.2(1,10). Denied because controller is slave. */
+ OFPERR_OFPBRC_IS_SLAVE,
+
+ /* OF1.2(1,11). Invalid port. */
+ OFPERR_OFPBRC_BAD_PORT,
+
+ /* OF1.2(1,12). Invalid packet in packet-out. */
+ OFPERR_OFPBRC_BAD_PACKET,
+
/* NX(1,256). Invalid NXM flow match. */
OFPERR_NXBRC_NXM_INVALID,
@@ -176,6 +185,15 @@ enum ofperr {
/* OF1.1(2,12). Actions uses an unsupported tag/encap. */
OFPERR_OFPBAC_BAD_TAG,
+ /* OF1.2(2,13). Unsupported type in SET_FIELD action. */
+ OFPERR_OFPBAC_SET_TYPE,
+
+ /* OF1.2(2,14). Length problem in SET_FIELD action. */
+ OFPERR_OFPBAC_SET_LEN,
+
+ /* OF1.2(2,15). Bad argument in SET_FIELD action. */
+ OFPERR_OFPBAC_ARGUMENT,
+
/* NX(2,256). Must-be-zero action argument had nonzero value. */
OFPERR_NXBAC_MUST_BE_ZERO,
@@ -201,9 +219,21 @@ enum ofperr {
/* OF1.1(3,4). Metadata mask value unsupported by datapath. */
OFPERR_OFPBIC_UNSUP_METADATA_MASK,
- /* OF1.1(3,5). Specific experimenter instruction unsupported. */
+ /* OF1.1only(3,5). Specific experimenter instruction unsupported. */
OFPERR_OFPBIC_UNSUP_EXP_INST,
+ /* OF1.2(3,5). Unknown experimenter id specified. */
+ OFPERR_OFPBIC_BAD_EXPERIMENTER,
+
+ /* OF1.2(3,6). Unknown instruction for experimenter id. */
+ OFPERR_OFPBIC_BAD_EXP_TYPE,
+
+ /* OF1.2(3,7). Length problem in instructions. */
+ OFPERR_OFPBIC_BAD_LEN,
+
+ /* OF1.2(3,8). Permissions error. */
+ OFPERR_OFPBIC_EPERM,
+
/* ## --------------- ## */
/* ## OFPET_BAD_MATCH ## */
/* ## --------------- ## */
@@ -237,6 +267,19 @@ enum ofperr {
/* OF1.1(4,7). Unsupported value in a match field. */
OFPERR_OFPBMC_BAD_VALUE,
+ /* OF1.2(4,8). Unsupported mask specified in the match,
+ field is not dl-address or nw-address. */
+ OFPERR_OFPBMC_BAD_MASK,
+
+ /* OF1.2(4,9). A prerequisite was not met. */
+ OFPERR_OFPBMC_BAD_PREREQ,
+
+ /* OF1.2(4,10). A field type was duplicated. */
+ OFPERR_OFPBMC_DUP_FIELD,
+
+ /* OF1.2(4,11). Permissions error. */
+ OFPERR_OFPBMC_EPERM,
+
/* ## --------------------- ## */
/* ## OFPET_FLOW_MOD_FAILED ## */
/* ## --------------------- ## */
@@ -272,6 +315,9 @@ enum ofperr {
/* OF1.0(3,4), OF1.1(5,6). Unsupported or unknown command. */
OFPERR_OFPFMFC_BAD_COMMAND,
+ /* OF1.2(5,7). Unsupported or unknown flags. */
+ OFPERR_OFPFMFC_BAD_FLAGS,
+
/* OF1.0(3,5). Unsupported action list - cannot process in the order
* specified. */
OFPERR_OFPFMFC_UNSUPPORTED,
@@ -323,6 +369,25 @@ enum ofperr {
* modify a non-existent group. */
OFPERR_OFPGMFC_UNKNOWN_GROUP,
+ /* OF1.2(6,9). Group not deleted because another
+ group is forwarding to it. */
+ OFPERR_OFPGMFC_CHAINED_GROUP,
+
+ /* OF1.2(6,10). Unsupported or unknown group type. */
+ OFPERR_OFPGMFC_BAD_TYPE,
+
+ /* OF1.2(6,11). Unsupported or unknown command. */
+ OFPERR_OFPGMFC_BAD_COMMAND,
+
+ /* OF1.2(6,12). Error in bucket. */
+ OFPERR_OFPGMFC_OFPGMFC_BAD_BUCKET,
+
+ /* OF1.2(6,13). Error in watch port/group. */
+ OFPERR_OFPGMFC_OFPGMFC_BAD_WATCH,
+
+ /* OF1.2(6,14). Permissions error. */
+ OFPERR_OFPGMFC_OFPGMFC_EPERM,
+
/* ## --------------------- ## */
/* ## OFPET_PORT_MOD_FAILED ## */
/* ## --------------------- ## */
@@ -343,6 +408,9 @@ enum ofperr {
/* OF1.1(7,3). Specified advertise is invalid. */
OFPERR_OFPPMFC_BAD_ADVERTISE,
+ /* OF1.2(7,4). Permissions error. */
+ OFPERR_OFPPMFC_EPERM,
+
/* ## ---------------------- ## */
/* ## OFPET_TABLE_MOD_FAILED ## */
/* ## ---------------------- ## */
@@ -356,6 +424,9 @@ enum ofperr {
/* OF1.1(8,1). Specified config is invalid. */
OFPERR_OFPTMFC_BAD_CONFIG,
+ /* OF1.2(8,2). Permissions error. */
+ OFPERR_OFPTMFC_EPERM,
+
/* ## --------------------- ## */
/* ## OFPET_QUEUE_OP_FAILED ## */
/* ## --------------------- ## */
@@ -384,10 +455,38 @@ enum ofperr {
/* OF1.1(10,1). Specified len is invalid. */
OFPERR_OFPSCFC_BAD_LEN,
+
+ /* OF1.2(10,2). Permissions error. */
+ OFPERR_OFPSCFC_EPERM,
+
+/* ## ------------------------- ## */
+/* ## OFPET_ROLE_REQUEST_FAILED ## */
+/* ## ------------------------- ## */
+
+ /* OF1.2(11). Controller Role request failed. */
+ OFPERR_OFPET_ROLE_REQUEST_FAILED,
+
+ /* OF1.2(11,0). Stale Message: old generation_id. */
+ OFPERR_OFPRRFC_STALE,
+
+ /* OF1.2(11,1). Controller role change unsupported. */
+ OFPERR_OFPRRFC_UNSUP,
+
+ /* OF1.2(11,2). Invalid role. */
+ OFPERR_OFPERR_BAD_ROLE,
+
+
+/* ## ------------------ ## */
+/* ## OFPET_EXPERIMENTER ## */
+/* ## ------------------ ## */
+
+ /* OF1.2(0xffff). Experimenter error messages. */
+ OFPERR_OFPET_EXPERIMENTER,
};
extern const struct ofperr_domain ofperr_of10;
extern const struct ofperr_domain ofperr_of11;
+extern const struct ofperr_domain ofperr_of12;
const struct ofperr_domain *ofperr_domain_from_version(uint8_t version);
--
1.7.6.3
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev