I don't see any need to actually report any of these errors, so this commit just adds the error codes. Since these are the first non-Nicira extension error codes in Open vSwitch, also add a test to make sure that they get correctly encoded and decoded.
Signed-off-by: Ben Pfaff <b...@nicira.com> --- lib/ofp-errors.h | 11 +++++++++++ tests/ofp-errors.at | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 0 deletions(-) diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index 3d4894a..175b6ea 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -62,6 +62,7 @@ enum ofperr { /* Experimenter codes. */ /* Experimenter NX (Nicira Networks) = 0x00002320. */ + /* Experimenter HPL (HP Labs) = 0x000004ea. */ /* Expected duplications. */ @@ -548,6 +549,16 @@ enum ofperr { /* NX(1). Duplicate instruction. */ OFPERR_NX_DUP_INSTRUCTION, + + /* HPL(140). Invalid mask in Set Async Config request. */ + OFPERR_HPL_ASYNC_INVALID, + + /* HPL(141). Switch does not support the configuration requested by Set + * Async Config. */ + OFPERR_HPL_ASYNC_UNSUPPORTED, + + /* HPL(142). Set Async Config permissions error. */ + OFPERR_HPL_ASYNC_EPERM, }; const char *ofperr_domain_get_name(enum ofp_version); diff --git a/tests/ofp-errors.at b/tests/ofp-errors.at index f39a213..4e1c549 100644 --- a/tests/ofp-errors.at +++ b/tests/ofp-errors.at @@ -161,6 +161,18 @@ AT_CHECK([ovs-ofctl ofp-print '0301001855555555 ffff0001 00002320 01020008111111 OFPT_ERROR (OF1.2) (xid=0x55555555): NX_DUP_INSTRUCTION OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload ]) +AT_CHECK([ovs-ofctl ofp-print '0101001c55555555 b0c20000 000004eaffff008c 0102000811111111'], [0], [dnl +OFPT_ERROR (xid=0x55555555): HPL_ASYNC_INVALID +OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload +]) +AT_CHECK([ovs-ofctl ofp-print '0201001c55555555 b0c20000 000004eaffff008c 0102000811111111'], [0], [dnl +OFPT_ERROR (OF1.1) (xid=0x55555555): HPL_ASYNC_INVALID +OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload +]) +AT_CHECK([ovs-ofctl ofp-print '0301001855555555 ffff008c 000004ea 0102000811111111'], [0], [dnl +OFPT_ERROR (OF1.2) (xid=0x55555555): HPL_ASYNC_INVALID +OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload +]) AT_CLEANUP AT_SETUP([encoding experimenter errors]) @@ -195,4 +207,19 @@ AT_CHECK( [00000000 03 01 00 18 12 34 56 78-ff ff 00 01 00 00 23 20 @&t@ 00000010 03 00 00 08 12 34 56 78- ]) +AT_CHECK( + [ovs-ofctl encode-error-reply HPL_ASYNC_INVALID 0100000812345678], [0], +[00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 04 ea @&t@ +00000010 ff ff 00 8c 01 00 00 08-12 34 56 78 @&t@ +]) +AT_CHECK( + [ovs-ofctl encode-error-reply HPL_ASYNC_INVALID 0200000812345678], [0], +[00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 04 ea @&t@ +00000010 ff ff 00 8c 02 00 00 08-12 34 56 78 @&t@ +]) +AT_CHECK( + [ovs-ofctl encode-error-reply HPL_ASYNC_INVALID 0300000812345678], [0], +[00000000 03 01 00 18 12 34 56 78-ff ff 00 8c 00 00 04 ea @&t@ +00000010 03 00 00 08 12 34 56 78- +]) AT_CLEANUP -- 1.7.2.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev