当前位置: 首页>>代码示例>>C++>>正文


C++ check_packet_parse_expect_error函数代码示例

本文整理汇总了C++中check_packet_parse_expect_error函数的典型用法代码示例。如果您正苦于以下问题:C++ check_packet_parse_expect_error函数的具体用法?C++ check_packet_parse_expect_error怎么用?C++ check_packet_parse_expect_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_packet_parse_expect_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_ofp_flow_handle_error_bad_match_length1

void
test_ofp_flow_handle_error_bad_match_length1(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_MATCH, OFPBMC_BAD_LEN);

  ret = check_packet_parse_expect_error(ofp_multipart_request_handle_wrap,
                                        "04 12 00 40 00 00 00 10 00 01 00 00 00 00 00 00 "
                                        "01 00 00 00 00 00 00 02 00 00 00 03 00 00 00 00 "
                                        "00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 05 "
                                        "00 01 00 0b 80 00 00 04 00 00 00 10 00 00 00 00",
                                        /* <---------------------------------------------> ofp_match
                                         * <---> type = 1
                                         *       <---> length = 11 : bad length (12)
                                         *             <---------> OXM TLV header (oxm_class = 0x8000
                                         *                                          -> OFPXMC_OPENFLOW_BASIC
                                         *                                         oxm_field = 0
                                         *                                          -> OFPXMT_OFB_IN_PORT,
                                         *                                         oxm_hashmask = 0,
                                         *                                         oxm_length = 8)
                                         *                         <---------> OXML TLV payload ( value = 1)
                                         *                                     <---------> padding
                                         */
                                        &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "bad match length error.");
}
开发者ID:lagopus,项目名称:lagopus,代码行数:27,代码来源:ofp_flow_handler_test.c

示例2: test_group_mod_handle_add_invalid_type

void
test_group_mod_handle_add_invalid_type(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_GROUP_MOD_FAILED, OFPGMFC_BAD_TYPE);
  ret = check_packet_parse_expect_error(
          ofp_group_mod_handle_wrap,
          "04 0f 00 80 00 00 00 10 00 00 fe 00 ff ff ff 00 "
          /* <----------------------------------------------... ofp_group_mod
           * <---------------------> ofp_header
           * <> version
           *    <> type
           *       <---> length = 8 * 16 bytes
           *             <---------> xid
           *                         <---> command ( 0 -> OFPGC_ADD
           *                               <> type ( fe -> unknown type
           *                                  <> padding
           *                                     <---------> group id = 0xffffff00
           */
          "00 30 00 02 00 00 00 03 00 00 00 04 00 00 00 00 "
          "00 00 00 10 00 00 00 0a 03 e8 00 00 00 00 00 00 "
          "00 00 00 10 00 00 00 14 07 d0 00 00 00 00 00 00 "
          "00 30 00 06 00 00 00 07 00 00 00 08 00 00 00 00 "
          "00 00 00 10 00 00 00 0a 03 e8 00 00 00 00 00 00 "
          "00 00 00 10 00 00 00 14 07 d0 00 00 00 00 00 00 "
          "00 10 00 02 00 00 00 03 00 00 00 04 00 00 00 00",
          &expected_error
        );
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "unknown type shoud case error");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:31,代码来源:ofp_group_mod_handler_test.c

示例3: test_ofp_error_msg_handle_wrong_long_length

