• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ check_packet_parse_expect_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: test_ofp_port_mod_handle_invalid_length8

void
test_ofp_port_mod_handle_invalid_length8(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  /* over size */
  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 2c 00 00 00 10 00 00 00 01 00 00 00 00 "
          "ff ff ff ff ff ff 00 00 00 00 00 24 00 00 00 04 "
          "00 00 00 05 00 00 00 00 ff ff ff ff",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid body error.");
}
开发者ID:D-TOKIOKA,项目名称:lagopus,代码行数:15,代码来源:ofp_port_mod_handler_test.c


示例17: test_ofp_set_config_handle_invalid_too_large_miss_send_len

void
test_ofp_set_config_handle_invalid_too_large_miss_send_len(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_SWITCH_CONFIG_FAILED, OFPSCFC_BAD_LEN);
  ret = check_packet_parse_expect_error(
          s_ofp_set_config_request_handle_wrap,
          "04 09 00 0c 00 00 00 10"
          "00 01 ff e6",
          /*
           *   <---> flags 0xffff is undefined
           *         <---> miss_send_len > OFPCML_MAX
           */
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid miss send len.");
}
开发者ID:tidatida,项目名称:lagopus,代码行数:17,代码来源:ofp_switch_config_handler_test.c


示例18: test_ofp_port_mod_handle_invalid_advertise

void
test_ofp_port_mod_handle_invalid_advertise(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_PORT_MOD_FAILED, OFPPMFC_BAD_ADVERTISE);
  ret = check_packet_parse_expect_error(
          ofp_port_mod_handle_wrap,
          "04 10 00 28 00 00 00 10 00 00 00 00 00 00 00 00 "
          "ff ff ff ff ff ff 00 00 00 00 00 24 00 00 00 24 "
          "80 00 00 00 00 00 00 00",
          /* ...-------------------> ofp_port_mod
           * <---------> advertise ( 1 << 31 is invalid ofp_port_features
           *             <--------> padding
           */
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid advertise should cause error");
}
开发者ID:D-TOKIOKA,项目名称:lagopus,代码行数:18,代码来源:ofp_port_mod_handler_test.c


示例19: test_ofp_set_config_handle_invalid_header_length

void
test_ofp_set_config_handle_invalid_header_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_set_config_request_handle_wrap,
          "04 09 00 08 00 00 00 10"
          /* sizeof(ofp_switch_config) is 12, but length is 8 */
          "00 01 ff e4",
          /*
           *   <---> flags
           *         <---> miss_send_len
           */
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid length.");
}
开发者ID:tidatida,项目名称:lagopus,代码行数:18,代码来源:ofp_switch_config_handler_test.c


示例20: test_ofp_role_request_handle_invalid_unknown_role

void
test_ofp_role_request_handle_invalid_unknown_role(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error = {0, 0, {NULL}};
  ofp_error_set(&expected_error, OFPET_ROLE_REQUEST_FAILED, OFPRRFC_BAD_ROLE);

  ret = check_packet_parse_expect_error(
          s_ofp_role_request_handle_wrap,
          "04 19 00 18 00 00 00 10 "
          "ff ff ff fe 00 00 00 00 "
          /*...-------------------... ofp_role_request
           * <---------> role = 0xfffffffe -> unknown role
           *             <---------> padding
           */
          "00 00 00 00 00 00 00 09 ",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "unknown rule should case error.");
}
开发者ID:lagopus,项目名称:lagopus,代码行数:19,代码来源:ofp_role_request_handler_test.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ check_param函数代码示例发布时间:2022-05-30
下一篇:
C++ check_op函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap