From f4104c68823df93064b8997e5ca0e0564704bc87 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 24 Jun 2013 13:49:47 -0700 Subject: [PATCH] ofp-errors: New error code ONFBIC_DUP_INSTRUCTION. 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 --- lib/ofp-actions.c | 4 +--- lib/ofp-errors.h | 3 +++ tests/ofp-actions.at | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 99494a277..34a700b88 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -1003,9 +1003,7 @@ decode_openflow11_instructions(const struct ofp11_instruction insts[], } if (out[type]) { - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; /* No specific code for - * a duplicate instruction - * exist */ + return OFPERR_ONFBIC_DUP_INSTRUCTION; } out[type] = inst; } diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index d14479364..17f8bce16 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -268,6 +268,9 @@ enum ofperr { /* OF1.2+(3,8). Permissions error. */ OFPERR_OFPBIC_EPERM, + /* ONF1.1+(2600). Duplicate instruction. */ + OFPERR_ONFBIC_DUP_INSTRUCTION, + /* ## --------------- ## */ /* ## OFPET_BAD_MATCH ## */ /* ## --------------- ## */ diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index b455bb933..ebad040a2 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -339,7 +339,7 @@ dnl Check that an empty Apply-Actions instruction gets dropped. 0004 0008 00000000 dnl Duplicate instruction type: -# bad OF1.1 instructions: OFPBAC_UNSUPPORTED_ORDER +# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION 0004 0008 00000000 0004 0008 00000000 dnl Instructions not multiple of 8 in length. @@ -381,7 +381,7 @@ dnl Write-Metadata too long. 0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000 dnl Write-Metadata duplicated. -# bad OF1.1 instructions: OFPBAC_UNSUPPORTED_ORDER +# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 dnl Write-Metadata in wrong position (OpenFlow 1.1+ disregards the order -- 2.43.0