void
test_ofp_error_msg_handle_wrong_long_length(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  ret = check_packet_parse_expect_error(s_ofp_error_msg_handle_wrap,
                                        "04 01 00 0c 00 00",
                                        &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(ret, LAGOPUS_RESULT_OFP_ERROR,
                            "ofp_error_msg_handle(error) error.");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:11,代码来源:ofp_error_handler_test.c

示例4: test_ofp_flow_handle_error_length2

void
test_ofp_flow_handle_error_length2(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* invalid body */
  ret = check_packet_parse_expect_error(
          ofp_multipart_request_handle,
          "04 12 00 40 00 00 00 10 00 01 00 00 00 00 00 00",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret, "invalid-body error");
}
开发者ID:lagopus,项目名称:lagopus,代码行数:12,代码来源:ofp_flow_handler_test.c

示例5: test_ofp_features_handle_invalid_version_too_large

void
test_ofp_features_handle_invalid_version_too_large(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_VERSION);
  ret = check_packet_parse_expect_error(
          ofp_features_request_handle,
          "05 05 00 08 00 00 00 10",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "ofp_features_request_handle(error) error.");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:12,代码来源:ofp_features_handler_test.c

示例6: test_ofp_group_features_request_handle_error_invalid_length0

void
test_ofp_group_features_request_handle_error_invalid_length0(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);

  ret = check_packet_parse_expect_error(ofp_multipart_request_handle_wrap,
                                        "04 12 00 10 00 00 00 10"
                                        "00 08 00 00 00 00 00",
                                        &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid-body error.");
}
开发者ID:tidatida,项目名称:lagopus,代码行数:13,代码来源:ofp_group_features_handler_test.c

示例7: test_ofp_get_config_handle_invalid_size_too_long

void
test_ofp_get_config_handle_invalid_size_too_long(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* over size */
  ret = check_packet_parse_expect_error(
          s_ofp_get_config_request_handle_wrap,
          "04 07 00 10 00 00 00 10 00 80",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "over size error.");
}
开发者ID:tidatida,项目名称:lagopus,代码行数:13,代码来源:ofp_switch_config_handler_test.c

示例8: test_ofp_echo_reply_handle_invalid_length_too_short

void
test_ofp_echo_reply_handle_invalid_length_too_short(void) {
    lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
    struct ofp_error expected_error = {0, 0, {NULL}};
    ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
    ret = check_packet_parse_expect_error(s_ofp_echo_reply_handle_wrap,
                                          // packets says "My length is 8 bytes"
                                          // but the real length is 7 bytes.
                                          "04 02 00 08 00 00 00",
                                          &expected_error);
    TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                              "ofp_echo_reply_handle(error) error.");
}
开发者ID:tidatida,项目名称:lagopus,代码行数:13,代码来源:ofp_echo_handler_test.c

示例9: test_ofp_port_mod_handle_invalid_length1

void
test_ofp_port_mod_handle_invalid_length1(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  /* no pad, hw_addr, pad2, config, mask, advertise, pad3 */
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  ret = check_packet_parse_expect_error(
          ofp_port_mod_handle_wrap,
          "04 10 00 0c 00 00 00 10 00 00 00 01",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid body error.");
}
开发者ID:D-TOKIOKA,项目名称:lagopus,代码行数:13,代码来源:ofp_port_mod_handler_test.c

示例10: test_ofp_queue_get_config_handle_invalid_length1

void
test_ofp_queue_get_config_handle_invalid_length1(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* invalid body (no pad) */
  ret = check_packet_parse_expect_error(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 0c 00 00 00 10 ff ff ff ff",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid-body error");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:13,代码来源:ofp_queue_config_handler_test.c

示例11: test_ofp_port_mod_handle_invalid_length

void
test_ofp_port_mod_handle_invalid_length(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  /* header only */
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  ret = check_packet_parse_expect_error(
          ofp_port_mod_handle_wrap,
          "04 10 00 08 00 00 00 10",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "no body error.");
}
开发者ID:D-TOKIOKA,项目名称:lagopus,代码行数:13,代码来源:ofp_port_mod_handler_test.c

示例12: test_ofp_table_mod_handle_wrap_invalid_length1

void
test_ofp_table_mod_handle_wrap_invalid_length1(void) {
    lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
    struct ofp_error expected_error = {0, 0, {NULL}};
    ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
    /* no pad, config */
    ret = check_packet_parse_expect_error(
              ofp_table_mod_handle_wrap,
              "04 11 00 09 00 00 00 10 01",
              &expected_error);
    TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                              "invalid body error.");
}
开发者ID:trojan00,项目名称:lagopus,代码行数:13,代码来源:ofp_table_mod_handler_test.c

示例13: test_group_mod_handle_add_invalid_length4

void
test_group_mod_handle_add_invalid_length4(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* no group_id, buckets */
  ret = check_packet_parse_expect_error(
          ofp_group_mod_handle_wrap,
          "04 0f 00 0c 00 00 00 10 00 00 00 00",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid body error.");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:13,代码来源:ofp_group_mod_handler_test.c

示例14: test_ofp_get_async_request_handle_invalid_no_body

void
test_ofp_get_async_request_handle_invalid_no_body(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);

  /* Case of decode error.*/
  ret = check_packet_parse_expect_error(
          s_ofp_get_async_request_handle_wrap_error,
          "",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "ofp_get_async_request_handle(error) error.");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:14,代码来源:ofp_get_async_handler_test.c

示例15: test_ofp_unsupported_handle

void
test_ofp_unsupported_handle(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};

  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_TYPE);
  ret = check_packet_parse_expect_error(
          ofp_unsupported_handle_wrap,
          "04 06 00 20 00 00 00 65 00 00 00 00 00 00 0a bc "
          "00 00 ff ff 03 00 00 00 00 00 00 00 00 00 00 00",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "ofp_unsupported_handle(normal) error.");
}
开发者ID:AkiraSuu,项目名称:lagopus,代码行数:14,代码来源:ofp_error_handler_test.c


注:本文中的check_packet_parse_expect_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。